Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stubs File Linting Errors #98

Open
ObliviousHarmony opened this issue Aug 31, 2024 · 1 comment
Open

Stubs File Linting Errors #98

ObliviousHarmony opened this issue Aug 31, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ObliviousHarmony
Copy link
Owner

Description

Despite being excluded via **/node_modules/**, this error appears:

Failed to locate a PHPCS configuration file for "/Users/obliviousharmony/.vscode/extensions/bmewburn.vscode-intelephense-client-1.12.4/node_modules/intelephense/lib/stub/standard/standard_9.php".

Reproduction Steps

  1. Use Intelephense
  2. Navigate to source, in my case, using CMD + Left Click on a function like array_intersect().

Expected Behavior

There should be no error. This might indicate a deeper problem with config file resolution for excluded files but that's just a theory.

@ObliviousHarmony ObliviousHarmony added the bug Something isn't working label Aug 31, 2024
@ObliviousHarmony
Copy link
Owner Author

I spent a little bit of time on this and it seems that Configuration::traverseWorkspaceFolders() indicates that it'll only traverse to the workspace folder. This doesn't work for files outside of the workspace and it'll traverse to the filesystem root. As a consequence, it'll give some errors.

I'd like to say it's just a matter of excluding files from outside of the workspace but I'm pretty sure that'll break the extension when opening it on single files with a global configuration. I'll need to look into how VS Code handles files outside of the workspace (does it create a new workspace for that file or is it not part of a workspace?)

Aside from that, the errors that the extension throws are really obtrusive. It sometimes hijacks the editor to focus on the terminal output and spams little prompts that the extension encountered an error. We should probably only be erroring if the user should have rightfully expected linting to work and it didn't. For instance, provide a diagnostic error for the whole document indicating that it wasn't able to lint it?

This can be handled using ignore patterns for now so I'll leave it be for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant