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.

Exclude all files except for...

See original GitHub issue

The files exclude allows you to set true/false values, but it doesn’t seem to take them completely into account.

For example, I would like to hide everything except for the scripts folder. You might then assume that this would do this:

{
    "files.exclude":
    {
        "**/*": true,
        "**/Scripts": false
    }
}

It does not do that, it just hides everything. In order to achieve this, you must list every file and directory except for the Scripts directory, and who knows how many directories there are and if a new directory/file gets added you then must edit the list to exclude those.

In the end, their should be a way to hide everything except for xxx.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:564
  • Comments:175 (8 by maintainers)

github_iconTop GitHub Comments

58reactions
chase-moskalcommented, Jul 30, 2016

Aw man, I’d sure love to see this working!

"files.exclude": {
  "node_modules/*": true,
  "!node_modules/susa": true,
}

Or maybe this:

"files.exclude": {
  "node_modules/*": true,
  "node_modules/susa": false,
}

Not sure if false could be equivalent to prefixing with “!”. Maybe.

50reactions
plantain-00commented, Dec 2, 2015

The comments above the files.exclude says Configure glob patterns for excluding files and folders.. the glob can use ! to exclude files and folders(which is not implemented by vscode now). for example:

{
    // Configure glob patterns for excluding files and folders.
    "files.exclude": {
        "*.js": true,
        "!gulpfile.js": true
    }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Make .gitignore ignore everything except a few files
The above code would ignore all files except for .gitignore , README.md , folder/a/file.txt , folder/a/b1/ and folder/a/b2/ and everything contained in ...
Read more >
Remove all files/directories except for one file
I have a directory containing a large number of files. I want to delete all files except for file.txt . How do I...
Read more >
Exclude rules syntax - IBM
If you want to exclude a file you can specify the name of the file like this Z:\test\excludedFile.txt. If you want to exclude...
Read more >
Rsync exclude all files in dir except specific files - Server Fault
I found the solution.I hope this help you to not spend that much time. first you can create a file(include.txt) which you will...
Read more >
File History: Can I exclude all subfolders except one?
File History: Can I exclude all subfolders except one? Hi. I use File History for routine backup. I have a particular folder, with...
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