question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using relative paths in config does not work

See original GitHub issue

I try to use relative paths in the workspace configuration to set the settings for the following two values "settings": { "php-cs-fixer.executablePath": "./typo3/vendor/bin/php-cs-fixer", "php-cs-fixer.config": ".php_cs" .... When I use the full path it works. But as this project may be checked out to various folders it is not possible to enter the full path. I also tried to use “${workspaceFolder}” but it does not work.

Any hints why this doesnt work, or how to achieve this? Thanks

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
Hakihirocommented, Nov 29, 2021

Hi,

You could use the ${workspaceRoot} to get the absolute path to your root project then go into your vendor.

In my case I used : ${workspaceRoot}/vendor/bin/php-cs-fixer

I’m wondering why this is not the recommended way to do it. Because when we are working on multiple projects, the version can be different in every project.

In addition, since I used https://github.com/kubawerlos/php-cs-fixer-custom-fixers I need to be in the context of my project because otherwise ->registerCustomFixers(new PhpCsFixerCustomFixers\Fixers()) could not be resolved.

0reactions
junstylecommented, Jun 8, 2022

‘’’           const pattern = /^${workspace(Root|Folder)}/; ‘’’ https://github.com/junstyle/vscode-php-cs-fixer/blob/master/extension.js#L76

workspaceRoot and workspaceFolder are the same value

Read more comments on GitHub >

github_iconTop Results From Across the Web

Relative path in configuration file
I tried this in configuration file: '.\Applications\MyFirstApp\MyFirstApp.exe', but its not working. I need a relative path that is working ...
Read more >
How should software tools interpret relative paths in ...
We have exactly this problem: a command line tool that takes a path to a config file and acts upon certain files referenced...
Read more >
File path formats on Windows systems
These "drive relative" paths are a common source of program and script logic errors. Assuming that a path beginning with a letter and...
Read more >
Simple trick to work with relative paths in Python
The trick is to define a variable that calculate the absolute path to our root in a file and then import this variable...
Read more >
Status - Bugs - Eclipse.org
This works with normal git, and the relative path should be based on the directory the git config file is location. But when...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found