2

I've been trying to get vscode-phpcs extension from ikappas running in VSCode in my project for about 4 days. After ages of back and forth. I noticed, that the extension is scanned open files in the version control. This will also find there the correct errors. But when I open the file in the normal editor, the extension does not scann the file and no errors are displayed.

My attempts to solve the problem:

  • List item
  • uninstall and reinstall the extension
  • New installation of VSCode
  • Installation of phpcs into the project
  • declarating the rigth path
  • declarating the php rules path in setting.json

phpcs gets its rules from a phpcs.xml.dist file from the project. It also runs in the git worktree, but not in the normal editor area.

Here also two screenshots from my VSCode (Please excuse that some things are censored):

Version of the extension:

  • vscode-phpcs 1.0.5

Does anyone have this problem also, or does anyone have a solution for the problem?

jefiedler
  • 21
  • 2

1 Answers1

1

I got the same error as yours. I think it has a problem with the extension. I ended up changing the extension to https://marketplace.visualstudio.com/items?itemName=wongjn.php-sniffer and this works better. Besides getting the linter (phpcs) you can also do code formatting with this extension (the phpcbf part).