Php-language-server: Config for ignoring warning/errors from certain folders

Created on 18 Nov 2016  路  13Comments  路  Source: felixfbecker/php-language-server

_From @hworld on November 18, 2016 16:59_

In the language server project it says: "Errors/Warnings from the vendor directory are ignored."

Would be great to have a way to specify either a different directory, or multiple directories. Right now my composer.json has this:

"config": {
    "vendor-dir": "library"
},

_Copied from original issue: felixfbecker/vscode-php-intellisense#33_

enhancement help wanted

Most helpful comment

Then please take this bit of feedback: posting comments like that on issues will not make them get fixed any faster. All it does is spam maintainers with countless notifications. It doesn't magically give me the time and motivation to spend my free time in implementing something I personally don't get any value out of. If you care _that_ much about this, then clone this repo, roll up your sleeves and implement it. This is open source. It is not a difficult feature by any means. And this is all just PHP code which I assume you are familiar with. The reason I write documentation on every single method is so that other people can jump in and contribute. If you _don't_ care that much about this feature why would I? By nagging you act like I owe you to implement this. I don't. Yes, this issue is almost one year old, so what? Open Source developer burnout is a thing, and this contributes to it.

All 13 comments

Will likely add something like exclude: ["**/vendor", "**/node_modules"] in the future

I need this. Use case is: we have a library directory with some 3rd party code (stuff that can't be loaded via Composer unfortunately), and errors and warnings from that are showing up in my VS Code console. I have excluded it using the VS Code files.exclude setting, but they still show up.

Would be neat to have the ability to use the .gitignore file to tell which files to ignore warnings from. Ya know? I think it's reasonable to assume you don't want to be linting anything not version controlled...

Any news about this? Is there a way to exclude folder from the parsing process. ?

Plus: is it possible to exclude a folder but still receive the code autocompletion and hyperclick functionality (jump to definition)?

Thanks in advance

Why this is not already implemented after some time?

@New-Key because no one sent a PR.

If you want to get updates on fixes, there is a subscribe button in the top right.

Then please take this bit of feedback: posting comments like that on issues will not make them get fixed any faster. All it does is spam maintainers with countless notifications. It doesn't magically give me the time and motivation to spend my free time in implementing something I personally don't get any value out of. If you care _that_ much about this, then clone this repo, roll up your sleeves and implement it. This is open source. It is not a difficult feature by any means. And this is all just PHP code which I assume you are familiar with. The reason I write documentation on every single method is so that other people can jump in and contribute. If you _don't_ care that much about this feature why would I? By nagging you act like I owe you to implement this. I don't. Yes, this issue is almost one year old, so what? Open Source developer burnout is a thing, and this contributes to it.

@felixfbecker I'm sorry about that. I will delete all my comments and issues. Enjoy yourself!

@byends no need to close issues. I believe if there is a bug or feature request, it should be tracked.

Howdy. It seems like many many issues related to "excluding files from being parsed" are being marked as duplicate, including the ones in the vscode-php-intellisense repo. Most of them point back to this very issue here in php-language-server. Sorry if I'm not parsing the above comments correctly, but was this ever resolved? As of today, I can see that neither the search.exclude nor files.exclude options are being handled. Both contains **/Vendor in my settings, and my huge Vendor directory is being parsed (and my laptop is getting toasty), as shown in the "Output" panel. Is there an additional, PHP LS specific option to be set? Thx.

If it was resolved, it would not be open ;)

Fair enough :) I was curious because the last update was November of 2017, and several different possibilities were mentioned, including two in this very issue (a config.vendor-dir option vs. a exclude option for example). Thanks for clarifying.

Again, forgive my confusion -- the extension has almost 6 millions (!) downloads, so I figured I must be the one not using it correctly. What I'm seeing:

  • each time I start VSCode, or even switch from one PHP workspace to another PHP workspace during the day, vscode-php-intellisense seems to be reindexing everything.

I moved the Vendor directory out of the way to experiment, and the 1500+ PHP files in this project were indexed in about 75+ seconds on a MacbookPro 2016 @ 2.9 Ghz. With the Vendor dir back in, this balloons up to 12,000+ files, so we are talking at least 10 minutes at close-to-max CPU and a lot of memory.

There is a section regarding performance in this repo, but my understanding of it might be incorrect. I thought that:

  • PHP LS would index a directory, cache the results on disk, then the next time this directory is visited (through restarting VSCode or switching workspace), PHP LS would only re-index new files or files that had been modified since the last parsing.

It seems however that re-indexing happens each time. Now the aforementioned "Performance" section hints that " the index is kept in memory.". Correct me if I'm wrong, but this only applies if you stay in the same workspace, right? My assumption was that as long as you kept VSCode open, the client/server connection to PHP LS would remain open as well, therefore the index(es) would still be kept in memory. In other words, even if you switched from one PHP workspace to another PHP workspace, the indexes for both projects would remain cached in memory. Is it possible that the extension is killing the connection when a workspace is switched, thus retriggering indexing?

Either way, and again, in the spirit of trying to understand how best to use the extension and PHPLS, is the behavior described above expected? Is reindexing meant to happen each time a workspace is (re-)opened? Is this extension targeting (fast) desktop users, or small to medium-sized project mostly? Which is OK, functionality seems to be great, I was trying to gauge how it scales.

Thank you.

Was this page helpful?
0 / 5 - 0 ratings