vscode-php-cs-fixer icon indicating copy to clipboard operation
vscode-php-cs-fixer copied to clipboard

support multiple path of executablePath in config

Open bluedasher13 opened this issue 4 years ago • 3 comments

Add a feature: php-cs-fixer.executablePath in the config could be a path list string with separator ;, just like php-cs-fixer.config.

For example, if php-cs-fixer.executablePath or php-cs-fixer.executablePathWindows is set to "${workspaceRoot}\\vendor\\bin\\php-cs-fixer.bat;D:\\.global\\vendor\\bin\\php-cs-fixer.bat;${extensionPath}\\php-cs-fixer.phar", then...

  1. First, it will check whether ${workspaceRoot}\\vendor\\bin\\php-cs-fixer.bat exists, and use it if it exists.
  2. If not exists, check whether D:\\.global\\vendor\\bin\\php-cs-fixer.bat exists, and use it if it exists.
  3. If still not exists, check whether ${extensionPath}\\php-cs-fixer.phar, and use it if it exists.
  4. If all of them don't exists, it will show the error message as usual.

I think this could be useful, because some project has OWN php-cs-fixer (such as v2.16.0 package + v2.16.0 .php_cs) under its folder, but some project may not, then it could do a fallback, use a GLOBAL php-cs-fixer (such as v3.0.x-dev package + v3.0.x-dev .php_cs).

bluedasher13 avatar Mar 20 '20 07:03 bluedasher13

if settings like this, (most of people, me too) "executablePath": "php-cs-fixer.bat" can not check the file exist. php-cs-fixer.bat is in system envionment variables Path folder.

junstyle avatar Mar 20 '20 08:03 junstyle

Okay, I've find the way to solve this problem and add some new features.

I'll push it and create a pull request soon.

bluedasher13 avatar Mar 27 '20 10:03 bluedasher13

Okay, I've find the way to solve this problem and add some new features.

I'll push it and create a pull request soon.

That's so sad, a part of new source code for new features was lost due to the auto-update of VS Code extension. (not all, lost about 25%)

Because I modify the files in .vscode\extensions\* directly and didn't backup every change...

So I need to rewrite that again (If I still remember it).

bluedasher13 avatar Apr 14 '20 17:04 bluedasher13