Is there an easy way to jump directly to a method inside a file?

I just installed Visual Studio 2012 and it’s hard for me to navigate inside the file. What I would like to do is enter one or more characters of the class, method, field or property into the file and go directly to this line. For example, if I had a code:

public class Foo { public void Bar() { } } 

I would like to be able to hit the keyboard shortcut, type β€œBa” and go straight to the Foo class Bar method.

In VS2008 and VS2010, I used USysWare DPack to do this using the Alt + G key combination. However, it seems that the version of this plugin for VS2012 does not exist, at least not yet.

I found the hotkey Ctrl + ; to search for a solution that seems to work well enough for navigating to a specific file (similar to the DPack Alt + U shortcut), however I'm looking for something that will look for code in the current file that opens.

By the way, I am currently using VS2012 Express Edition, but I will upgrade to VS2012 Pro when I have time to download it and configure it. I believe that there are some slight differences between these versions, so I'm interested in answers that relate to one or both.

+8
visual-studio-2012
source share
6 answers

So, here is a summary of what I learned after some research.

DPack for Visual Studio 2012 . It currently works in beta, but works great. Since this is a plugin, it will not run in Express Edition Visual Studio .

Ctrl + F : the standard dialog Ctrl + F was completely reinvented in Visual Studio 2012 and is a more built-in search that jumps in your document as you type. It is useful enough for finding characters, but it will also find any relevant text in the document, including links , string constants, comments, whatever. For this reason, this is probably not the best way to quickly jump to a character.

Ctrl + Comma This is also a new feature of VS2012, however it is not available in Visual Studio Express Edition . This allows you to quickly find the character in your decision. It works quite well, although for large projects this can be an overload of information.

Ctrl + semicolon . In Solution Explorer, you can now filter by file name using the keyboard shortcut Ctrl + ; . This makes finding files quick and easy, but will not search for characters in the current file. This is more like DPack Ctrl + U.

Search by class . In class view ( Ctrl + Shift + C ), you can also search for class names or characters in your complete solution. However, it doesn't seem to require a keyboard shortcut to use this search, and you cannot just search for the current file. In addition, you must enter your query and press "Enter" to display the results, and not just filter as you type.

Partitioning a class / method . Like previous versions of Visual Studio, code files have drop-down lists just below the file tabs that display the classes and methods in the current file. This is rather unsuitable for quickly switching to any method in the document, since you first need to select the class in which this symbol is defined, and then select the symbol itself. Also, there are no shortcuts for the keys that I could find, and there is no easy way to filter the items in the list by entering part of the character name.

+11
source share

You can use Ctrl+, - just enter what you want in the field and you will find the corresponding characters.

+8
source share

In VS 2017 (not sure, it may also work for some previous versions):

  • Ctrl + T (or Ctrl +,) to open the Go To All window, then
  • Ctrl + Alt + C to include the current area of ​​the document. In the "Go to all" window, there is a corresponding button that displays the degree of document binding or not.
+4
source share

If I understand correctly, you can do this through the drop-down menu on the right, just above the encoding window.

http://i.imgur.com/uv96R.png

I do not know another way, but this does not mean that no. Hope this helps.

0
source share

At the top of the solution explorer you can search there.

In addition, you can go to the code from the solution explorer. This will lead you to each of the properties and methods.

0
source share

With Resharper, you can use Ctrl + F12 to jump to a member of the current class, method, or field.

0
source share

All Articles