VS Find in files: no .svn content pleeeeeease?

Is there a way to prevent the contents of .svn subdirectories from .svn displayed in Visual Studio Find in Files results?

An alternative would be to force it to ignore hidden subdirectories.

+4
source share
2 answers

According to the documentation for "Find in Files":

The Find and Replace tool does not search directories with a set of Hidden or System attributes.

However, this seems to be only partially true. In order for VS to ignore hidden / system directories, you must set the option "Do not show hidden files, folders and drives" in Explorer.

If you are like me, this is one of the first things you do on a Windows computer - change this setting to "Show hidden files, etc." (along with displaying extensions - it puzzles me that everyone thinks that not showing extensions is a good idea or less confusing than showing them).

The presence of files in the .svn metadata displayed in the search results is one of the most annoying factors for using SVN and / or search tools that prevent you from easily excluding directories. Unfortunately, VS "Find in Files" is apparently one of these annoyances, unless you hide that you hide directories in the system along with all other hidden files and directories.

Personally, I can usually “mentally” filter these directories from search results. If this is a particularly poor result set and you really need a filter, you can flip the setting in Explorer, search and change the setting without rebooting or restarting VS or anything else. This is a little consolation, but I expected that I would have to restart VS for the setting changes to take effect.

In addition, if you are really looking for a project or solution, rather than an arbitrary location in the file system, you can say “Find Files” to search for files in the project / solution, as the hunter suggested. But I guess that is not what you are looking for, or you probably will not have this problem.

+7
source

I believe you can do the following:

  • In the Find Files dialog box, click the [...] button next to Look In: ​​Drop-down

  • In the Select Search Folders dialog box, select the folders that you usually want to find in the Available Folders section. Make sure not to select the .svn folder (mine seems to be located only in the root folder, fortunately not in every subfolder)

  • Click the> button to add them to the selected folders.

  • In the Folder Set dialog box, give this folder set a name, for example. (Trunk) ProjectDatabaseFiles

  • Click the Apply button, then the OK button

Now you can select this set of folders by name in the Look In drop-down menu of the Find In Files dialog box, skipping any .svn files to search

+2
source

All Articles