Vscode-intelephense: intelephense.files.exclude always merge with files.exclude.

Created on 12 Jun 2020  路  3Comments  路  Source: bmewburn/vscode-intelephense

Describe the bug
By using the setting intelephense.files.exclude, the files/folders that are hidden are merged with files.exclude, and thus the behavior is not intuitive, and also is making the setting pretty much very rigid since we cannot override the files setting.

To Reproduce

  1. Add a folder to files.exclude.
  2. Watch the folder being excluded from intelephense indexing, whether or not intelephense.files.exclude is set.

Expected behavior
Whether solution 1 or 2 should fix the problem I think.

1:
As the setting description suggest,

Configure glob patterns to exclude certain files and folders from all language server features. Inherits from files.exclude.

The setting should inherit from files.exclude. This means that only if intelephense.files.exclude setting is not set should use files.exclude. If the setting intelephense.files.exclude is set, it should use only intelephense.files.exclude ( and not merged ).

2:
Add a new setting like "Intelephense.files.exclude.merge": true/false. Whether or not files.exclude should merge with "Intelephense.files.exclude" setting.
This is much better than first solution since "Intelephense.files.exclude.merge": true will make the extension backward compatibility, and maybe some people want them to be merged.

Most helpful comment

Yes, for example to see all PHPUnit asserts functions/methods included with composer, I can use in Intelephense.files.exclude: **/vendor/!(phpunit)/* (that's the thing that I want to index), and in files.exclude i use **/vendor/*, since I want to hide all the folder in explorer because is used for static analyse/linting/testing ... etc.

And another thing is that PHPUnit stubs are not available in Intelephense, and even if they would, I don't use the last version, PHPUnit 9, I use 7 because that's the current version supported by WordPress.

Thanks.

All 3 comments

intelephense.files.exclude was added as a way to keep all intelephense config in one place for easier use with other clients. So the original intention is that it is the same as files.exclude which is why they get merged. Do you have a specific use case where you would want files excluded from vscode but still available by intelephense?

Yes, for example to see all PHPUnit asserts functions/methods included with composer, I can use in Intelephense.files.exclude: **/vendor/!(phpunit)/* (that's the thing that I want to index), and in files.exclude i use **/vendor/*, since I want to hide all the folder in explorer because is used for static analyse/linting/testing ... etc.

And another thing is that PHPUnit stubs are not available in Intelephense, and even if they would, I don't use the last version, PHPUnit 9, I use 7 because that's the current version supported by WordPress.

Thanks.

I wanna exclude the composer vendor directory in the vs code file explorer as well, but need this directory of course get parsed by intelephense. intelephense should use only its own exclude option.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

steven7mwesigwa picture steven7mwesigwa  路  4Comments

swashata picture swashata  路  3Comments

bgreco picture bgreco  路  4Comments

dgunay picture dgunay  路  3Comments

pseudoanime picture pseudoanime  路  3Comments