soderlind / vscode-phpcbf

PHP Code Beautifier and Fixer for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=persoderlind.vscode-phpcbf
GNU General Public License v3.0
28 stars 10 forks source link

Feature Request: auto find executable and custom standard files. #11

Closed WraithKenny closed 6 years ago

WraithKenny commented 6 years ago

We could use the logic similar to the check of fs.exists(tmpExecutablePath) to check a few reasonable default locations, so that less configuration is necessary to run the extension.

For example, a typical place for the executable to be found is ${workspaceFolder}/vendor/bin/phpcbf and we could find that if no executablePath setting is set.

Additionally, if no standard is set, we could check for the existance of phpcs.xml and phpcs.xml.dist in the workspaceFolder, as these are standard names according to phpcs documentation.

soderlind commented 6 years ago

It does, sort of, just add phpcbf to your PATH, but again, why not look in the obvious places.

I plan to add better support for the rules file, ref #7