开发者

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 开发者_如何学Pythonit 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:

  1. In the Find in Files dialog, click the [...] button next to Look In: dropdown

  2. 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)

  3. Click the > button to add them to the Selected folders.

  4. In the Folder set dialog, give this set of folders a name e.g. (Trunk)ProjectDatabaseFiles

  5. 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜