结果的排序顺序为“查找所有参考"在Visual Studio中 [英] Sort order of result for "Find All References" in Visual Studio

查看:130
本文介绍了结果的排序顺序为“查找所有参考"在Visual Studio中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用Visual Studio 2010,但我不认为这是特定于版本的问题(认为在2008年也是如此).

I'm currently using Visual Studio 2010, but I don't think this is a version specific issue (think it was the exact same way in 2008 as well).

当我想找出解决方案中使用了什么变量/函数/什么的地方时,请右键单击它,然后选择查找所有引用".这在查找符号结果视图中为我列出了所有现有参考文献.但是,此列表非常混乱.结果似乎由它们所在的文件排序,但是它在那里停止.它们既没有按行号排序,也没有任何合乎逻辑的东西(至少我能看到...).

When I want to find out where in my solution some variable/function/whatever is used, I right-click it and select "Find All References". This gives me a long list in the Find Symbol Results view over all existing references. This list however, is quite messy. The results seem to be ordered by which file they are in, but it stops there. They are neither sorted by line number nor anything else slightly logical (at least that I can see...).

如果我在例如Eclipse,我得到一个不错的列表,其中搜索结果按文件排序,然后按文件中的函数和行号排序.有没有一种方法可以在Visual Studio中实现相同目的(也许需要指定一些首选项)?还是这只是Visual Studio完全没有希望的那些愚蠢的事情之一?还是仅仅是我缺少一些出色的排序逻辑?

If I do the same kind of operation in e.g. Eclipse, I get a nice list where the search results are nicely ordered by file, then function and line number in the file. Is there a way I can achieve the same in Visual Studio (some preference to specify perhaps)? Or is this just one of those silly things where Visual Studio is completely hopeless? Or is there simply some brilliant sort ordering logic that I'm missing?

这并不是一个很大的问题,但是如果以某种逻辑顺序查看变量的引用,这将使它变得非常容易...

It's not like this is a very big problem, but it makes it quite much easier when you look through the references of a variable if it is in some kind of logical order...

更新:
只是要澄清一下:我知道还有其他加载项和工具,例如ReSharper等,它们比Visual Studio做得更好.我很想知道是否可以对Visual Studio现有的查找所有引用"中的搜索输出进行清理".如果不是这样,那么当前排序顺序背后的逻辑到底是什么(必须有一些 逻辑,因为每当我搜索相同的变量时,结果中的顺序似乎都是相同的).

Update:
Just to clarify: I know there are other add-ons and tools like ReSharper etc. that does these kind of things much better than Visual Studio. I'm interested if it is possible to "sanitize" the search-output from Visual Studio's existing "Find All References". And if not - what on earth is the logic behind their current sorting order (there has to be some logic, because I seem to get the same order in the results whenever I search for the same variable).

推荐答案

我对VS小组进行了ping操作,结果发现奇怪的原因是查找所有引用"基于字符串而不是数字.这就是为什么您看到1,2、25、3、35、4等的原因.他们将其作为错误进行跟踪,并已确定将其修复,但时间轴未知.

I pinged the VS team on this one and it turns out that the reason for the wierdness is that Find All References is based on strings instead of numbers. This is why you see 1,2, 25, 3, 35, 4, etc... They are tracking it as a bug and it is slated to be fixed but the timeline is unknown.

这篇关于结果的排序顺序为“查找所有参考"在Visual Studio中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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