-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude all files except for... #869
Comments
The comments above the {
// 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 |
Using negated glob patterns with "!" is currently not supported. |
|
It's grate!!! |
👍 I also want negated glob patterns since I use |
👍 I need negated glob files as we store our many services in 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": false, |
@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!
Or maybe this:
Not sure if |
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. |
@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:
|
Some documentation on the behavior and syntax of the when-object would be greatly appreciated. |
I gave this a try and didn't work, I had toggle excluded files extension and thought it might be the cause, I uninstalled toogle excluded files and this also didn't work |
@MuhammadM1998 can you open an issue in https://github.com/luan/vscode-project-scopes with more details? |
@luan I would but actually I have nothing more to add? I installed the extension and followed the video but it didnt work as the video, Right clicking a folder and selecting always add (i forgot what its called) adds it to scope's |
Even though we could write like this , the meaning is not clear, because the order may be changed. I think vscode could support more glob patterns to exclude some but keep specific files, for example:
This is very useful feature, especially the project is organized in a monorepo, there're too many folders, files we may care and not care. |
I haven't read all the comments here (...) but here's a thing. Under the hood, vscode uses https://github.com/BurntSushi/ripgrep When using this app, it also passes a --no-config flag, basically ignoring any settings that a user might have in a ripgrep config file. I believe ripgrep is capable of excluding folders much better than vscode supports. I would be happy to manually maintain a ripgrep config file to set it up to only look in folders I want (or basically, exclude the folders I don't want it to search). In the vscode below hits for setting the --no-config would be removed (or made optional): Background: I have created an extension to help with working in a large monorepo with multiple teams. This change in vscode would benefit that: my extension would then also maintain that ripgrep config file https://marketplace.visualstudio.com/items?itemName=RoozendaalOnline.mymonorepo Note: created a feature request for removing the --no-config flag. Let's see if we can convince the team about this ;-) Note 2: I also cloned the vscode sources, removed the above settings and tried it. It works like a charm. |
My problem is that search.exclude inherits from files.exclude. I would like to be able hide linter configuration files like .prettierrc, while still being able to quick open or search in them.
I would like to see either
|
I think that if you add an entry in search.exclude (e.g. .prettierrc: false) it will still search the file (but I might be mistaken) |
I need to work in a given directory structure of the form
I have base1 and base2 folders added to workspace. As there are a lot of applications the directory tree is very big and it is quite the effort to open the correct file, as somefile.txt exists in each of the directories. So e.g. CTRL-P gets you nowhere. It really would be highly appreciated if it would be possible to view in a given path only unwanted projects and hide the rest. Something like
I tried several notations from this thread but of course none of them worked as expected. |
@anno73 why don't you create a workspace consisting of these two folders?
|
@gjsjohnmurray oh my bad. I forgot to mention that we have multiple different values for environment and region - a total of at least 6 combinations. So when I'd add each application as a separate folder to the workspace I'd have a lot of "application" base/root folders and I do not know the environment or region. My idea was to get rid of all the other applications and have a directory tree of all envs and regions for my application and not a list of all applications in every env & region. |
Are you in a monorepo and using a code owners file? If so, give this a go. Full disclosure: I'm the author 😀. Works like a charm for me.
https://marketplace.visualstudio.com/items?itemName=RoozendaalOnline.mymonorepo
Sent from Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: anno73 ***@***.***>
Sent: Friday, February 9, 2024 9:07:41 PM
To: microsoft/vscode ***@***.***>
Cc: Bart Roozendaal ***@***.***>; Manual ***@***.***>
Subject: Re: [microsoft/vscode] Exclude all files except for... (#869)
@gjsjohnmurray<https://github.com/gjsjohnmurray> oh my bad. I forgot to mention that we have multiple different values for environment and region - a total of at least 6 combinations.
So when I'd add each application as a separate folder to the workspace I'd have a lot of "application" base/root folders and I do not know the environment or region.
My idea was to get rid of all the other applications and have a directory tree of all envs and regions for my application and not a list of all applications in every env & region.
—
Reply to this email directly, view it on GitHub<#869 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGRYLOPQQ7237AWNZX5V7QDYSZ6Y3AVCNFSM4BVRPSS2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJTGY2TGNBWGQ4A>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
The workspace currently has 4 different git repos. |
Hi, There is support for very limited negation according to https://code.visualstudio.com/docs/editor/glob-patterns
Desperate measures for desperate times :) |
I really think this is a must have for working on a large repo where a single developer might only need to focus on few out of hundreds of files/modules, while also need to frequently change what to focus on depending on the project they are working on. Creating a workspace and adding what is needed by hand each time is not practical. For instance, in my case, I work mainly on a large repo with 5 sub-repos (all needed as there are inter-dependencies) of a mix of languages, each of hundreds of files. Being a full-stack dev, I don't filter files out if matched (this implies your project has a very fine-grained definition of boundary of scopes/responsibilities), i.e. exclude all .cpp codes because I absolutely don't care about anything related to C++. I need to include a wide range of types of files by file name keywords, which are usually named after features or projects, i.e. for a full-stack project on a feature called "feat", include all files of pattern: featForm.js, FeatDB.cpp, feat.py, featServer.go and data files under dir: feat_samples. If there is a simple way to suit the need to above or we dont' care about real product development, I would agree that an include feature is not needed. |
@xieshuaix If you are using a codeowners file in your repo (or can set one up to divide the code into 'categories'), you might want to checkout the mymonorepo extension. I use it daily in a very large repo with hundreds of teams and it works quite well (with some gotchas). Disclaimer: I'm the author. |
I wish to know are there any reason or technical issue why we can't just support extended globbing pattern |
Vote!!! It's been 10 years. I really need this function. |
Thank you. It's helped me out. |
This is outrageous negligence from the VSCode team. |
How is this still an issue...? |
I just created a new extension: Scope Focus. It's similar to the Project Scopes above except that:
It's minimal for now. Feature requests are welcome. |
Just in case it helps, I created another one some time ago to be able to focus on a single or multiple workspaces in a monorepos (with support for NPM, Yarn, Pnpm and Lerna): Monorepo Focus Workspace |
+1 |
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:
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 text was updated successfully, but these errors were encountered: