-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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
files.watcherExclude doesn't appear to work for paths outside the workspace #223790
Comments
The described behavior is how it is expected to work. If you disagree, please explain what is expected and what is not in more detail. See also our issue reporting guidelines. Happy Coding! |
Extensions are able to bypass the setting for file watching when using specific APIs we provide. This is to ensure that the extensions stay functional even in the presence of this setting. |
That's rather surprising behavior - is there any chance that could be made configurable, like some sort of checkbox that forces excludes with a caveat/warning that it may break extensions? |
@bpasero I think there should be a way to say we want to apply those exclusion, otherwise, every extension needs to know about those settings and have their own mechanism to filter things out. or at least provide otherwise, we need to filter it too late which is meaningless since perf cost is already all paid, or we need to somehow figure out how to create new glob pattern by combining include/exclude ourselves. |
Yes, we have proposed API for extensions to configure exclude rules, we should be able to finalise that soon, it is already used by TypeScript: #169724 |
Type: Bug
I have the following entry in my settings (relevant path replaced with
foo/bar
):But with trace logs on, I still see file watchers added under the
/opt/foo/bar/**
paths (truncated and munged a bit, but all following paths should match the same/opt/foo/bar/**
pattern):I believe at least one of the last three exclude patterns should have excluded these file watchers. This appears to be creating performance issues, so the easiest workaround would be to exclude these paths; these paths are all stored on read-only storage anyways.
Let me know if this issue should be moved elsewhere - the file watcher requests are almost definitely coming from the Python/Pylance extension. To my understanding though, while the requests are from the extension, the actual file watcher bit gets delegated to VS Code (and to parcel-watcher, as this is with a folder open, hence the recursive watches).
For additional context, this is a Remote SSH instance with Python v2024.10.0 and Pylance v2024.7.1. The only file in the folder, open in the editor, is a Jupyter notebook (although a plain Python script triggers the same behavior). The selected Python interpreter has a very long PYTHONPATH pointing at various places on read-only storage and are the same paths that are VS Code is creating file watches for. Unfortunately, we can't shrink the PYTHONPATH at this time, which is why I wanted to exclude these paths using
files.watcherExclude
instead.VS Code version: Code 1.91.1 (f1e16e1, 2024-07-09T22:06:49.809Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Remote OS version: Linux x64 6.1.85-ts1-amd64
The text was updated successfully, but these errors were encountered: