Closed Aaaaash closed 3 years ago
(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:
Reproduces only when the lock files exist top level, otherwise we refresh the explorer because the lock files appear.
I first have to understand why we decided to not update the glob for macOS/Linux, there was a reason...
@bpasero are the file events simply missing? Can I help from the Explorer side?
@isidorn well for some historic reason we decided to exclude file events on node_modules
folder but only on macOS and Linux, so when you do an npm install
the folder does not become visible in some cases. I think the explorer is not doing anything wrong, it is just our default watcher exclude glob pattern being quite restrictive.
Here are some findings how the exclude setting is used:
Windows We use a C# based file watcher that reports every file change unfiltered. We do the filtering using our (!) glob library in the renderer.
macOS/Linux: folder workspace
We use chokidar
and pass the excludes directly to the library as ignored
patterns. This bypasses our glob library and relies on anymatch
: https://github.com/paulmillr/chokidar#path-filtering
macOS/Linux: multi-root workspace
We use nsfw
watcher library. Similar to Windows, that library reports every change unfiltered. We do filtering in our glob library.
Remote Server
We use chokidar
but do not pass the excludes to the library. We do filtering in our glob library. @aeschli I think you added this, please be aware that we may be changing the default watcherExclude
setting slightly to report changes on the node_modules
folder (not all, just the top level folders).
Why don't we also exclude file events on node_modules
on windows?
Because the file watching works best on that platform?
I think the ideal experience is that when an user does an npm install
that the node_modules
folder becomes visible, but the file changes inside of it are being ignored...
@isidorn we do filter on Windows, the change in https://github.com/microsoft/vscode/issues/23954 was specifically to keep the filtering as it was but allow for changes to the node_modules
folder itself to not be filtered. Basically what we want is:
The last point would help in the case where a user does yarn add xy
and has the node modules folder expanded to see changes coming in. But I would say that is a nice to have, more importantly we need to make sure the node modules folder itself appears when it does.
Verification (macOS, or Linux):
package.json
with some dependenciesnpm install
oncenode_modules
foldernpm install
againWorks fine. Even folders inside node_modules
appear -> verified
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
npm install
in terminalnode_modules
is not shown in Explorer side bar.It seems to be by designed for performance reasons #23954
For now,
files.watcherExclude
has different default value for Windows and macOS/Linux.Windows
macOS/Linux
I recommend using the new default setting on macOS/Linux