valeryan / vscode-phpsab

Php Sniffer and Beautifier for VS Code
https://marketplace.visualstudio.com/items?itemName=ValeryanM.vscode-phpsab
MIT License
58 stars 12 forks source link

ERROR: command 'fixer.fix' not found #108

Closed ThemisTh closed 9 months ago

ThemisTh commented 9 months ago

I have Windows 11 in my system and installed phpcs globally using composer. I configured the phpsab.executablePathCS and phpsab.executablePathCBF manually in the settings.json as suggested in the documentation and then reloaded VS Code. When I use the PHPCBF: Fix this file Command on a php file I get an error that 'fixer.fix' command is not found. When I select Format Document, i get an error that Extension 'PHP Sniffer & Beautifier' is configured as formatter but it cannot format 'PHP' -files.

My settings for PHP Sniffer & Beautifier are:

"phpsab.composerJsonPath": "C:\\Users\\Username\\AppData\\Roaming\\Composer\\composer.json",
"phpsab.executablePathCBF": "C:\\Users\\Username\\AppData\\Roaming\\Composer\\vendor\\bin\\phpcbf.bat",
"phpsab.executablePathCS": "C:\\Users\\Username\\AppData\\Roaming\\Composer\\vendor\\bin\\phpcs.bat",
"phpsab.snifferMode": "onType",
"phpsab.snifferShowSources": true,
"phpsab.autoRulesetSearch": false,
"phpsab.standard": "WordPress",
"[php]": {
    "editor.defaultFormatter": "valeryanm.vscode-phpsab"
}

I would appreciate any assistance or guidance on resolving these issues. Thank you.

valeryan commented 9 months ago

To troubleshoot your issue I would need info. Open you terminal via cmd + ~ or whatever it is on windows... maybe ctrl+~ Go to the Output tab and select PHP Sniffer & Beautifier and see if you see any output or errors. If you do not see the output channel got to your help menu and select Toggle Developer Tools and post any errors there that seem related to the extension.

ThemisTh commented 9 months ago

This is the Output of PHP Sniffer & Beautifier in VS Code Terminal: ["INFO" - 6:52:17 PM] Extension Name: valeryanm.vscode-phpsab. ["INFO" - 6:52:17 PM] Extension Version: 0.0.0.

This is what I see in the Developer Tools: image

valeryan commented 9 months ago

I had some issues in my global path resolution that I have a fix for. It may resolve your issue, but you may also have something in your settings that is breaking the extension. Once #115 is released let me know if you still have your issue and we can dig a bit.

ThemisTh commented 9 months ago

It now works! Thank you so much!!

jonathanbossenger commented 9 months ago

Nice work @valeryan.