Is there any way to prevent the contents of .svn subdirectories to show up in Visual Studio Find in Files results?
An alternative would be to make it ignore hidden subdirectories.
According to the documentation for "Find in Files":
The Find and Replace tool does not search directories with the Hidden or System attribute set.
However, this seems to be only partially true. For VS to ignore hidden/system directories, the "Don't show hidden files, folders, and drives" option in Explorer must be set.
If you're like me, that's one of the first things you do on a Windows computer - change that setting to "Show hidden files, etc..." (along with showing extensions - it baffles me that anyone thinks that not showing extensions is a good idea or is less confusing than showing them).
Having files in the .svn metadata show up in search results is one of the very irritating things about using SVN and/or search tools that don't let you easily exclude the directories. Unfortunately, VS's "Find in Files" seems to be one of those irritants unless you're OK with to hiding the directories system-wide along with all other hidden files and directories.
Personally, I can usually get by with 'mentally' filtering those directories from the search results. If it's a particularly bad set of results, and you really, really need the filter, you can flip the setting in Explorer, perform the search , and change the setting back without having to reboot or restart VS or anything. That's a small consolation, but I was half expecting to have to restart VS for the setting change to take effect.
Also, if what you're really searching is the Project or Solution rather than an arbitrary location on the file system, you can tell "Find in Files" to search files in the Project/Solution as hunter suggested. But I assume that's not what you're searching, or you probably wouldn't be having this problem.
I believe you can do the following:
In the Find in Files dialog, click the [...] button next to Look In:
dropdown
In the Choose Search Folders dialog choose the folders you normally wish to search from the Available Folders section. Be sure not to select the .svn folder (mine appears to be only in the root folder, thankfully not in each sub-folder)
Click the > button to add them to the Selected folders.
In the Folder set dialog, give this set of folders a name e.g.
(Trunk)ProjectDatabaseFiles
Click Apply button then OK button
You can now select that set of folders by name in the Look In dropdown of the Find In Files dialog in there-by skipping any .svn files for the search
Related
I have a git codebase set up in my wamp64 folder, in a folder named songbookdb-deep
When I right click on a folder within songbookdb-deep, I can see the Find in Folder option for searching for code/text within files. However, when I right click on songbookdb-deep, the right click menu doesn't contain that option. The options it has are Open Editors, Folders (greyed out), Timeline, NPM Scripts.
I want to be able to search all of songbookdb-deep, not have to perform multiple searches on individual folders.
Why is the codebase root folder songbookdb-deep not allowing this please?
Thank you
...yes I know this is an old tune, but I would like to make it specific to the newest tool, and also put in context and emphasize the issue. Doing this in hope that soon we will have a working solution.
Context
In many web projects there are zillions of library files like jquery, bootstrap etc. To make it worst, there are the .min. siblings, what are one liner, so editor killers. Usually we do not want to search within those files and it is a productivity killer, especially if one accidentally clicks on a found .min. file which freezes the editor when opens...
Question
Is there any way to define and exclude folders in a project or solution when using VS 2019 Find in Files?
If you press the button to the right of the "Look In" drop down:
you can select a set of folders to use. This set of folders can be saved for future use (ie. the lack of ability to include a parent folder and then exclude a child is not as bad as it could be).
Issue
I get 'All Files are up to date' with TFS's 'get latest' (Both at the parent directory and solution level) when they clearly aren't (there are a few folders that others have checked in that I am not getting). I can see they exist locally in the appropriate location (which is most certainly mapped) but I absolutely can not get them added to solution explorer.
I'm in VS 2013.
What I've Tried
1) Drag and drop the folders from the file explorer. Doesn't work - VS apparently doesn't allow this.
2) Right click the parent folder in Solution Explorer click 'Add -> existing item'. Apparently you can't add an entire folder, so adding individually is no good as there are over 2000 items in all the sub-directories.
3) Right click, 'Source Control -> Get Specific Version' check both boxes regarding overwriting.
4) Repeat step 3, but first delete folder in the file explorer. The files get re-added to file explorer, but not Solution Explorer.
5) I found this Visual Studio Solution Explorer not showing files and folders and tried it, also to no avail.
6) Multiple combinations of all the above steps, restarting VS, etc.
Thanks!
EDIT 2/24/2016
Adding this here as a reference diagram for my comment in response to the answer, as I can't use new lines in a comment.
File Structure:
FooFolder
|-foo.txt
|-BarFolder
|--bar.txt
In the above example, you still have to ctrl+click through foo.txt and bar.txt separately, since select all would include the folders and disallow add to solution.
If you see the "missing" files on your local file system after a Get Latest then they are correctly in Source Control. To add the files to your project you need to Show All Files then you can right click each and Include in Project:
To add files to the solution right click and choose Add | Existing Item:
Complex solutions usually contains several projects.
Currently I have more than 30 projects in a solution.
Some of the projects could contain many files inside (up to 1000 or more).
So when you open files from different projects all this stuff is expanded.
So if I want to find some file using solution explorer I need to scroll forever until it will be found.
Of course it is possible to navigate to it using Resharper's Ctrl+T but this is not related to those files you don't remember names but remember in which project and in which folder it is located.
I've tried to find some extension which could create tabs from projects but unfortunately unsuccessfully.
So is there any way to effectively navigate in such scenarios?
Some ideas:
Organize files into folders so that you don't have more than a few folders open when working on any given feature
Forget files; instead, navigate to class by name. Ctrl+, is the default shortcut.
Use F12 to go to definition; this also avoids having to find the file.
Search by keyword. Ctrl+Shift+F finds in all files. You just need to remember something from the file; it doesn't have to be the file name.
Enable "Track Active Item in Solution Explorer" in Options / Projects & Solutions / General. This keeps the file that is being edited selected in the solution explorer (but does lead to lots of folders expanding all the time).
Conversely, disable "Track Active Item", then you'll be in charge of what folders are expanded. Try both, see which one works best.
Use Solution Folders, which enable you to place several projects into a folder.
I have to "look in:" a subfolder of the project because the entire project is very large and takes too long to search through.
I also have AnkhSVN installed and wonder if a setting in the plugin could help too.
If you use "Find in files" instead of the standard search, you can search a subfolder for file types you specify.
However, it's a lot easier to perform this kind of task using the Ultrafind add-on (http://visualstudiogallery.msdn.microsoft.com/9fa9fdd7-1c06-45e3-a9f3-0381caab8f94) which you can use to exclude specific file patterns.
Sadly, it seems that despite all the wonderful functionality of Visual Studio, the easiest way to omit .svn directories from searches is to use Windows Explorer to navigate to the .svn directory, right click the folder, go to Properties, and click the Hidden checkbox under Properties.
If you then re-open your Visual Studio solution, it should keep those files out of the searches.
A quick and dirty way is to simply include every other file type except .svn and .svn-base etc.
Try using this set of wildcards and add any other valid extensions beginning with S that you might need:
*.sql;*.svc;*.;*.?;*.??;*.a??;*.a???;*.a????;*.b??;*.b???;*.b????;*.c??;*.c???;*.c????;*.d??;*.d???;*.d????;*.e??;*.e???;*.e????;*.f??;*.f???;*.f????;*.g??;*.g???;*.g????;*.h??;*.h???;*.h????;*.i??;*.i???;*.i????;*.j??;*.j???;*.j????;*.k??;*.k???;*.k????;*.l??;*.l???;*.l????;*.m??;*.m???;*.m????;*.n??;*.n???;*.n????;*.o??;*.o???;*.o????;*.p??;*.p???;*.p????;*.q??;*.q???;*.q????;*.r??;*.r???;*.r????;*.t??;*.t???;*.t????;*.u??;*.u???;*.u????;*.v??;*.v???;*.v????;*.w??;*.w???;*.w????;*.x??;*.x???;*.x????;*.y??;*.y???;*.y????;*.z??;*.z???;*.z????;*.0??;*.0???;*.0????;*.1??;*.1???;*.1????;*.2??;*.2???;*.2????;*.3??;*.3???;*.3????;*.4??;*.4???;*.4????;*.5??;*.5???;*.5????;*.6??;*.6???;*.6????;*.7??;*.7???;*.7????;*.8??;*.8???;*.8????;*.9??;*.9???;*.9????;
(I had to use various combinations of ? instead of a single * because the final extension could still be .svn)