有什么方法可以将排除列表应用于 Visual Studio 的“导航到"列表? [英] Any way to apply an exclude list to the Visual Studio "Navigate To"-list?

查看:27
本文介绍了有什么方法可以将排除列表应用于 Visual Studio 的“导航到"列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从 Edit > 中排除代码生成的文件在 Visual Studio 2013 中点击 Ctrl+, 时出现的导航至-list,因为这些文件永远不会被我手动修改,并且在我想查看内容的极少数情况下他们,我将使用解决方案浏览器.有没有办法做到这一点?它们在我的搜索中产生了很多噪音,并大大降低了 Navigate to 功能的价值.

I'd like to exclude code-generated files from the Edit > Navigate To-list which appears when hitting Ctrl+, in Visual Studio 2013, as these files are never to be modified by me manually and in those rare cases where I want to see the contents of them, I'll use the solution browser. Is there any way to do this? They produce a lot of noise in my search and greatly reduces the value of the Navigate to-function.

编辑 2016 年 11 月:在 VS 2015 中添加了用于说明的图像.仍然是一个很大的问题.第一个搜索结果是 obj 文件夹中的 .g.cs 文件:

Edit Nov 2016: added an image for illustration in VS 2015. Very much an issue still. The first search hit is a .g.cs file in the obj-folder:

推荐答案

我假设代码生成的文件"指的是诸如 .designer 之类的文件,它们也是解决方案的一部分(并在解决方案资源管理器中找到).在对 Navigate To 进行了大量研究后,我找不到对此类配置选项的任何引用.目前似乎只有 3 个配置选项(在下面的 MSDN 博客中讨论).一种可能的解决方法是利用 Navigate To(@CapitalizationWhitespace) 是 VS2013 的新内容,如此 MSDN 博客中所述:

I assume that by "code-generated files" you are referring to files such as .designer that are also part of the solution (and found in solution explorer). After quite a bit of research into Navigate To I was unable to find any reference to such a configuration option. Currently there appears to be only 3 options for configuration (discussed in the MSDN blog below). A possible work around would be to leverage the built in filtering features of Navigate To (@, Capitalization and Whitespace) that are new to VS2013 as outlined in this MSDN blog:

http://blogs.msdn.com/b/mvpawardprogram/archive/2013/10/22/visual-studio-2013-navigate-to-improvements.aspx

我在研究中发现的另一篇文章:http://weblogs.asp.net/scottgu/archive/2009/10/21/searching-and-navigating-code-in-vs-2010-vs-2010-and-net-4-0-series.aspx

Another article I found in my research: http://weblogs.asp.net/scottgu/archive/2009/10/21/searching-and-navigating-code-in-vs-2010-vs-2010-and-net-4-0-series.aspx

更新:我使用 ReSharper 插件,只有在发布此答案后才意识到有一个 Filter results from generated files 功能来排除生成的文件,并在链接中讨论以下.虽然它不属于 Navigate To,但它可以提供一个令人满意的替代方案:

UPDATE: I use the ReSharper plugin and only after posting this answer realized there is a Filter results from generated files feature to exclude generated files and is discussed at the link below. Though it does not pertain to Navigate To, it may provide a satisfactory alternative:

http://www.jetbrains.com/resharper/webhelp/Reference__Options__Environment__Search_and_Navigation.html

更新(2015 年 1 月 12 日): 现在已经过了一段时间,我决定做更多的研究,并在 SO 此处.我发现这很好用,VS 甚至会为您保存列表.

UPDATE (12/1/2015): Now that some time has passed I decided to do a little more research and found a similar request posted on SO here. I found this to work pretty well, and VS will even save the list for you.

这篇关于有什么方法可以将排除列表应用于 Visual Studio 的“导航到"列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆