How do you search for folders in Visual Studio Code? - visual-studio

I have a large wordpress project inside Visual Studio Code and cant figure out how to search for specific folders. Say that I wanto to search for my plugin folder my-plugin.

The only thing I found is to use CMD P (or ctrl shift p) and write a part of the path (ie. you are looking for /first/second/third , write /third and you get the files inside the folder)

Related

How to exclude folder from Visual Studio 2013 Find?

I am using an ASP MVC project. Both the /Content and the /Script folder has a Kendo subfolder which contains enormous sized files. As a consequence when I am using solutionwide Find operation it takes literally minute(s) and even the VS UI is frozen and became unresponsive (btw this is a shame in 2015, I am using a 8 core / 16Gigs machine and all files on SSD, anyway).
As a workaround it would be great to exclude the 2 Kendo subfolders from Find operations. How can I accomplish this?
Note: using file wildcards, and not searching in any .css and .js files is not an option, because I have my own .js and .css files and searching in those files is mandatory.
In order to exclude subfolders, you can create a custom Folder Set. Click the ellipse (...) for the "Look in" option in the "Find and Replace" dialog.
Related answer: Visual Studio Search in Selected Folders or File Types Only
If the problem is that the gui is lagging. Try Find In Files -> Result Options -> Display file names only = true. Hopefully that is good enough.

How to search within specific folders and files in Visual Studio 2010

I see in visual studio, i can search within:
Current Doc
Current Selection
All Open Docs
Current Project
Whole Solution
is there anyway to:
Search within certain file types (just javascript files, just .aspx files?) ?
Search within specific folders ?
Yes you can do this using this options
You can also browse the folder the in which you want to perform the search using the button that is placed right to Look in: option.

Excluding specific files from Visual Studio search

Is it possible to exclude certain files from search in Visual Studio.
For example jquery.js is almost always polluting my search results with half result coming from that file.
I know you can white-list specific types, but when I want to search in .js extension is there solution for that?
Vote here for feature: https://developercommunity.visualstudio.com/idea/405990/code-search-exclude-files-from-search.html?inRegister=true
Altough it does not solve your problem it may help out a bit
Ctrl + Shift + F should trigger the Find and Replace window.
From there, click Result Options and select "Display file names only".
It won't have all the info you need but might make it easier to recognize the files.
In Visual Studio 2019 they modernized the "find in files" feature, now you can exclude files, file extensions and directories using an exclamation mark before the items to be excluded in the "File types" textbox, like this:
*.*;!jquery.js
another example:
!*\bin\*;!*\obj\*;!*\.*;!*.xml
More info: https://devblogs.microsoft.com/visualstudio/modernizing-find-in-files/
In Visual Studio 2017 there is a workaround: you can right-click a search result and then click Delete. I use it to eliminate the big minified files from the Find Results window.
I've got the same problem with unwanted .js files polluting the search result. Especially the minified versions (e.g. jquery.min.js) are really annoying since they consist of only one (1) single very very long line. All of that line is displayed line-wrapped in search result. Not ideal!
Possible solutions:
Since .js files are (normally) just static content, you should be able to name them as you like. Rename it to jquery.min.js.nosearch and include the file with <script type="text/javascript" src="jquery.min.js.nosearch"></script> in HTML.
Get these files from an CDN and delete your local files.
Exclude these files from the VS project, provided that you can handle the inclusion of them in an other way when needed, e.g. when deploying (and provided that you scope your search to solution/project, not folder).
From this answer there was an UltraFind extension, which unfortunately doesn't exist for newer than 2010 (but see thread for hack to "update" it to 2012)
It's not particularly elegant - I'd be reluctant to call it a solution to the question - but if you can have Visual Studio Code running side-by-side with VS201x, its Find and Replace feature is pretty sophisticated. If you're using Git for source control, it will exclude any files or folders found in .gitignore from its search results - this is great when used in conjunction with tools like LibMan. Failing that, you can always manually add files / folders to its "files to exclude" option when searching.

Why do some of my files in visual studio get created as "Shortcuts"?

Why do some of my files in visual studio get created like this:
http://i.minus.com/jQi1qFTagyRVD.png
And why does it prevent me from moving them around? How am I supposed to work with a folder hierarchy in visual studio 2010 without this happening?
The main problem with this is that I cannot move files between folders using the solution explorer once I've added them. In order to move them I have to remove them, then drag them to a different folder, then add them again, this seems silly. See image:
http://i.minus.com/jlhGNHjyvpGOO.png
Folder structure of VS solution does not have to map one-to-one to file locations. You can add files "as link" (small triangle on Add button when you adding existing item) to a folder in VS solution. Such files will not be copied to the disk folder you are adding to, but rather have "link" pointing to original location (using relative path). I'd recommend opening the solution file in text editor to see how different files are referenced.
I.e. this feature is useful when you want to share sources between different projects.
I'm not sure about "move them around" part...

Find files in Visual studio 2010

When I use "Find in files" in visual studio 2010 I don't know how to exclude some folders from search? The only option I have found is: add folders.
If I would like to search all folders and files in parent folder execept one (child) folder, there is no way to exclude this particular folder from search?
I can set the folder as hidden but than it wont be visible in VS - I don't wont that.
All I wont is to exclude it from search.
Follow the below given steps:
Step 1: Press look in button.
Step 2: Select the folders in which you want to search.
I hope this will helpful for u.
If the problem is that the GUI is lagging because of too many search results. Try in setting, Find in Files -> Result options -> Display file names only = true

Resources