|
1 | 1 | ---
|
2 |
| -title: "Go To | Microsoft Docs" |
| 2 | +title: "Find code using Go To commands | Microsoft Docs" |
3 | 3 | ms.custom: ""
|
4 |
| -ms.date: "11/16/2016" |
| 4 | +ms.date: "09/26/2017" |
5 | 5 | ms.reviewer: ""
|
6 | 6 | ms.suite: ""
|
7 | 7 | ms.technology:
|
8 | 8 | - "vs-ide-general"
|
9 | 9 | ms.tgt_pltfrm: ""
|
10 | 10 | ms.topic: "article"
|
11 | 11 | ms.assetid: 509b2107-23d1-4fb3-987f-ab99ef45b72e
|
| 12 | +helpviewer_keywords: |
| 13 | + - "code editor, go to" |
| 14 | + - "code editor, go to line" |
| 15 | + - "go to line" |
| 16 | + - "go to" |
12 | 17 | author: "gewarren"
|
13 | 18 | ms.author: "gewarren"
|
14 | 19 | manager: "ghogen"
|
15 |
| -translation.priority.ht: |
16 |
| - - "cs-cz" |
17 |
| - - "de-de" |
18 |
| - - "es-es" |
19 |
| - - "fr-fr" |
20 |
| - - "it-it" |
21 |
| - - "ja-jp" |
22 |
| - - "ko-kr" |
23 |
| - - "pl-pl" |
24 |
| - - "pt-br" |
25 |
| - - "ru-ru" |
26 |
| - - "tr-tr" |
27 |
| - - "zh-cn" |
28 |
| - - "zh-tw" |
29 | 20 | ---
|
| 21 | +# Find code using Go To commands |
| 22 | +Visual Studio's **Go To** commands perform a focused search of your code to help you quickly find specified items. You can go to a specific line, type, symbol, file, and member from a simple, unified interface. This feature exists in Visual Studio 2017 and later. |
30 | 23 |
|
31 |
| -# Go To |
32 |
| -There are many ways to easily navigate your code inside of the Visual Studio IDE, both from the keyboard and the mouse. |
| 24 | +### How to use it |
33 | 25 |
|
34 |
| -<!-- VERSIONLESS --> |
35 |
| -## Go To All |
36 |
| -This feature exists in Visual Studio 2017 and later. It allows you to navigate through your code to find the specific bits you are looking for. You can search for a specific line, type, symbol, file, and more from a simple, unified interface. |
37 |
| - |
38 |
| -### How to use |
39 |
| -* **Keyboard** |
40 |
| - * Press **Ctrl+,** or **Ctrl+T**. (Note that your keyboard shortcut may be different based on which profile you've selected.) |
41 |
| -* **Mouse** |
42 |
| - * Select **Edit > Go To > Go To All**. |
| 26 | +Input | Function |
| 27 | +------------ | --- |
| 28 | +**Keyboard** | Press **Ctrl + T** |
| 29 | +**Mouse** | Select **Edit**, **Go To**, **Go To All** |
43 | 30 |
|
44 |
| -This will display a small window at the top right of your IDE, by default. |
| 31 | +This will display a small window at the top right of your code editor, by default. |
45 | 32 |
|
46 | 33 | 
|
47 | 34 |
|
48 |
| -From here, there are several ways to proceed: |
49 |
| -* Enter text without a prefix to search using the [filter icons](#filtered-searches) selected below the text box. |
50 |
| -* Enter a [prefix](#filtered-searches) followed by the text to search. |
51 |
| -* Enter a question mark (?) to get additional help. |
| 35 | +As you type in the text box, the results appear in a drop-down list below the text box. To go to an element, choose it in the list. |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | +You can also enter a question mark (?) to get additional help. |
| 40 | + |
52 | 41 | 
|
53 | 42 |
|
54 |
| -### Filtered Searches |
55 |
| -To narrow your search to a specific type, you can either use a prefix when typing, or use the icons below the search window as shown below. |
| 43 | +### Filtered Searches |
| 44 | +By default, the specified item is searched for in all solution items. However, you can limit your code search to specific element types by prefacing the search terms with certain characters. You can also quickly change the search filter by choosing buttons on the Go To dialog box toolbar. Buttons that change the type filters are on the left side, and buttons that change the scope of the search are on the right side. |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | +#### Filter to a specific type of code element |
| 49 | +To narrow your search to a specific type of code element, you can either specify a prefix in the search box, or select one of the five filter icons: |
56 | 50 |
|
57 | 51 | Prefix | Icon | Shortcut | Description
|
58 | 52 | :----: | ---- | -------- | ---
|
59 |
| -# |  | Ctrl+1, Ctrl+S | Find matching symbols |
60 |
| -f |  | Ctrl+1, Ctrl+F | Find matching file names |
61 |
| -m |  | Ctrl+1, Ctrl+M | Find matching members |
62 |
| -t |  | Ctrl+1, Ctrl+T | Find matching types |
63 |
| -: |  | Ctrl+G | Go to the line number entered |
| 53 | +\# |  | Ctrl+1, Ctrl+S | Go to the specified symbol |
| 54 | +f |  | Ctrl+1, Ctrl+F | Go to the specified file |
| 55 | +m |  | Ctrl+1, Ctrl+M | Go to the specified member |
| 56 | +t |  | Ctrl+1, Ctrl+T | Go to the specified type |
| 57 | +: |  | Ctrl+G | Go to the specified line number |
64 | 58 |
|
65 |
| -### Search Locations |
66 |
| -To narrow your search to specific locations, use the two document icons. |
| 59 | +#### Filter to a specific location |
| 60 | +To narrow your search to a specific location, select one of the two document icons: |
67 | 61 |
|
68 | 62 | Icon | Description
|
69 | 63 | ---- | ---
|
70 | 64 |  | Search current document only
|
71 |
| - | Search external documents in addition to those located in the project/solution |
| 65 | + | Search external documents in addition to those located in the project/solution |
72 | 66 |
|
73 |
| -### Settings |
74 |
| -Clicking the gear icon  at the lower-right lets you change how this feature works. |
| 67 | +### Camel casing |
| 68 | +If you use [camel casing](https://en.wikipedia.org/wiki/Camel_case) in your code, you can find code elements faster by entering only the capital letters of the code element name. For example, if your code has a type called `CredentialViewModel`, you can narrow down the search by choosing the Type filter ("t") and then entering just the capital letters of the name (`CVM`) in the Go To dialog box. This feature can be helpful if your code has long names. |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | +### Settings |
| 73 | +Selecting the gear icon  lets you change how this feature works: |
75 | 74 |
|
76 | 75 | Setting | Description
|
77 | 76 | ------- | ---
|
78 | 77 | Use preview tab | Display the selected item immediately in the IDE's preview tab
|
79 |
| -Show details | Display project, file, line and summary information from documentation comments in the window |
80 |
| -Center window | Move this window to the center of the IDE instead of the top-right |
81 |
| -<!-- END VERSIONLESS --> |
82 |
| - |
83 |
| -## Go To Definition |
84 |
| -Navigate to the source of a type and open the result in a new tab: |
85 |
| - |
86 |
| -Input | Function |
87 |
| ------------- | --- |
88 |
| -**Keyboard** | Place your text cursor somewhere inside the type name, and press **F12** |
89 |
| -**Mouse** | Right-click on the type name and select **Go To Definition** |
90 |
| - |
91 |
| -## Peek Definition |
92 |
| -Preview the definition of a type in a popup window instead of a new tab: |
93 |
| - |
94 |
| -Input | Function |
95 |
| ------------- | --- |
96 |
| -**Keyboard** | Place your text cursor somewhere inside the type name, and press **Alt+F12** |
97 |
| -**Mouse** | Right-click on the type name and select **Peek Definition** |
98 |
| - |
99 |
| -If you peek another definition from the popup window, you will start a breadcrumb path which you can navigate using the circles and arrows which appear above the popup. For more information, see [How to: View and Edit Code by Using Peek Definition (Alt+F12)](how-to-view-and-edit-code-by-using-peek-definition-alt-plus-f12.md). |
100 |
| - |
101 |
| -## Go To Implementation |
102 |
| -Navigate from a base class or type to its implementations. If there are multiple implementations, you will see them listed in the **Find Symbol Results** window: |
103 |
| - |
104 |
| -Input | Function |
105 |
| ------------- | --- |
106 |
| -**Keyboard** | Place your text cursor somewhere inside the type name, and press **Ctrl+F12** |
107 |
| -**Mouse** | Right-click on the type name and select **Go To Implementation** |
108 |
| - |
109 |
| -## Find All References |
110 |
| -Find all places where a method/property/variable is being used. You can use this to verify dead code and check possible side-effects of a large refactoring. Press **F8** to jump between results. |
111 |
| - |
112 |
| -Input | Function |
113 |
| ------------- | --- |
114 |
| -**Keyboard** | Place your text cursor somewhere inside the type name, and press **Ctrl+K, R** |
115 |
| -**Mouse** | Right-click on the type name and select **Find All References** |
116 |
| - |
117 |
| -## Navigating Results |
118 |
| -When using the navigation features of Visual Studio, you can navigate forward and backward through the stack: |
119 |
| - |
120 |
| -Input | Function |
121 |
| ------------- | --- |
122 |
| -**Ctrl+-** | Navigate backward through the stack |
123 |
| -**Ctrl+Shift+-** | Navigate forward through the stack |
| 78 | +Show details | Display project, file, line, and summary information from documentation comments in the window |
| 79 | +Center window | Move this window to the top-center of the code editor, instead of the top-right |
124 | 80 |
|
125 |
| -You can also use the **View > Navigate Backward** and **View > Navigate Forward** menu items. |
| 81 | +## See Also |
| 82 | +[Navigating Code](../ide/navigating-code.md) |
| 83 | +[Go To Definition and Peek Definition](../ide/go-to-and-peek-definition.md) |
0 commit comments