Vscode: Exclude all files except for...

Created on 1 Dec 2015  Â·  106Comments  Â·  Source: microsoft/vscode

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.

feature-request file-explorer file-glob

Most helpful comment

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.

All 106 comments

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
    }
}

Can an option be added to exclude everything in the .gitignore?

Using negated glob patterns with "!" is currently not supported.

.gitignore will only hide the items from a commit, not hide them within the Editor

It's grate!!!

:+1: I also want negated glob patterns since I use Jakefile.js to describe Jake tasks for my TypeScript project.

:+1: I need negated glob files as we store our many services in node_modules under the same repo. We hide node_modules because it slows down the editor, and clutters the workspace. But we have to use directory symlinks so we can edit the specific services in another folder.

If we could exclude these folders from being ignored, we could remove the symlinks and significantly reduce the complexity of our project. (Another issue is, debugging node in a symlinked folder doesn't work in vscode, this would be solved by this feature also.)

Yes, we need negated glob exclusions. In Node, the built-in place to put application-wide modules is in a node_modules folder. You would want to be able to exclude node_modules except for your project's modules under e.g. node_modules/_local so that you can easily navigate to your own modules without also including all the imported ones.

Edit: this glob already works for the scenario above:

{
    "search.exclude": {
        "**/node_modules": false,
        "**/node_modules/!(.local)": true,
        "**/bower_components": true
    }
}

Would this feature allow me to exclude *_/_.css but not *_/_.cssx.css? Can anyone think of a way this could be done now?

@skyaddict My last comment above should work for your scenario as well

Sorry to bother, but I have tried many derivations of the following, and I still can't seem to find the secret sauce.

"/Css": false,
"
/Css/*!(.cssx).css":true

"/Css": false,
"
/Css/!(*.cssx.css)":true

@skyaddict it hasn't been implemented yet in vscode

@JAForbes, @skyaddict: I was about to write a reply saying that it already works, but then a mystery was revealed. I can confirm that the search.excludes setting above works for excluding all subfolders of node_modules except for a folder named .local. That is 100% definitely working. However, I was not able to get the same set of patterns to work on a folder other than node_modules, or on individual files. So this issue definitely still needs attention.

So right now, vscode is not supporting extended globbing for their exclude options. Can someone briefly explain what the holdup is?

I won't say it is a deal breaker but getting annoying not able to do this.

In angular 2 project we usually exclude all js file but still want to see a few js setting files, like webpack.config.js, systemjs.config.js, etc.

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.

always having Sublime open so I can search specific files that VSC won't let me is quite painful. A negative pattern here sounds rather straight-forward.

Yes, the issue with own modules in "node_modules" is really annoying...

Yes - I also want the feature...

i wanted to hide all _.js-files if there is an equal *.ts file.
I just added "__/_.js": { "when": "$(basename).ts"},
which excludes all js-files except js-files like gulpfile.js etc

@TobiasKoller you are a genius, sir, and I thank you! I only needed to modify it slightly to get it to work in my project:

"**/*.js": { "when": "$(basename).ts" },

Some documentation on the behavior and syntax of the when-object would be greatly appreciated.

yes negating pattern would be very welcome, exactly because of the use case described several times above (node_modules folder with private libraries that need to be accessable)

Still not?

I created a work around, in my case I want to hide all node_modules except folders starting with "ap"

  "search.exclude": {
    "**/node_modules": false,
    "**/node_modules/.*": true,
    // hide all folders that doesn't start with letter 'a'
    "**/node_modules/[bcdefghijklmnopqrstuvwxyz]*": true,
    // hide all folders that doesn't start with 'ap'
    "**/node_modules/a[abcdefghijklmnoqrstuvwxyz]*": true
  }
  "files.exclude": {
    "**/node_modules": false,
    "**/node_modules/.*": true,
    // hide all folders that doesn't start with letter 'a'
    "**/node_modules/[bcdefghijklmnopqrstuvwxyz]*": true,
    // hide all folders that doesn't start with 'ap'
    "**/node_modules/a[abcdefghijklmnoqrstuvwxyz]*": true
  }

but having a negation ! is invaluable

I am not understanding how a configuration like this:

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

or this:

"files.exclude": {
   "*.js": true,
   "!gulpfile.js": true
}

Would make any sense or is even readable. What you are basically expressing is to (case 1) "exclude everything that is inside node_modules folder and also everything which is not node_modules/susa" and (case 2) "exclude every JS file and every file that is not gulpfile.js".

However I think using the boolean flag as a way to force something to not be excluded works better.

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

```json
"files.exclude": {
   "*.js": true,
   "gulpfile.js": false
}

One problem that I see with our implementation of this glob matching is that in many cases we are heavily optimizing when we traverse a tree structure. Imagine the following configuration:

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

When we run our search algorithm we walk the file system and reach the node_modules folder. We check for configured rules to exclude this folder and see that it is configured to be excluded. At this point we have no other pattern matching this folder so we ignore it and continue. Of course we then fail to pick up the susa folder which was intended to be shown.

This is just an example for search, it applies equally to the explorer which is also representing a tree structure.

Yes, to allow more specific items to override less specific items is what I thought the behavior would be, I spent hours until I gave up, and now found it was impossible. I was thinking this would work:

{
    "search.exclude": {
        "**/system": true,
        "**/system/**/*.ps*":false
    }
}

Where everything in system is ignore except those files that are .ps* (ie. ps1, psm1, etc...)

I hope this is supported in the near term.

Thanks guys-Eric

@bpasero I don't know about you, but my ruleset is limited to 5-10 lines. So "heavily optimizing when we traverse" seems like a waste as it takes away from the configuration possibilities.

Having users on my team accidentally edit something because it's json and everywhere else we're editing files by hand, except this 1 or 2 files that are generated as part of the build is very bad.

It would be valuable to be able to hide these files. The work around is of course to place the files in specific folders, that the exclude pattern doesn't match, but that's not always possible, or smart.

Is there anywhere I can go to cast my (+1) vote for this as a valuable feature?

txs, Alan

In the example that @bpasero mentioned (where the user wants to exclude all of node_modules except for node_modules/susa), there might be a way to split the difference and get the benefit of heavy optimization in most cases, while still allowing the "show node_modules/susa" use case. Let's look at a sample case where we want to exclude the entire output directory, and all of node_modules except for node_modules/susa:

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

The algorithm I have in mind would go something like this:

  1. Parse the files.exclude configuration and analyze it, looking for the following two categories of folder exclusions:

    • Ones with no overrides deeper in the tree (e.g., output)

    • Ones that are overridden deeper in the tree (e.g, node_modules)

  2. Build a list of excludes to pass to the tree-search algorithm, with those two categories kept separated. (Different properties on the object passed to the algorithm, one for foldersToCompletelySkip and one for foldersToSkipExceptForCertainExceptions. With much better names than that, of course. The foldersToSkipExceptForCertainExceptions list might also have two different subcategories:

    • Exceptions where the direct path to the non-skipped descendant folder can be determined ahead of time (the path contains no * or ** parts), as in the node_modules/susa example

    • Exceptions where the direct path cannot be determined ahead of time, as in the **/system/**/*.ps* example from a previous comment

  3. Inside the tree-search function, any folder that can be completely skipped uses the current algorithm's approach, where its children aren't even parsed.
  4. Any folder that should be skipped except for certain descendants whose path can be determined ahead of time (e.g., node_modules/susa) then looks exclusively for the known path to those non-skipped descendants, ignoring all other folders and files. This is almost as fast as skipping the entire folder.
  5. Any folder that should be skipped except for a wildcard description of descendants (e.g, **/system/**/*.ps* when **/system is otherwise supposed to be skipped) cannot take an optimized approach, and must take the slower approach of searching the skipped folder for all non-skipped descendants.

This approach would allow keeping the optimized speed for some of the use cases mentioned here (skipping all of node_modules except for node_modules/one/specific/path/to/file.txt would still be very fast, for example). Examples like "include all **/system/**/*.ps* files" would still be slow, though, as I can see no way to get around the requirement to search the entire tree in those cases.

This is a simple example, but I can easily come up with a glob pattern that has overlap with another glob pattern that is not so obvious. E.g. out/some/*.js has overlap with **/*.js. Unless you have a way to express order (similar to how .gitignore files work), I do not think you could give a clear answer.

Any news on this issue?

@egamma @bpasero is there an update on this issue, we are looking for a way to exclude a folder but add one subfolder using glob patterns. We are currently speculating of adding an option to specifically exclude, include headers in our extension as a workaround for header paths, perhaps a better workaround exists.

I would like this functionality for white-listing as well. Our .gitignore files take advantage of it like this:

.*
!.editorconfig
!.gitignore

It is otherwise a reactive hassle to manage every possible dot file that might want to slip into our project. I hope you can appreciate how much easier it is to only react to new allowable dot files.

Also, resolving this would get us one step closer to resolving #78.

What about this? Quite an old request and useful feature.

I also think this would be a helpful feature. Beside that, why is there no folders.include option?
This would make life much more easier for me, since I can define what folder should be displayed and searched, too.

Beside that, why is there no folders.include option

By default I believe all the files/folder included, so it is quite logical to have only exclude

   "**.js": true, //exclude all the js files
   "js_folder/*": false // except from exclusion this folder

Ok, perhaps it can work this way.
But why doesn't something like the following work?

"d:\*\folder": true

What I want is, to exclude folders that are located at drive d and in the second level of the folder hierarchy.
How can I get this work?

I believe you can only manage paths that are in the project filesystem scope.

Like others, I also thought something like this would work, but apparently it does not:

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

This does work though:

"files.exclude": {
    "node_modules/[^f]*": true,
    "node_modules/f[^o]*": true,
    "node_modules/fo[^o]*": true,
    "node_modules/foo[^b]*": true,
    "node_modules/foob[^a]*": true,
    "node_modules/fooba[^r]*": true,
    "node_modules/foobar?*": true,
}

Here's a more complex example, excluding all Node modules except foo, bar, and bit:

"files.exclude": {
    "node_modules/[^fb]*"  : true,
    "node_modules/f[^o]*"  : true,
    "node_modules/fo[^o]*" : true,
    "node_modules/foo?*"   : true,
    "node_modules/b[^ai]*" : true,
    "node_modules/ba[^r]*" : true,
    "node_modules/bar?*"   : true,
    "node_modules/bi[^t]*" : true,
    "node_modules/bit?*"   : true,
}

You only need the final patterns such as foo?* if you want to exclude modules starting with foo that are not foo. In fact, you can write these interactively and stop as soon as they are enough for your particular directory content.

I'm looking forward to using Extended Globbing in settings.exclude :)

@tobia that is a good tip - but it only works for the last path item correct? I tried playing around for mid-path items and could not get it to function. Ie.

I'm trying to get this to work.

    "!/system/psmodules/**/*.ps*": true,
    "/system/**": true

or this

    "/system/psmodules/**/*.ps*": false
    "/system/**": true

I really , really hope negation comes soon.

@erichiller why not? Something like this should work:

/system/[^p]**
/system/p[^s]**
/system/ps[^m]**
...
/system/psmodules/**/*.[^p]*
/system/psmodules/**/*.p[^s]*

@tobia

So I just found out that as far as I can tell this should be fixed -- now that vscode is using ripgrep at least, the format is _gitignore_ style

I've tested this and it works:

// Place your settings in this file to overwrite default and user settings.
{
    "search.exclude": {
        "**/system/**": true,
        "!/system/psmodules/*.ps*": true
    }
}

_by works I mean:_
that all the files within system/ are ignored EXCEPT for the files in /system/psmodules/ ending in .ps

@erichiller
I tried your suggestion in "files.exclude", but can't make it work. Are you it works?

@BillDenton As far as I know, it is only search.exclude that actually supports this syntax as ripgrep handles search and not files.

@erichiller I couldn't get this to work:

"search.exclude": {
    "**/obj/*": true,
    "!**/obj/*.h": true
},

First rule takes effect, but second rule (negating) doesn't do anything.

according to the vscode jsconfig documentation, it seems to be exclude: Array now?

Can this feature be associated with particular extension? Like for python, I would like to hide all *.pyc file. Or maybe all in folder __pycache__

Or associated with particular workspace.

We definitively need the ! symbol for make it work like .gitignore

My example: I would love to create a project-view consisting only of CMakeLists.txt files -- everything else, especially folders that do not contain CMakeLists.txt -- excluded from the file pane. This would make it much easier to navigate and build understanding of the structure without seeing anything distracting.

I would love to have this feature -- sometimes I need to dive into a particular one of my project's node_modules dependencies. I'd __really__ like to mark that package as not excluded and be able to browser the code, set breakpoints, etc with a minimum of fuss... I'm sure this must be a common need ...

Can't believe this issue has been opened for 1 year and a half. The files.exclude config states that it takes a glob, and glob do support the ! pattern.

Anyway, stumbling on this too, this is the kind of details that make VSCode a no-go (for now).

Here's a basic patch that adds a "files.include" config to allow you to selectively approve of a restricted set of files/folders. Note that it needs a lot more work before its production ready.
add_include_only_ability.patch.txt

@Zephir77167 You are so correct with that, every 3-4 months I decide to give "VS Code" a change just to find out it's no good for large scale apps...

To all those suggesting to use negation or a negative character class (! or ^) have you tested it? In all my tests and from what I saw in source, there seems to be no support for either ! or ^. So all the suggestions made except in this comment will NOT work.

Wish this had at least the limited flexibility of standard glob even if no regex.

For me at least, the suggestions of @tobia worked well. I wanted to exclude all folders in the github.com folder of my golang project except those I was interested in. Adding the following to my local workspace config was good enough for me.

{
            // Hide all folders expect those beginning with K
        "files.exclude": {
                       "**/github.com/[^K]*": true,
        }
}

@CharlesWinter I can't get this to work.

    "files.exclude": {
        "**/out/*/*.[^h]": true
    },

Trying to exclude all files except .h files. No dice...

@csholmq That will most likely be because that regex is looking for files starting with the character h due to the ^. Remove that should give you some more success.

@CharlesWinter How do you mean? I am expecting the ^ to negate the literal character h and thus match all files except those with the letter h. Am I missing something trivial?

Why not provide a configure called "file.include" ? #feature request

Actually, this false option doesn't work

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

From the intelligence prompt of VSC, it only control if the pattern is enabled.

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

The negative pattern doesn't work either.

Anyone who is working on this?

Really need this feature!

https://github.com/Microsoft/vscode/issues/869#issuecomment-255660177 how would you hide the js file when either ts or tsx file exist?

Any progress on this?

Until this is implemented, has anyone found an extension that does this?

In the search tab you can define exclude and include. So exclude true / false is maybe a bit confusing.
The value true is only set to have a valid json. Ok, otherwise an array would be a better way to define that. ["firstPath", "anotherPath"]

My suggestion:

{
  "search.exclude": {
    "**": true
  },
  "search.include": {
    "/src": true
  }
}

this allows to only search in src-folder.
include > exclude
Include should be evaluated after exclude.

To avoid confusion about the boolean value and keep a valid json you can use an array.

{
  "search.exclude": ["**"],
  "search.include": ["/src"]
}

I don't know what's the reason for the object?

This is driving me insane. My files.exclude is starting become this long mess, when it could all be achieved in one files.include line. This seriously needs attention!

I really need this as well for AWS Lambda's flat package style requirement of putting dependencies right next to your code:

# gitignore all files within apps/<myapp>/src EXCEPT for a single app folder
apps/*/src/*
!apps/*/src/app

@bpasero : What is the progress with regard to the issue ? There is a lot of conversations regarding the work around for the problem. And seems to me nothing is solving my problem. So, can you please take a look at how you can solve the problem ? Many of developers like me are waiting for an enhancement to specify "everything expect" in files.exclude or another configuration such as files.include.

This issue has been opened for three years... I tried every method that mentioned above, none of them works...

In my scenario I want to hide all files that start with a . but not the .vscode folder.
For now I'm using this:

"files.exclude": {
    ".[^v]*": true,
}

Which unfortunately means that I can't use any tools that start with a v 😄

After three years Microsoft still didn't bother to resolve this 2-hour issue. It remains only to close discussion for collaborators and that's all

Not only does it not work, there's no way to disable hard-coded exclude entries in Workspace or User, even using "/pattern/": false doesn't work.

A workaround I use is to just use the "files to exclude" and "files to include" in the sidebar search.

I need Explorer to show only the folders (and all beneath them) matching (against the full path) given pattern& For example, if I type QSL/Backorder, it would only display the following folders:

./classes/XLite/Module/QSL/Backorder/**
./skins/admin/modules/QSL/Backorder/**
./skins/customer/modules/QSL/Backorder/**

And hide all others. Is there anything I can do at the moment to achieve this? Maybe, and extension?

The following __workaround__ worked for me :heavy_check_mark:

I wanted to exclude __/node_modules__ but include __/node_modules/asch-core__ for search.

In the .vscode/settings.json file I configured:

{
  "search.exclude": {
    "**/node_modules/": true,
  },
  "search.useIgnoreFiles": false,
  "search.useGlobalIgnoreFiles": false
}

search.useIgnoreFiles: false → search uses .gitignore files: no
search.useGlobalIgnoreFiles: false → search uses global .gitignore files: no

On the left panel I untoggled the "Use Exclude Settings and Ignore Files"

Then I added the directory I wanted to include (in my case: /node_modules/asch-core, /*) into the files to include TextBox.

search_exclude_hack

I needed this to exclude all the other stuff on /vendor except the /vendor/symfony, so i can use the intellisense autocompletion.

Create symlink object mklink /j "_include" "/vendor/symfony" (You need to use CMD.exe)
Now exclude **/vendor, and done.

Now my _include folder redirect to symfony codes(vendor/symfony), without being excluded from VSCode, while hiding everything of vendor folder, making the intellisense caching fast.

I would really like to hide all of the files that have no '.' in their name (except for "makefile".

I have tried "**/*.*": true and it will INCLUDE the exact list of files I want to EXCLUDE. One would think that changing 'true' to 'false' would produce the opposite result but instead, it excludes nothing.

I also tried "**/!(*.*)": true (and false) and neither of these exclude any files.

Finally, I tried "!(**/*.*)": true (and false) and nothing was excluded.

So is it possible to exclude all files without a dot in their name and if so, how?

[Currently using VS Code Version 1.31.0-insider]

Here's my way to except /node_modules/foo from the exclude,

"files.exclude": {
    "**/node_modules/{[^f],?[^o],??[^o]}*": true
}

To anyone having trouble using negative character classes (e.g. [^x])...

I discovered that at least on my system, VSCode's implementation of globs breaks depending on the length of the pattern and how many character classes you put into the pattern.

For example, let's say you were trying to exclude all vendor directories except foobar.

This will work:

"**/vendor/[^f]*": true,
"**/vendor/f[^o]*": true,
"**/vendor/fo[^o]*": true,
"**/vendor/foo[^b]*": true,
"**/vendor/foob[^a]*": true,
"**/vendor/fooba[^r]*": true,
"**/vendor/foobar?*": true,

This will not work:

"**/vendor/[^f][^o][^o][^b][^a][^r]*": true,
"**/vendor/foobar?*": true,

I can't quite work out the exact rules for when it breaks, but if you want it to be bulletproof, try it with the working example above.

If you need to do this for more than one directory, e.g. foobar and hhhhhh the following seems to work as well:

"**/vendor/[^fh]*": true,
"**/vendor/[fh][^oh]*": true,
"**/vendor/[fh][oh][^oh]*": true,
"**/vendor/[fh][oh][oh][^bh]*": true,
"**/vendor/[fh][oh][oh][bh][^ah]*": true,
"**/vendor/[fh][oh][oh][bh][ah][^rh]*": true,
"**/vendor/{foobar?*, hhhhhh?*}": true,

For me, the proposed solution works (e.g. => for gatsby-th*, firstmod*, secondmo*)

"node_modules/[^gfs]*"  : true,

"node_modules/g[^a]*"  : true,
"node_modules/ga[^t]*" : true,
"node_modules/gat[^s]*" : true,
"node_modules/gats[^b]*" : true,
"node_modules/gatsb[^y]*" : true,
"node_modules/gatsby[^-]*" : true,
"node_modules/gatsby-[^t]*" : true,
"node_modules/gatsby-t[^h]*" : true,

"node_modules/f[^i]*" : true,
"node_modules/fi[^r]*" : true,
"node_modules/fir[^s]*" : true,
"node_modules/firs[^t]*" : true,
"node_modules/first[^m]*" : true,
"node_modules/firstm[^o]*" : true,
"node_modules/firstmo[^d]*" : true,

"node_modules/s[^e]*" : true,
"node_modules/se[^c]*" : true,
"node_modules/sec[^o]*" : true,
"node_modules/seco[^n]*" : true,
"node_modules/secon[^d]*" : true,
"node_modules/second[^m]*" : true,
"node_modules/secondm[^o]*" : true,

Any progress for this? We really need a simple way to include files or folders.

In our corporation we use huge mono repository. For development we must open root of this repo, but project may use 0.1% of common code base. Our use case — include to search/watch only dirs related to concrete project (0.1%) and ignore other (99.9%)

The ! negate exclude for a glob would turn my excludes lines from about 40 to only about 5.

I ended up here trying to hide all directories in node_modules except those that start with @ or . and while this feature would be immensely useful, this line in files.exclude worked for my use case.

"node_modules/[abcdefghijklmnopqrstuvwxyz]*": true

Is there any update on this? It would be much appreciated! @isidorn

@isidorn @bpasero: If someone were to look at sending a PR for this, is there a direction you'd prefer? (cc @solomatov)

  • "files.include" setting
  • glob matcher to support "!"
  • support for false (or {"when":"false"}) in the config

For the large-monorepo use case, supporting this would make it simpler to support focused working-set views into the much larger tree.

I personally prefer adding "files.include" setting, though I think adding "!" or "false" support has better defined conflict resolution, using ordering as the tie-breaker and thus supports more of the use cases described in this issue.

This was frustrating me so I have created a quick and dirty extension that can emulate the desired files.includes behaviour until this feature is added to VS Code.

To use it:

  • Create a hide.config.js file
module.exports = {
  ignore: ['.git'], // add any directories you are happy to exclude from the recursive search
  keep: ['extension.js', 'commands/**'] // only these files will be available in the Explorer view
}
  • Run Hide Config from the command palette to generate a .hidemyfilesrc file.
  • When you run Hide Files, .hidemyfilesrc will replace the files.exclude property in .vscode.settings.json, thus excluding all of the files in your project except for the files and directories you add to the keep array.
  • __Any time you modify hide.config.js you will have to reload the window and run Hide Config from the command palette for the changes to take effect__ (if someone has experience with VS Code extensions and can explain why this is necessary that would be great)
  • __Include directories with the syntax <directory name>/**__
  • https://marketplace.visualstudio.com/items?itemName=ahvmckay.hide-my-files

image

The documentation linked to the setting mentions the usage of pattern negation syntax using ! . Maybe this should be removed until the feature is implemented?

@isidorn This was linked in the March Iteration plan here https://github.com/microsoft/vscode/issues/92242 but has since dropped off the April Iteration plan. Is this on the back burner for now?

I have been looking forward to this feature as a Unity developer, where we have many folder in the project hierarchy, which could have arbitrary names, but only one folder called "Scripts" where the C# I intend to edit actually lives.

Not currently on the plan. Might be back in May.

It's not just node_modules. If you open a project like DefinitelyTyped… you're generally only going to be reading / working on a single package under it's types directory.

Without this feature, how can anyone sanely navigate the 6690 directories within?!

ls -l types | wc -l
    6690

(short of opening VSCode directly in the types/<project> you're interested in).

Until this is implemented, I'm making do with this silly setting:

        "types/[a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,z]*": true,

Thanks @ArturoDent - this seems to be equivalent:

     "types/[^y]*": true,

@sanbox-irl As a workaround you can use this in your settings to show only the scripts folder:

files.exclude {
    "**/[^s]*": true,
    "**/s[^c]*": true,
    "**/sc[^r]*": true
    // more if necessary
}

You can see the pattern - you may need more or fewer entries depending on your other folder names.

frankly, in Unity, I just type the other folders out. I believe that trick has some strange platform issues? It's been at least a year. I think it either doesn't work on Mac or doesn't work on PC? I don't exactly recall. Anyway, I look forward to when the team has a chance to bring the issue forward to more robust solution. Lots of dev going on anyway

With not being able to do this yet. Is there a way to read a separate file hosting the json objects to exclude? I hate to clutter up my workspace with 900 different folders I want to exclude. I mean it works but its annoying :-)

Here's my way to except /node_modules/foo from the exclude,

"files.exclude": {
    "**/node_modules/{[^f],?[^o],??[^o]}*": true
}

thanks, look like this is the best workaround solution I can take from a super looooooong topic!

I want to include Bulma folder ( to work with autocomplete ) and then here is what I set on setting

  "files.exclude": {
    "**/node_modules/{[^b],?[^u],??[^l],???[^m]}*": true
  }

@isidorn I wonder why this ugly old problem has not been resolved yet?

I don't want to spend much time to investigate the script, so I'm using the "Explorer Exclude" extension.

For those like me who want to exclude everything _except_ dotfiles in a workspace folder, right-click the folder in the explorer, click _Open Folder Settings_ and search for "exclude". Then in the _Files: Exclude_ list, add these patterns:

!**/.*
**/[0-9]*
**/[a-z]*
**/[A-Z]*

For those like me who want to exclude everything _except_ dotfiles in a workspace folder, right-click the folder in the explorer, click _Open Folder Settings_ and search for "exclude". Then in the _Files: Exclude_ list, add these patterns:

!**/.*
**/[0-9]*
**/[a-z]*
**/[A-Z]*

Just an extra note that this also excludes files in dotfile directories (e.g. you can't see anything inside the ~/.ssh directory) so a better pattern is:

!**/.*
[0-9]*
[a-z]*
[A-Z]*

Can't believe that this issue has been proposed for nearly five years and this problem still exists in the latest version of VSCode today.
Hope this problem can be solved soon.

lol buddy, they make this for free. the workarounds exist. get that entitled attitude out of here

This issue is old enough to start school!

On Tue, 15 Sep 2020 at 07:54, Jonathan Spira notifications@github.com
wrote:

lol buddy, they make this for free. the workarounds exist. get that
entitled attitude out of here

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/vscode/issues/869#issuecomment-692506940,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AFHP5WSVTCELQ7HN3FVPOOTSF4FSZANCNFSM4BVRPSSQ
.

@sanbox-irl well, this issue fits well the project goals for this year https://github.com/microsoft/vscode/wiki/Roadmap#themes so it's not bad to raise awareness

This shit still exists for now, very annoying. I want to exclude some folders so I have to define:

"files.excludes": {
  "node_modules/folder1": true,
  "node_modules/folder2": true,
  "node_modules/folder3": true,
}

But there are tons of folders. Not only node_modules.
Don't understand why they can't handle this

People, please stop endless complaining! Yep, there is no working solution, only workarounds. Yep, it sucks. But endless complaining does not solve the problem and only causes spam for people subscribed to the topic. If you find this problem as serious and important, just take some time to fix that yourself and then send pull request to the upstream.
Don't spam! In other more mature open source projects like GNOME desktop environment this kind of complaints and spam would cause locking the whole thread without any way for discussion. I wonder why Microsoft doesn't locked this issue at all.

Don't spam! Fix the problem and provide solution or wait until someone will do it for you.

Was this page helpful?
0 / 5 - 0 ratings