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

Fails if Path contains Spaces on Mac #136

Closed djstini closed 1 month ago

djstini commented 2 months ago

Hey,

somehow recently i get the following error when trying to format a file in a path containing a Space:

SyntaxError: Unexpected token 'E', "ERROR: The"... is not valid JSON
["ERROR" - 10:25:58] ERROR: The file "Sites/xxx/app/public/... does not exist.

The file i am trying to format is in "/Local Sites/xxx/app/public/..." so i am rather sure that it is a problem passing the space to the formatter.

This used to work before.

Cheers, Dennis

bitojoe commented 2 months ago

Can confirm I'm also experiencing this. Rolled back to the previous version for now.

phalkmin commented 1 month ago

Yep, same error here

zrrmfa commented 1 month ago

same

aslamdoctor commented 1 month ago

Same issue.

pablofsc commented 1 month ago

Same on Windows. Rolling back to 0.0.18 fixed it.

Dekadinious commented 1 month ago

Fails on Windows 10 on & also, and spaces.

jonathanbossenger commented 1 month ago

It looks like the fix for #128 has introduced this error because removing shell: true from the spawn options object resolves this issue.

I will continue investigating.

jonathanbossenger commented 1 month ago

I have created #139 to fix this issue.

I don't have access to a Windows machine at the moment (I'm away from my office for a week), so if anyone can help test the PR in Windows, that would be helpful. Otherwise I can test when I get back.

mhmdAmin commented 1 month ago

@jonathanbossenger I'm on a Windows machine now and can confirm that the issue still exists

Here is the error:

ERROR: The file "Sites\amin\app\public\wp-content\plugins\aminz-elementor-addons\includes\widgets\traits\aminz-buttons-group-trait.php" does not exist.

Run "phpcs --help" for usage information

SyntaxError: Unexpected token 'E', "ERROR: The"... is not valid JSON