Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support multiple path of executablePath in config #110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bluedasher13
Copy link
Contributor

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).

@junstyle
Copy link
Owner

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.

@bluedasher13 bluedasher13 reopened this Mar 27, 2020
@bluedasher13
Copy link
Contributor Author

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
Copy link
Contributor Author

bluedasher13 commented Apr 14, 2020

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants