Exclude all files except for...
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.
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