Description
openedon Nov 25, 2021
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
- VS Code Version: 1.62.3
- OS Version: Ubuntu 18.04.6 LTS
(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 nested node_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 the node_modules
directory will exist.
Steps to Reproduce:
- Make sure a multi-root workspace has been loaded to vscode before closing it. Also at least one of the root workspace directories should contain inside a
node/node_modules
directory. - execute:
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.
[pid 4634] inotify_add_watch(58, "/projects/myproject/node/node_modules/modulename", IN_MODIFY|IN_ATTRIB|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELETE|IN_DELETE_SELF|IN_MOVE_SELF|IN_ONLYDIR|IN_DONT_FOLLOW|IN_EXCL_UNLINK) = 3024