Skip to content

Config for ignoring warning/errors from certain folders #164

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

Open
felixfbecker opened this issue Nov 18, 2016 · 13 comments
Open

Config for ignoring warning/errors from certain folders #164

felixfbecker opened this issue Nov 18, 2016 · 13 comments

Comments

@felixfbecker
Copy link
Owner

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

@felixfbecker
Copy link
Owner Author

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

@felixfbecker felixfbecker changed the title Config for specifying vendor directory. Config for ignoring warning/errors from certain folders Dec 7, 2016
@natesilva
Copy link

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.

@RedLucas
Copy link

RedLucas commented Mar 6, 2017

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...

@nahuelhds
Copy link

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

@Argyos
Copy link

Argyos commented Aug 2, 2017

Why this is not already implemented after some time?

@dv336699
Copy link

dv336699 commented Aug 3, 2017

@New-key because no one sent a PR.

@felixfbecker
Copy link
Owner Author

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

@felixfbecker
Copy link
Owner Author

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.

@visamz
Copy link

visamz commented Nov 13, 2017

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

@felixfbecker
Copy link
Owner Author

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

@sebastienbarre
Copy link

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.

@felixfbecker
Copy link
Owner Author

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

@sebastienbarre
Copy link

sebastienbarre commented Jan 8, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants