Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Find in Files: No .svn contents pleeeeeease?

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.

like image 223
Serge Wautier Avatar asked Dec 21 '22 09:12

Serge Wautier


1 Answers

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.

like image 62
Michael Burr Avatar answered Jan 02 '23 20:01

Michael Burr