felixfbecker / php-language-server

PHP Implementation of the VS Code Language Server Protocol 🆚↔🖥
ISC License
1.16k stars 185 forks source link

Formatter ignores installed_paths. #450

Closed Vagr9K closed 7 years ago

Vagr9K commented 7 years ago

First of all, thanks for the great extension!

I'm trying to setup formatting for the Wordpress codebase.

wp-coding-standards/wpcs and phpcs are installed globally.

Output of phpcs --config-show:

installed_paths: /home/ruben/.config/composer/vendor/wp-coding-standards/wpcs        
verbosity:       10  

phpcs -i:

The installed coding standards are PSR1, Zend, Squiz, PEAR, MySource, PSR2, WordPress-Core, WordPress-VIP, WordPress-Extra, WordPress-Docs and WordPress

My phpcs.xml.dist:

<?xml version="1.0"?>
<ruleset name="Example Project">
        <description>A custom set of rules to check for a WPized WordPress project</description>

        <!-- Exclude WP Core folders and files from being checked. -->
        <exclude-pattern>/docroot/wp-admin/*</exclude-pattern>
        <exclude-pattern>/docroot/wp-includes/*</exclude-pattern>
        <exclude-pattern>/docroot/wp-*.php</exclude-pattern>
        <exclude-pattern>/docroot/index.php</exclude-pattern>
        <exclude-pattern>/docroot/xmlrpc.php</exclude-pattern>
        <exclude-pattern>/docroot/wp-content/plugins/*</exclude-pattern>

        <!-- Exclude the Composer Vendor directory. -->
        <exclude-pattern>/vendor/*</exclude-pattern>

        <!-- Exclude the Node Modules directory. -->
        <exclude-pattern>/node_modules/*</exclude-pattern>

        <!-- Exclude minified Javascript files. -->
        <exclude-pattern>*.min.js</exclude-pattern>

        <!-- Include the WordPress-Extra standard. -->
    <rule ref="WordPress" />
</ruleset>

phpcs -e:


The Example Project standard contains 121 sniffs

Generic (33 sniffs)
-------------------
  Generic.Classes.DuplicateClassName
  Generic.Classes.OpeningBraceSameLine
  Generic.CodeAnalysis.EmptyStatement
  Generic.CodeAnalysis.ForLoopShouldBeWhileLoop
  Generic.CodeAnalysis.ForLoopWithTestFunctionCall
  Generic.CodeAnalysis.JumbledIncrementer
  Generic.CodeAnalysis.UnconditionalIfStatement
  Generic.CodeAnalysis.UnnecessaryFinalModifier
  Generic.CodeAnalysis.UselessOverridingMethod
  Generic.Commenting.DocComment
  Generic.Commenting.Fixme
  Generic.Commenting.Todo
  Generic.ControlStructures.InlineControlStructure
  Generic.Files.ByteOrderMark
  Generic.Files.EndFileNewline
  Generic.Files.LineEndings
  Generic.Formatting.DisallowMultipleStatements
  Generic.Formatting.SpaceAfterCast
  Generic.Functions.CallTimePassByReference
  Generic.Functions.OpeningFunctionBraceKernighanRitchie
  Generic.NamingConventions.UpperCaseConstantName
  Generic.PHP.BacktickOperator
  Generic.PHP.DeprecatedFunctions
  Generic.PHP.DisallowAlternativePHPTags
  Generic.PHP.DisallowShortOpenTag
  Generic.PHP.ForbiddenFunctions
  Generic.PHP.LowerCaseConstant
  Generic.PHP.LowerCaseKeyword
  Generic.PHP.NoSilencedErrors
  Generic.PHP.Syntax
  Generic.Strings.UnnecessaryStringConcat
  Generic.WhiteSpace.DisallowSpaceIndent
  Generic.WhiteSpace.ScopeIndent

PEAR (2 sniffs)
---------------
  PEAR.Functions.FunctionCallSignature
  PEAR.NamingConventions.ValidClassName

PSR2 (3 sniffs)
---------------
  PSR2.ControlStructures.ElseIfDeclaration
  PSR2.ControlStructures.SwitchDeclaration
  PSR2.Files.ClosingTag

Squiz (26 sniffs)
-----------------
  Squiz.Classes.SelfMemberReference
  Squiz.Commenting.BlockComment
  Squiz.Commenting.ClassComment
  Squiz.Commenting.ClosingDeclarationComment
  Squiz.Commenting.DocCommentAlignment
  Squiz.Commenting.EmptyCatchComment
  Squiz.Commenting.FileComment
  Squiz.Commenting.FunctionComment
  Squiz.Commenting.FunctionCommentThrowTag
  Squiz.Commenting.InlineComment
  Squiz.Commenting.VariableComment
  Squiz.ControlStructures.ControlSignature
  Squiz.Functions.FunctionDeclarationArgumentSpacing
  Squiz.Functions.FunctionDuplicateArgument
  Squiz.Operators.IncrementDecrementUsage
  Squiz.Operators.ValidLogicalOperators
  Squiz.PHP.CommentedOutCode
  Squiz.PHP.DisallowMultipleAssignments
  Squiz.PHP.DisallowSizeFunctionsInLoops
  Squiz.PHP.EmbeddedPhp
  Squiz.PHP.Eval
  Squiz.PHP.NonExecutableCode
  Squiz.Strings.ConcatenationSpacing
  Squiz.Strings.DoubleQuoteUsage
  Squiz.WhiteSpace.CastSpacing
  Squiz.WhiteSpace.SuperfluousWhitespace

WordPress (57 sniffs)
---------------------
  WordPress.Arrays.ArrayAssignmentRestrictions
  WordPress.Arrays.ArrayDeclaration
  WordPress.Arrays.ArrayDeclarationSpacing
  WordPress.Arrays.ArrayIndentation
  WordPress.Arrays.ArrayKeySpacingRestrictions
  WordPress.Arrays.CommaAfterArrayItem
  WordPress.CSRF.NonceVerification
  WordPress.Classes.ClassInstantiation
  WordPress.CodeAnalysis.EmptyStatement
  WordPress.DB.RestrictedClasses
  WordPress.DB.RestrictedFunctions
  WordPress.Files.FileName
  WordPress.Functions.DontExtract
  WordPress.Functions.FunctionCallSignatureNoParams
  WordPress.Functions.FunctionRestrictions
  WordPress.NamingConventions.PrefixAllGlobals
  WordPress.NamingConventions.ValidFunctionName
  WordPress.NamingConventions.ValidHookName
  WordPress.NamingConventions.ValidVariableName
  WordPress.PHP.DevelopmentFunctions
  WordPress.PHP.DiscouragedFunctions
  WordPress.PHP.DiscouragedPHPFunctions
  WordPress.PHP.POSIXFunctions
  WordPress.PHP.StrictComparisons
  WordPress.PHP.StrictInArray
  WordPress.PHP.YodaConditions
  WordPress.VIP.AdminBarRemoval
  WordPress.VIP.CronInterval
  WordPress.VIP.DirectDatabaseQuery
  WordPress.VIP.FileSystemWritesDisallow
  WordPress.VIP.OrderByRand
  WordPress.VIP.PluginMenuSlug
  WordPress.VIP.PostsPerPage
  WordPress.VIP.RestrictedFunctions
  WordPress.VIP.RestrictedVariables
  WordPress.VIP.SessionFunctionsUsage
  WordPress.VIP.SessionVariableUsage
  WordPress.VIP.SlowDBQuery
  WordPress.VIP.SuperGlobalInputUsage
  WordPress.VIP.TimezoneChange
  WordPress.VIP.ValidatedSanitizedInput
  WordPress.Variables.GlobalVariables
  WordPress.Variables.VariableRestrictions
  WordPress.WP.AlternativeFunctions
  WordPress.WP.CapitalPDangit
  WordPress.WP.DeprecatedClasses
  WordPress.WP.DeprecatedFunctions
  WordPress.WP.DeprecatedParameters
  WordPress.WP.DiscouragedFunctions
  WordPress.WP.EnqueuedResources
  WordPress.WP.I18n
  WordPress.WP.PreparedSQL
  WordPress.WhiteSpace.CastStructureSpacing
  WordPress.WhiteSpace.ControlStructureSpacing
  WordPress.WhiteSpace.DisallowInlineTabs
  WordPress.WhiteSpace.OperatorSpacing
  WordPress.XSS.EscapeOutput

Error inside VSCode:

[Error - 2:33:00 AM] Request textDocument/formatting failed.
  Message: PHP_CodeSniffer\Exceptions\RuntimeException: Referenced sniff "WordPress" does not exist in /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/squizlabs/php_codesniffer/src/Ruleset.php:749
Stack trace:
#0 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/squizlabs/php_codesniffer/src/Ruleset.php(338): PHP_CodeSniffer\Ruleset->expandRulesetReference(Object(SimpleXMLElement), '/srv/http', 0)
#1 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/squizlabs/php_codesniffer/src/Ruleset.php(179): PHP_CodeSniffer\Ruleset->processRuleset('/srv/http/phpcs...')
#2 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/felixfbecker/language-server/src/Formatter.php(48): PHP_CodeSniffer\Ruleset->__construct(Object(PHP_CodeSniffer\Config))
#3 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/felixfbecker/language-server/src/PhpDocument.php(179): LanguageServer\Formatter::format('<?php\n/**\n * Ou...', 'file:///srv/htt...')
#4 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/felixfbecker/language-server/src/Server/TextDocument.php(172): LanguageServer\PhpDocument->getFormattedText()
#5 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/sabre/event/lib/Promise.php(242): LanguageServer\Server\TextDocument->LanguageServer\Server\{closure}(Object(LanguageServer\PhpDocument))
#6 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/sabre/event/lib/Loop/Loop.php(261): Sabre\Event\Promise->Sabre\Event\{closure}()
#7 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/sabre/event/lib/Loop/Loop.php(215): Sabre\Event\Loop\Loop->runNextTicks()
#8 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/sabre/event/lib/Loop/Loop.php(194): Sabre\Event\Loop\Loop->tick(true)
#9 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/sabre/event/lib/Loop/functions.php(122): Sabre\Event\Loop\Loop->run()
#10 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/felixfbecker/language-server/bin/php-language-server.php(102): Sabre\Event\Loop\run()
#11 {main}
  Code: -32603 

NOTE: I can bypass the missing standard error by using the full path in phpcs.xml.dist:

<?xml version="1.0"?>
<ruleset name="Example Project">
    <description>A custom set of rules to check for a WPized WordPress project</description>

    <!-- Exclude WP Core folders and files from being checked. -->
    <exclude-pattern>/docroot/wp-admin/*</exclude-pattern>
    <exclude-pattern>/docroot/wp-includes/*</exclude-pattern>
    <exclude-pattern>/docroot/wp-*.php</exclude-pattern>
    <exclude-pattern>/docroot/index.php</exclude-pattern>
    <exclude-pattern>/docroot/xmlrpc.php</exclude-pattern>
    <exclude-pattern>/docroot/wp-content/plugins/*</exclude-pattern>

    <!-- Exclude the Composer Vendor directory. -->
    <exclude-pattern>/vendor/*</exclude-pattern>

    <!-- Exclude the Node Modules directory. -->
    <exclude-pattern>/node_modules/*</exclude-pattern>

    <!-- Exclude minified Javascript files. -->
    <exclude-pattern>*.min.js</exclude-pattern>

    <!-- Include the WordPress-Extra standard. -->
    <rule ref="/home/ruben/.config/composer/vendor/wp-coding-standards/wpcs/WordPress" />
</ruleset>

But the extension still fails:

[Error - 2:35:32 AM] Request textDocument/formatting failed.
  Message: PHP_CodeSniffer\Exceptions\RuntimeException: Referenced sniff "WordPress-Core" does not exist in /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/squizlabs/php_codesniffer/src/Ruleset.php:749
Stack trace:
#0 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/squizlabs/php_codesniffer/src/Ruleset.php(338): PHP_CodeSniffer\Ruleset->expandRulesetReference(Object(SimpleXMLElement), '/home/ruben/.co...', 2)
#1 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/squizlabs/php_codesniffer/src/Ruleset.php(734): PHP_CodeSniffer\Ruleset->processRuleset('/home/ruben/.co...', 2)
#2 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/squizlabs/php_codesniffer/src/Ruleset.php(338): PHP_CodeSniffer\Ruleset->expandRulesetReference(Object(SimpleXMLElement), '/srv/http', 0)
#3 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/squizlabs/php_codesniffer/src/Ruleset.php(179): PHP_CodeSniffer\Ruleset->processRuleset('/srv/http/phpcs...')
#4 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/felixfbecker/language-server/src/Formatter.php(48): PHP_CodeSniffer\Ruleset->__construct(Object(PHP_CodeSniffer\Config))
#5 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/felixfbecker/language-server/src/PhpDocument.php(179): LanguageServer\Formatter::format('<?php\n/**\n * Ou...', 'file:///srv/htt...')
#6 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/felixfbecker/language-server/src/Server/TextDocument.php(172): LanguageServer\PhpDocument->getFormattedText()
#7 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/sabre/event/lib/Promise.php(242): LanguageServer\Server\TextDocument->LanguageServer\Server\{closure}(Object(LanguageServer\PhpDocument))
#8 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/sabre/event/lib/Loop/Loop.php(261): Sabre\Event\Promise->Sabre\Event\{closure}()
#9 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/sabre/event/lib/Loop/Loop.php(215): Sabre\Event\Loop\Loop->runNextTicks()
#10 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/sabre/event/lib/Loop/Loop.php(194): Sabre\Event\Loop\Loop->tick(true)
#11 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/sabre/event/lib/Loop/functions.php(122): Sabre\Event\Loop\Loop->run()
#12 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/felixfbecker/language-server/bin/php-language-server.php(102): Sabre\Event\Loop\run()
#13 {main}
  Code: -32603 

Or when using WordPress-Core instead of Wordpress:

[Error - 2:36:44 AM] Request textDocument/formatting failed.
  Message: PHP_CodeSniffer\Exceptions\RuntimeException: Referenced sniff "WordPress.Arrays.ArrayIndentation" does not exist in /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/squizlabs/php_codesniffer/src/Ruleset.php:749
Stack trace:
#0 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/squizlabs/php_codesniffer/src/Ruleset.php(338): PHP_CodeSniffer\Ruleset->expandRulesetReference(Object(SimpleXMLElement), '/home/ruben/.co...', 2)
#1 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/squizlabs/php_codesniffer/src/Ruleset.php(734): PHP_CodeSniffer\Ruleset->processRuleset('/home/ruben/.co...', 2)
#2 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/squizlabs/php_codesniffer/src/Ruleset.php(338): PHP_CodeSniffer\Ruleset->expandRulesetReference(Object(SimpleXMLElement), '/srv/http', 0)
#3 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/squizlabs/php_codesniffer/src/Ruleset.php(179): PHP_CodeSniffer\Ruleset->processRuleset('/srv/http/phpcs...')
#4 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/felixfbecker/language-server/src/Formatter.php(48): PHP_CodeSniffer\Ruleset->__construct(Object(PHP_CodeSniffer\Config))
#5 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/felixfbecker/language-server/src/PhpDocument.php(179): LanguageServer\Formatter::format('<?php\n/**\n * Wo...', 'file:///srv/htt...')
#6 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/felixfbecker/language-server/src/Server/TextDocument.php(172): LanguageServer\PhpDocument->getFormattedText()
#7 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/sabre/event/lib/Promise.php(242): LanguageServer\Server\TextDocument->LanguageServer\Server\{closure}(Object(LanguageServer\PhpDocument))
#8 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/sabre/event/lib/Loop/Loop.php(261): Sabre\Event\Promise->Sabre\Event\{closure}()
#9 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/sabre/event/lib/Loop/Loop.php(215): Sabre\Event\Loop\Loop->runNextTicks()
#10 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/sabre/event/lib/Loop/Loop.php(194): Sabre\Event\Loop\Loop->tick(true)
#11 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/sabre/event/lib/Loop/functions.php(122): Sabre\Event\Loop\Loop->run()
#12 /home/ruben/.vscode/extensions/felixfbecker.php-intellisense-1.5.0/vendor/felixfbecker/language-server/bin/php-language-server.php(102): Sabre\Event\Loop\run()
#13 {main}
  Code: -32603 
duplicate-issues[bot] commented 7 years ago

Hey @Vagr9K,

We did a quick check and this issue looks very darn similar to

This could be a coincidence, but if any of these issues solves your problem then I did a good job :smile:

If not, the maintainers will get to this issue shortly.

Cheers, Your Friendly Neighborhood ProBot

Vagr9K commented 7 years ago

Sorry bot, but you failed miserably.

kimhornung commented 7 years ago

I experienced the same issue when I today was working on a project that has a phpcs.xml file as part of the project.

I found out that I can add the missing rulesets by calling the version of phpcs that is embedded in the extension with the --config-set parameter (your paths both to the extension and the config file will probably be different): $HOME/.vscode/extensions/felixfbecker.php-intellisense-1.5.1/vendor/squizlabs/php_codesniffer/bin/phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs

Unfortunately, this only causes another error to appear. In Visual Studio Code, the following error now appears:

[Info  - 23:34:46] Connection to server got closed. Server will restart.
[Error - 23:34:46] Request textDocument/formatting failed.
Error: Connection got disposed.
    at Object.dispose (/Users/Kim/.vscode/extensions/felixfbecker.php-intellisense-1.5.1/node_modules/vscode-jsonrpc/lib/main.js:816:25)
    at Object.dispose (/Users/Kim/.vscode/extensions/felixfbecker.php-intellisense-1.5.1/node_modules/vscode-languageclient/lib/client.js:66:35)
    at LanguageClient.handleConnectionClosed (/Users/Kim/.vscode/extensions/felixfbecker.php-intellisense-1.5.1/node_modules/vscode-languageclient/lib/client.js:1071:38)
    at LanguageClient.handleConnectionClosed (/Users/Kim/.vscode/extensions/felixfbecker.php-intellisense-1.5.1/node_modules/vscode-languageclient/lib/main.js:86:15)
    at closeHandler (/Users/Kim/.vscode/extensions/felixfbecker.php-intellisense-1.5.1/node_modules/vscode-languageclient/lib/client.js:1059:18)
    at CallbackList.invoke (/Users/Kim/.vscode/extensions/felixfbecker.php-intellisense-1.5.1/node_modules/vscode-jsonrpc/lib/events.js:114:39)
    at Emitter.fire (/Users/Kim/.vscode/extensions/felixfbecker.php-intellisense-1.5.1/node_modules/vscode-jsonrpc/lib/events.js:178:36)
    at closeHandler (/Users/Kim/.vscode/extensions/felixfbecker.php-intellisense-1.5.1/node_modules/vscode-jsonrpc/lib/main.js:212:26)
    at CallbackList.invoke (/Users/Kim/.vscode/extensions/felixfbecker.php-intellisense-1.5.1/node_modules/vscode-jsonrpc/lib/events.js:114:39)
    at Emitter.fire (/Users/Kim/.vscode/extensions/felixfbecker.php-intellisense-1.5.1/node_modules/vscode-jsonrpc/lib/events.js:178:36)
    at StreamMessageWriter.AbstractMessageWriter.fireClose (/Users/Kim/.vscode/extensions/felixfbecker.php-intellisense-1.5.1/node_modules/vscode-jsonrpc/lib/messageWriter.js:48:27)
    at Socket.<anonymous> (/Users/Kim/.vscode/extensions/felixfbecker.php-intellisense-1.5.1/node_modules/vscode-jsonrpc/lib/messageWriter.js:70:63)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at Pipe._handle.close [as _onclose] (net.js:510:12)

But if I run $HOME/.vscode/extensions/felixfbecker.php-intellisense-1.5.1/vendor/squizlabs/php_codesniffer/bin/phpcsfrom the terminal, it gives me the following error:

PHP Fatal error:  Class 'WordPress\AbstractArrayAssignmentRestrictionsSniff' not found in /Users/Kim/.composer/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayAssignmentRestrictionsSniff.php on line 30
PHP Stack trace:
PHP   1. {main}() /Users/Kim/.vscode/extensions/felixfbecker.php-intellisense-1.5.1/vendor/squizlabs/php_codesniffer/bin/phpcs:0
PHP   2. PHP_CodeSniffer\Runner->runPHPCS() /Users/Kim/.vscode/extensions/felixfbecker.php-intellisense-1.5.1/vendor/squizlabs/php_codesniffer/bin/phpcs:18
PHP   3. PHP_CodeSniffer\Runner->init() /Users/Kim/.vscode/extensions/felixfbecker.php-intellisense-1.5.1/vendor/squizlabs/php_codesniffer/src/Runner.php:67
PHP   4. PHP_CodeSniffer\Ruleset->__construct() /Users/Kim/.vscode/extensions/felixfbecker.php-intellisense-1.5.1/vendor/squizlabs/php_codesniffer/src/Runner.php:272
PHP   5. PHP_CodeSniffer\Ruleset->registerSniffs() /Users/Kim/.vscode/extensions/felixfbecker.php-intellisense-1.5.1/vendor/squizlabs/php_codesniffer/src/Ruleset.php:197
PHP   6. PHP_CodeSniffer\Autoload::loadFile() /Users/Kim/.vscode/extensions/felixfbecker.php-intellisense-1.5.1/vendor/squizlabs/php_codesniffer/src/Ruleset.php:1042
PHP   7. include() /Users/Kim/.vscode/extensions/felixfbecker.php-intellisense-1.5.1/vendor/squizlabs/php_codesniffer/autoload.php:134

I speculate that this might happen because the current builtin version of phpcs in the extension is 3.0.0RC3 (beta), while the wp-coding-standards page state v3.0.2 as the minimum version of phpcs.