Revamp findFiles
See original GitHub issueHello, findFiles
’s exclude
argument says that if you pass in undefined
, default excludes will apply.
I have found this to not work in my extension despite my configuration being correct. Consider this piece of code:
const files = await workspace.findFiles('**/*.md'); // https://github.com/Microsoft/vscode/issues/47645
// TODO: Figure out https://github.com/Microsoft/vscode/issues/48674
console.log(workspace.getConfiguration('search.exclude'));
for (const file of files) {
console.log(file.fsPath);
}
Above, workspace.getConfiguration('search.exclude')
returns:
{
"**/node_modules": true,
"**/bower_components": true
}
This is merged from the default settings, I never change this configuration section.
Despite that, the workspace.findFiles('**/*.md')
(with or without undefined
explicitly passed as a 2nd argument, shouldn’t make a difference unless some weird parameter counting is going on) returns MarkDown files from my node_modules
directory.
I do not know how to run extension debugging in a “none but this extension” mode, but I installed a published version of my extension and tried installing it alone in my Insiders instance and was able to reproduce the problem.
I am using VS Code 1.22.2 and VS Code Insiders 1.23.0-insider`.
Is there anything else I can do to debug this further?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:13 (11 by maintainers)
Top GitHub Comments
At some point we may want a
findFiles2
that takes an options object likefindTextInFiles
instead of a list of params. Exposing the useIgnoreFiles option makes sense for findFiles, it’s exposed on findTextInFiles.This would also be helpful in our own code: https://github.com/Microsoft/vscode/commit/b845ce918f2689344795e845ae6ef691916c3079