ikappas / vscode-phpcs

PHP CodeSniffer for Visual Studio Code
MIT License
128 stars 56 forks source link

Network location path stdin-path #110

Open jroru opened 6 years ago

jroru commented 6 years ago

I recently switched from connecting to my dev server using network drives to using network locations.

vscode-phpcs automatic sniffing: phpcs: Unknown error ocurred. Please verify that C:\php\phpcs.bat --report=json -q --encoding=UTF-8 --standard=Drupal --error-severity=5 --warning-severity=5 --stdin-path=\y\update.php - returns a valid json object.

Even running these commands manually phpcs does not locate the file:

The only way I can get phpcs to sniff my file is by removing --stdin-path and instead running this; C:\php\phpcs.bat --report=json -q --encoding=UTF-8 --standard=Drupal --error-severity=5 --warning-severity=5 update.php

vladyrojas commented 6 years ago

I confirm the same problem:

When I use a workspace and it calls a network directory, it does not work.

greg7110 commented 6 years ago

Exactly the same problem.

Any solutions?

cybtachyon commented 4 years ago

I recommend mapping the network location as a network drive.

Assuming you want the new drive to be "Z:" and the network files are available at "\\wsl$\Ubuntu\your\path\to\the\files"...

CMD

net use z: \\wsl$\Ubuntu

Then you can access the files via the newly added drive.

If you need to add user/password etc. for access, see the net use /? documentation.

Open the files in VSCode using the network path, Z:\your\path\to\the\files\.

See https://github.com/ikappas/vscode-phpcs/issues/77