How to exclude folders from search except a few? - visual-studio-code

I work on a large project with many files. I want to exclude as many files as possible.
I want to exclude **/node_modules, but except a few that are created by my company. e.g. **/node_modules/#mycomp.
Is it possible today in vscode 1.8.1?
Thanks,
Unional

Here is what I did to only show the node_modules/swagger-tools folder.
In the .vscode/settings.json file I wrote the following rules:
Filter all folders starting with the dot character or every letter except s.
Filter all folders starting with s and is followed by every letter except w.
Filter every folder starting with swagger- (at this point all the remaining folders started with swagger-) and is followed by every letter except t.
So the file ended up like this:
{
"files.exclude": {
"node_modules/[abcdefghijklmnopqrtuvwxyz.]*": true,
"node_modules/s[abcdefghijklmnopqrstuvxyz]*": true,
"node_modules/swagger-[abcdefghijklmnopqrsuvwxyz]*": true,
}
}
Arguably is not the nicest thing to do but certainly does the trick.

Related

Search in VS Code for occurrences of term greater than N

Here's an example:
My search term is myTermABC
I have 100 files in my project
10 files contain myTermABC
Only two of those files contain myTermABC more than once (the other 8 contain it only once)
I only want VS Code to return the two files that contain myTermABC more than once.
How to do this?
Is this even possible?
Maybe there's an extension that enables this functionality?
In vscode search across files you have to specifically tell it to include newlines. The dot doesn't do this in a search in vscode.
So this find should work: (myTermABC[.\n]*){2,}

Sort order of subfolders in Thunderbird Local Folders

So I created a subfolder of Local Folders (I'll call it "bugs" here), a long time ago, and there are some messages in it, and also some subfolders.
Now I created a new subfolder of Local Folders (I'll call it "bugs-save" here), and at first I couldn't find it... I expected it to appear just after "bugs" from the sort order. But instead, it is way down at the bottom, after folders named "Sent", "Archives", "Trash" and "Outbox" (which I don't use, but don't have options to remove either). I guess since they were at the bottom, I was ignoring them. But this has caused me to realize that the subfolders of Local Folders are not in alphabetical order.
Why not?
What is the order?
Can I change the order to alphabetical?

Visual Studio Code file filter behavior

I've opened a folder in vscode and have a fairly a large file structure to navigate. It would be very helpful if I were able to filter across those files in a way that showed only the file names that containe the filter string while still showing their location in the file hierarchy. I could have sworn that I've done that before but now have lost it.
We do have highlighting in the Explorer pane, by selecting the explorer pane and starting to type. The difficulties there are that it:
Highlights files but doesn't eliminate unmatched files
Doesn't expand folders that contain the matched files
Does a confounding search that is the equivalent of putting a wildcard between each character typed
Do extensions exist that do all of the following?
Filter the file names based on search string (i.e., hides the unmatched files)
Expand the folders that contain the matched file names
Allows for exact search (or regular expression)

Powershell search for pattern with itextsharp.dll

I need to search pdf-files for patterns and then I just want the name of the files containing "region värmland", using that to copy the files to a different folder.
The pattern is in the top right corner, and if possible I would like to search as little as possible in the file due the number of files.
I could not find any relevant information when googleing how to just search for one set of words and keep the output inside the script for further use.
Anyone who can help with this?

Fast search in Visual Studio Code

I've been wanting to move from PhpStorm to VS code, but one of the things I don't like about VS Code is how slow its built-in Search feature is at finding text within the files of a large project.
PhpStorm is really good for this and, for me, is an essential feature. I can understand that PhpStorm is good at this because it is indexing all the files in the project beforehand.
Is there any way I can make VS Code search faster?
It may be as simple as telling VS Code not to index / search certain folders. Are there /vendor or /dist folders that you don't want to search through? Try this:
Do one of your slow searches
Look through the files that get returned
See if there are files being returned in a folder you don't care about
For each of these folders, add them to the files.exclude section of your settings file:
"files.exclude": {
"**/dist*": true,
"**/node_modules*": true
},
If there are any really large files that show up in the search, add those too.
The fewer files the search needs to deal with, the faster it will go.
Update Oct 2021
You should now use search.exclude instead of files.exclude, as files.exclude will remove the files from search, but will also remove the files from your file tree in the leftnav. search.exclude only filters them out of search.
"search.exclude": {
"**/dist*": true,
"**/node_modules*": true
},