Open pgcamus opened 1 day ago
Excludes are actually applied on the file watcher library (via options
) and so the message you see does not necessarily mean that the file watcher is also applied on disk. You can assume that the path is not watched given your glob pattern.
I think my answer needs further clarification: files.watcherExclude
behaves differently depending on your platform and also whether a glob pattern is used vs. a path.
glob pattern vs path
The setting already explains this: glob patterns are actually only matched on the relative path portion relative to the watched root. So if you are watching a path of /Users/bpasero/Desktop/test-ts
, a glob pattern of **/bpasero/**
would not match that path.
A path on the other hand is taken as is and matched against the absolute path of the watcher.
platform differences
The files.watcherExclude
setting was mainly introduced for Linux to workaround platform limitations when watching large folders and running out of file handles: Only on Linux, a folder is watched recursively by installing file watchers on each folder that is found beginning from the root. files.watcherExclude
is applied while traversing the folders making it easy to reduce the file handle overhead by reducing large folders (such as output).
Windows and macOS on the other hand have very efficient recursive folder watchers built in: here you cannot really disable watching a folder that VS Code wants to watch unless you disable all file watching (by putting **
into the files.watcherExclude
setting).
tl;dr;
files.watcherExclude
will not prevent a folder from being watched that VS Code wants to watch recursively, but helps a lot on Linux to reduce the overhead.
In all cases, files.watcherExclude
will also be applied on resulting file events to filter them out from being dispatched to VS Code, so this setting still helps reducing CPU overhead of processing the events.
I hope this clarifies?
Type: Bug
Here is my
files.watcherExclude
:Despite this configuration, I'm seeing log lines like the following after enabling remote logging for File Watcher
I've tried this with both absolute ignore rules like
/**/.cache/**
as well as relative like**/.cache/**
. Nothing seems to match enough to catch this.I /think/ VS Code is finding this path because of the following symlink in my workspace root
... but again the existing exclude rules should have caught the symlink source.
VS Code version: Code 1.95.0 (912bb683695358a54ae0c670461738984cbb5b95, 2024-10-28T20:16:24.561Z) OS version: Darwin arm64 23.6.0 Modes: Remote OS version: Linux arm64 6.10.4-linuxkit
System Info
|Item|Value| |---|---| |CPUs|Apple M1 Pro (10 x 2400)| |GPU Status|2d_canvas: enabledcanvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off| |Load (avg)|4, 8, 9| |Memory (System)|16.00GB (0.03GB free)| |Process Argv|--crash-reporter-id 8b9e2792-5ee0-48ef-a561-5f6b02100b14| |Screen Reader|no| |VM|0%| |Item|Value| |---|---| |Remote|SSH: localdev| |OS|Linux arm64 6.10.4-linuxkit| |CPUs|unknown (10 x 0)| |Memory (System)|7.66GB (5.79GB free)| |VM|0%|
Extensions (10)
Extension|Author (truncated)|Version ---|---|--- remote-ssh|ms-|0.116.2024100715 remote-ssh-edit|ms-|0.87.0 remote-explorer|ms-|0.4.3 vim|vsc|1.28.1 vscode-bazel|Baz|0.10.0 gitlens|eam|15.6.2 black-formatter|ms-|2024.4.0 debugpy|ms-|2024.12.0 python|ms-|2024.16.1 vscode-pylance|ms-|2024.10.1 (1 theme extensions excluded)