ikappas / vscode-phpcs

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

Linting is slow in Windows 10 #102

Closed sethstha closed 6 years ago

sethstha commented 6 years ago

I have installed PHP CodeSniffer, WordPress Coding Standard as composer dependencies and are installed locally. Also, rulesets are loaded from phpcs.xml.

Is it normal to take 6 seconds to lint 16 lines of code? while on command, it takes only 1 second.

I have tried installing phpcs globally and loading standard config from plugin's config. It makes no change.

ikappas commented 6 years ago

@sethstha Thank you for submitting this issue.

In your case, any delay is not due to the lines of code but rather may be system specific ie vscode-phpcs in my experience runs slower on Windows than in Mac/Linux.

Also, when running the command in a terminal you must specify all required parameters to get a result for the specific version of PHP_CodeSniffer you use.

The plugin has support for phpcs 1.x, 2.x and 3.x which adds a little overhead. Further configuration options perform file system searches that are the main source of delay.

To improve your performance, you can set some vscode configuration variables such as phpcs.executablePath and phpcs.standard while disabling phpcs.autoConfigSearch. For more information on these settings you can refer to the extension documentation.

Let me know if this helps.

sethstha commented 6 years ago

I tried every possible method. Nothing seems to speed it up in Windows 10. I think I will be sticking to my iMac.