5

Visual Studio has a "Find All References" tool that is great in navigating the codebase to find out where a function is called or where a variable is used. When navigating a large code base, I tend to do find all references multiple times to find the top level of where a function is called.

Imagine we have the following:

A1() calls B1(), B1() calls C()

A2() calls B2(), B2() calls C()

My problem:

If I do find all references on C(), I find both B1() and B2(), which is great.

Now, I try to find out where B1() is called. I find A1() calls B1(). Great!

However, I run into an issue when I want to back track and find out what calls B2(), but I lost track of B2()! By default, VS.NET only has window for the "Find All References" result. Since I found all references for B1() just now, I lost track of where C() was called. I now have to find all references to C(), and then find all references to B2(). I'm working in a large code base, and finding all references can easily take more than a minute for a function. It would be nice if I could save the results of a search, and future find all references would open a new window instead of overwriting the existing search.

Is there a setting in VS.NET 2008 or a free addon that would allow me to have multiple "Find All References" windows?

On a related note, VS.NET has 2 Find result windows for searching for text. Is there a way to have more?

4

3 回答 3

3

我不知道工作室,但Resharper为你做这件事。当您使用“查找用法”功能时,它将跟踪您以前的所有搜索。您还可以为 hte 搜索的范围(当前文件、项目、解决方案等)以及搜索选项(基本类型的使用等)提供一些很好的灵活性。

他们确实提供免费试用,因此请查看是否满足您的需求。

于 2009-06-26T19:06:30.917 回答
2

另一个有用的技巧是 Ctrl+K+K(设置书签)或 Ctrl+K+N(遍历到下一个书签)。这些存储在 Visual Studio 的 *.suo(用户文件)中。如果您正在搜索大型代码库并且在 Visual Studio 中获得一百万个文件选项卡,这也很有用。如果您保留实际编码位置的书签,则可以在眨眼间返回该文件选项卡。

于 2011-08-25T01:44:42.023 回答
2

我知道这个问题很老,但显然您可以通过使用面板标题(VS2017)上的“保留结果”按钮来保留结果选项卡并在新选项卡中获取新结果。

于 2021-01-19T15:41:47.060 回答