Skip to content

includePaths doesn't work #1069

@JaPawel

Description

@JaPawel

I am using PHP-CS-Fixer and I have .php_cs.dist file in my workspace. It's something like this:

<?php

return PhpCsFixer\Config::create()
    ->setRiskyAllowed(true)
    ->setRules([
    ...
    ])
;

I have added file association:

"files.associations": {
    ".php_cs.dist": "php",
    ...
},

PHP-CS-Fixer is installed globally, so this library is not in my vendor directory, therefore intelephense shows an error when cursor is on PhpCsFixer\Config: Undefined type 'PhpCsFixer\Config'.intelephense(1009).

To get rid of this error, I have added intelephense.environment.includePaths entry:

"intelephense.environment.includePaths": [
    "/Users/username/.composer/vendor/friendsofphp/php-cs-fixer/src"
],

Unfortunately it doesn't work (tried reloading window, reloading vscode, reindexing workspace). Error still occurs. Path is valid, class file exists, namespace is valid.
Everything is fine when PHP-CS-Fixer is installed internally (inside local vendor directory).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions