You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FileSystemWatcher API to handle changes to files.exclude? #31882
Problem
The tsconfig.json build task provider currently detects tsconfig.json files in the workspace using findFiles on first run and then using a FileSystemWatcher after wards to keep the list of tsconfig.json up to date. This approach does not handle changes to files.exclude properly.
My current workaround is to only rely on findFiles to pick up the configs. I'm not sure if this will cause performance issues for very large workspaces for users on HDDs compared to the mixed find and watcher approach.
Questions
Will findFiles be fast enough on its own for this scenario? I've done basic testing and it seems quick
Would there be any other extensions that could benefit from understanding when a file is excluded or included? Should there be an official API for this?
I would stay away from a solution that is calling findFiles constantly and rather use the solution of doing an initial scan once and then relying on the file watcher.
I wonder if we should have an option to respect the files.exclude setting when calling into the file watcher and then leaving out those changes. Or, provide an overload where you can pass in glob patterns to ignore (this would then mean you have to resolve the patterns from the files.exclude setting first and pass it over).
I wonder if we should have an option to respect the files.exclude setting when calling into the file watcher and then leaving out those changes.
The files.exclude really seems like a UX setting and not something fundamental to the API. Benjamin Pasero (@bpasero) Doesn't glob support negations as we use it our build scripts?
I just hit a similar issue. The findFiles API respects the settings as well, so I can't go looking for folders called .git in the user's workspace folders. 😢 cc roblourens
roblourens didn't you make the search viewlet support the case where an include pattern overrules a possible exclude pattern? Is that only for ripgrep? I think for João Moreno (@joaomoreno) case it would be nice to be able to define an include pattern and have it return results even if a configured exclude says otherwise.
roblourens didn't you make the search viewlet support the case where an include pattern overrules a possible exclude pattern? Is that only for ripgrep?
In 1.14.2, I see it using these by default. I don't think we should search .git and node_modules for every findFiles call by default, because that can take a long time. But I'm open to providing a way to turn that off or override it.
I also think we should be careful about changing the defaults for performance reasons. roblourens are we using ripgrep for the findFiles call or our old slow find mechanism?
This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.
Activity
bpasero commentedon Aug 11, 2017
I would stay away from a solution that is calling
findFilesconstantly and rather use the solution of doing an initial scan once and then relying on the file watcher.I wonder if we should have an option to respect the
files.excludesetting when calling into the file watcher and then leaving out those changes. Or, provide an overload where you can pass in glob patterns to ignore (this would then mean you have to resolve the patterns from thefiles.excludesetting first and pass it over)./cc Johannes Rieken (@jrieken)
jrieken commentedon Aug 14, 2017
The
files.excludereally seems like a UX setting and not something fundamental to the API. Benjamin Pasero (@bpasero) Doesn't glob support negations as we use it our build scripts?bpasero commentedon Aug 15, 2017
Yes, normal glob patterns support negations, while the "simple" glob implementation that we have in our core is not supporting that.
joaomoreno commentedon Aug 30, 2017
I just hit a similar issue. The
findFilesAPI respects the settings as well, so I can't go looking for folders called.gitin the user's workspace folders. 😢 cc roblourensjrieken commentedon Aug 30, 2017
Not cool
bpasero commentedon Aug 30, 2017
roblourens didn't you make the search viewlet support the case where an include pattern overrules a possible exclude pattern? Is that only for ripgrep? I think for João Moreno (@joaomoreno) case it would be nice to be able to define an include pattern and have it return results even if a configured exclude says otherwise.
jrieken commentedon Aug 30, 2017
I'd say that is a regression from d618f0da, because
extendQuerysimply adds exclude params. I'll extract this to another issuebpasero commentedon Aug 30, 2017
Ok I was not aware the previously we would not add the standard configured excludes to this API call.
jrieken commentedon Aug 30, 2017
Yeah, at least that is my firm believe. The change added the
extendQuery-call, unless that was extracted from thesearch-call (which I don't think)...roblourens commentedon Aug 30, 2017
The
extendQuerycall was put there because I removed it fromSearchService.search. Are you sure it didn't use those excludes previously? Here is a point when it was still there: https://github.com/Microsoft/vscode/blob/3800e5ec4074e1d8510037f8ce8f2b746ac48940/src/vs/workbench/services/search/node/searchService.ts#L63roblourens commentedon Aug 30, 2017
That didn't really pan out
jrieken commentedon Aug 30, 2017
Not sure, it is some years ago... I believe it shouldn't pick up the defaults without users opting in to it...
roblourens commentedon Aug 30, 2017
In 1.14.2, I see it using these by default. I don't think we should search .git and node_modules for every
findFilescall by default, because that can take a long time. But I'm open to providing a way to turn that off or override it.bpasero commentedon Aug 31, 2017
I also think we should be careful about changing the defaults for performance reasons. roblourens are we using ripgrep for the findFiles call or our old slow find mechanism?
jrieken commentedon Aug 31, 2017
roblourens Benjamin Pasero (@bpasero) Please discuss
findFilesissues here: #33528. This item is about file watching.vscodebot commentedon Oct 7, 2019
This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.
If you wonder what we are up to, please see our roadmap and issue reporting guidelines.
Thanks for your understanding and happy coding!