-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Allow glob patterns for native file watcher excludes #137872
Comments
@ghuser the file watcher we are moving to does currently not yet support glob patterns for native excludes, so we have some code on our end to try best to convert glob patterns to absolute file paths for the watcher. If you configure a relative path such as |
Indeed To sum up, the issue reported here is: the lack of a way to exclude a directory that could exist anywhere in the path. |
FYI the default https://code.visualstudio.com/docs/getstarted/settings#_default-settings
The tooltips is also still saying that.
|
Adding a use case for glob pattern here: I'm working on a large repository that has code in C. The build system builds the binary to a relative |
We have a heuristic to convert "simple" glob patterns into absolute paths given that. See this test for what is supported:
|
Btw just to clarify: we do support glob patterns for watcher excludes. This issue is about supporting them on the native layer in the library itself (parcel watcher). Supporting them natively means you are not hitting the |
I had to downgrade and pin VSCode to version 1.62 on my Ubuntu system to keep using the monorepo i'm working with daily.
|
Just to clarify: the previous file watcher behaved the same as the current file watcher in that excludes were not supported natively. So for this issue (running out of file handles), it makes no difference whether you use old VSCode or new VSCode. But when you are able to configure non-glob patterns for excludes, the new VSCode will behave better. Edit |
@bpasero I run in to the "out of handles" error as soon as I change to the parcel watcher. my system setting is |
Hm, does the workspace contain many folders with large structures or just a few? You would have to build absolute path patterns to exclude them unfortunately. I am open for suggestions how to make this any easier. |
@jaypea If possible use the command described on top to find out whether you have missed some exclusion pattern and also be able to provide some detailed feedback to the team with specific examples on when a directory is not excluded. For example the specific command helped me fix my problem because I found out that I had to also add What is described on this issue is that it would be even better to be able to exclude a directory (e.g |
Given parcel-bundler/watcher#106 landed and we updated to
Thanks @joaomoreno for the clever idea of using a node.js module for the heavy lifting of creating the glob regex and then plugging that into parcel watcher. This was a fun journey that even resulted in a StackOverflow question regarding RegEx on different platforms that remains unanswered and a mystery: https://stackoverflow.com/questions/74796098/c-regular-expression-with-negative-lookahead-and-matches-on-macos-but-not-l |
Update from bpasero
files.watcherExclude
. You can use any glob pattern and file events will be ignored properly.This issue is about supporting these glob patterns on the level of the file watcher library natively. The only reason we want this is to help Linux users with the "out of handles" error when many file handles are used for file watching.
Original issue from ghuser
Does this issue occur when all extensions are disabled?: Yes/No
(First of all a big acknowledgement on the great work done with watcher on linux!! It works great in most cases.)
One Issue: I have a multiroot workspace. One of the roots contains the following subdir
./node/node_modules
(instead of./node_modules
). The existing exclusion pattern**/node_modules/*/**
does not exclude the nestednode_modules
directory from being watched.I have tried adding the following exclusion patterns:
**/*/node_modules/*/**
**/**/node_modules/*/**
*/**/node_modules/*/**
*/node_modules/*/**
but without luck.
What works though is:
**/node/node_modules/*/**
, but this implies that we know the exact subdirectory path inside which thenode_modules
directory will exist.Steps to Reproduce:
node/node_modules
directory.strace -f -etrace=inotify_add_watch /path/to/code 2>&1 | grep node_modules
You will see paths containing
node_modules
being printed. e.g.The text was updated successfully, but these errors were encountered: