question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hello, 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:open
  • Created 5 years ago
  • Reactions:1
  • Comments:13 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
roblourenscommented, Sep 20, 2018

At some point we may want a findFiles2 that takes an options object like findTextInFiles instead of a list of params. Exposing the useIgnoreFiles option makes sense for findFiles, it’s exposed on findTextInFiles.

2reactions
chrmarticommented, May 31, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

findfiles - CFEngine 3.21 Docs
This function searches for the given glob patterns in the local filesystem, returning files or directories that match. Note that glob patterns are...
Read more >
jenkins - How to use "findFiles" in a Jenkinsfile? - Stack Overflow
findFiles step is a part of Pipeline Utility Steps Plugin so you have to install it if you want to use that step....
Read more >
Shell.FindFiles method (Shldisp.h) - Win32 apps
Displays the Find: All Files dialog box. This is the same as clicking the Start menu and then selecting Search (or its equivalent...
Read more >
FileManager::FindFiles() overload fails to find files or directories
I want a function that when given a path, it will return a list of folder names that are inside that path. I...
Read more >
How To Find a File In Linux From the Command Line - Plesk
Use Grep to Find Files Based on Content ... File Manager's default approach is to change permissions in a non-recursive manner, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found