我想在VScode中添加phpcs CodeSniffer。我在visual studio中收到一个错误的phpcs: Request workspace/configuration failed with message: Unable to locate phpcs. Please add phpcs to your global path or use composer dependency manager to install it in your project locally.。我还安装了PHPCS和PEAR。我在用户设置和工作空间设置中尝试的这些代码也可以在VScode中使用"phpcs.composerJsonPath": "C:/wamp/wpcs/composer.json"。但是没有到达哪里,我应该如何设置路径?我的路径目录是C:\wamp\wpcs\phpcs。有没有人能建议我怎么做?
发布于 2018-08-30 18:17:00
最后,我得到了答案。首先,我在VScode中添加了扩展PHPCS和wpcs,然后在用户设置中添加了这些参数,确保PEAR和phpcs、WPCS安装在本地目录中。
{
"phpcs.standard": "WordPress",
"phpcs.enable": true,
"php.validate.executablePath": "C:/wamp/bin/php/php5.6.25",
"phpcs.executablePath": "C:/wamp/bin/php/php5.6.25/phpcs.bat",
"phpcs.autoConfigSearch": true
}设置好一切后,现在一切都正常了。
https://stackoverflow.com/questions/52070672
复制相似问题