You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: "Use various tools in Visual Studio to navigate around your C++ code base."
3
+
description: "Use various tools in Visual Studio to navigate around your C++ codebase."
4
4
ms.date: "05/28/2019"
5
5
---
6
6
# Navigate C++ code in Visual Studio
7
7
8
-
Visual Studio provides a suite of tools to allow you to navigate around your codebase quickly and efficiently.
8
+
Visual Studio provides a suite of tools that you can use to navigate around your codebase quickly and efficiently.
9
9
10
10
## Open an included file
11
11
12
-
Right-click on an `#include` directive and choose**Go To Document**, or press **F12** with the cursor over that line, to open the file.
12
+
Right-click an `#include` directive, and select**Go To Document**. Or, select **F12** with the cursor over that line to open the file.
13
13
14
14

15
15
16
16
## Toggle Header/Code File
17
17
18
-
You can switch between a header file and its corresponding source file, by right-clicking anywhere in your file and choosing**Toggle Header / Code File** or by pressing **Ctrl + K, Ctrl + O**.
18
+
You can switch between a header file and its corresponding source file. Right-click anywhere in your file and select**Toggle Header/Code File**. Or, you can select **Ctrl+K**, **Ctrl+O**.
19
19
20
20
## Go To Definition/Declaration
21
21
22
-
You can navigate to the definition of a code symbol by right-clicking it in the editor and choosing**Go To Definition**, or pressing **F12**. You can navigate to a declaration similarly from the right-click context menu, or by pressing**Ctrl + F12**.
22
+
You can navigate to the definition of a code symbol by right-clicking it in the editor and selecting**Go To Definition**, or by selecting **F12**. You can navigate to a declaration similarly by right-clicking to open the context menu, or by selecting**Ctrl+F12**.
23
23
24
24

25
25
26
26
## Go To
27
27
28
28
**Go To** refers to a set of navigation features that each provide a specific kind of result based on filters you specify.
29
29
30
-
You can open **Go To** with **Ctrl + ,**. This creates a search box over the document you are editing.
30
+
You can open **Go To** with **Ctrl+,**. This action creates a search box over the document you're editing.
31
31
32
32

33
33
34
34
**Go To** includes these search filters:
35
35
36
-
-**Go To Line (Ctrl + G)**: quickly jump to a different line in your current document
37
-
-**Go To All (Ctrl + ,)** or **(Ctrl + T)**: search results include everything below
38
-
-**Go To File (Ctrl 1, F)**: search for files in your solution
39
-
-**Go To Type (Ctrl 1, T)**: search results include:
40
-
- Classes, Structs, Enums
41
-
- Interfaces & Delegates (managed code only)
42
-
-**Go To Member (Ctrl 1, M)**: search results include:
43
-
- Global variables and global functions
44
-
- Class member variables and member functions
45
-
- Constants
46
-
- Enum Items
47
-
- Properties and Events
48
-
-**Go To Symbol (Ctrl 1, S)**: search results include:
49
-
- Results from Go To Types and Go To Members
50
-
- All remaining C++ language constructs, including macros
51
-
52
-
When you first invoke **Go To** with **Ctrl +**, **Go To All** is activated (no filters on search results). You can then select your desired filter by using the buttons near the search textbox. You can invoke a specific filter using its corresponding keyboard shortcut. Doing so opens the **Go To** search box with that filter pre-selected. All keyboard shortcuts are configurable.
53
-
54
-
To apply a text filter, start your search query with the filter’s corresponding character followed by a space. (**Go To Line** can optionally omit the space.) These are the available text filters:
36
+
-**Go To Line** (**Ctrl+G**): Quickly jump to a different line in your current document.
37
+
-**Go To All** (**Ctrl+,**) or (**Ctrl+T**): Search results include everything that follows.
38
+
-**Go To File** (**Ctrl 1, F**): Search for files in your solution.
39
+
-**Go To Type** (**Ctrl 1, T**): Search results include:
40
+
- Classes, structs, and enums.
41
+
- Interfaces and delegates (managed code only).
42
+
-**Go To Member** (**Ctrl 1, M**): Search results include:
43
+
- Global variables and global functions.
44
+
- Class member variables and member functions.
45
+
- Constants.
46
+
- Enum items.
47
+
- Properties and events.
48
+
-**Go To Symbol** (**Ctrl 1, S**): Search results include:
49
+
- Results from Go To Types and Go To Members.
50
+
- All remaining C++ language constructs, which includes macros.
51
+
52
+
When you first invoke **Go To** with **Ctrl +**, **Go To All** is activated (no filters on search results). You then can select the filter you want by using the buttons near the search box. You can invoke a specific filter using its corresponding keyboard shortcut. Doing so opens the **Go To** search box with that filter preselected. All keyboard shortcuts are configurable.
53
+
54
+
To apply a text filter, start your search query with the filter’s corresponding character followed by a space. (**Go To Line** can optionally omit the space.) These text filters are available:
55
55
56
56
- Go To All: (no text filter)
57
57
- Go To Line Number: :
@@ -60,35 +60,35 @@ To apply a text filter, start your search query with the filter’s correspondin
60
60
- Go To Member: m
61
61
- Go To Symbol: #
62
62
63
-
The following example shows results from a *Go To Files* operation using the 'f' filter:
63
+
The following example shows results from a *Go To Files* operation by using the "f" filter:
64
64
65
65

66
66
67
-
To see the list of text filters, type a ? followed by a space. You can also access the **Go To** commands with the **Edit** menu. This is another way to remind yourself of the main Go To keyboard shortcuts.
67
+
To see the list of text filters, type a ? followed by a space. You also can access the **Go To** commands with the **Edit** menu. This is another way to remind yourself of the main **Go To** keyboard shortcuts.
68
68
69
69

70
70
71
-
## Find / Find in Files
71
+
## Find or Find in Files
72
72
73
-
You can run a text search for anything in your solution with **Find (Ctrl + F)**or **Find in Files (Ctrl + Shift + F)**.
73
+
You can run a text search for anything in your solution with **Find** (**Ctrl+F**) or **Find in Files** (**Ctrl+Shift+F**).
74
74
75
-
Find can be scoped to a selection, the current document, all open documents, the current project, or the entire solution. You can use regular expressions as well as plain text. It also highlights all matches automatically in the IDE.
75
+
**Find** can be scoped to a selection, the current document, all open documents, the current project, or the entire solution. You can use regular expressions and plain text. It also highlights all matches automatically in the IDE.
**Find in Files** is a more powerful version of **Find** that displays results in the **Find Results** window. You can search external code dependencies, filter by filetypes, and more.
79
+
**Find in Files** is a more powerful version of **Find** that displays results in the **Find Results** window. You can search external code dependencies, filter by file types, and more.
80
80
81
81

82
82
83
-
You can organize **Find in Files** results in two windows. You can append results from multiple searches together. Click on a result to go to that location in the file.
83
+
You can organize **Find in Files** results in two windows. You can append results from multiple searches together. Select a result to go to that location in the file.
84
84
85
85

86
86
87
87
For more information, see [Find in Files](/visualstudio/ide/find-in-files) in the Visual Studio documentation.
88
88
89
89
## Find All References
90
90
91
-
To find all usages of a symbol in your codebase, place the caret in or just after the symbol, then right-click and choose **Find All References**. You can filter, sort, or group results in many different ways. Results populate incrementally. They are classified as Reads or Writes to help you see what is in your solution as opposed to system headers or other libraries.
91
+
To find all usages of a symbol in your codebase, place the caret in or just after the symbol, right-click, and then select **Find All References**. You can filter, sort, or group results in many different ways. Results populate incrementally. They're classified as Reads or Writes to help you see what's in your solution as opposed to system headers or other libraries.
92
92
93
93

94
94
@@ -102,28 +102,28 @@ You group results by the following categories:
102
102
103
103
#### Filter results
104
104
105
-
To filter results, hover over a column and click the filtering icon that pops up. You can filter results from the first column to hide things like string and comment references that you might not want to see.
105
+
To filter results, hover over a column and select the filtering icon that pops up. You can filter results from the first column to hide things like string and comment references that you might not want to see.
106
106
107
107

108
108
109
-
-**Confirmed Results**: Actual code references to the symbol being searched for. For example, searching for a member function called `Size`will return all references to `Size` that match the scope of the class defining`Size`.
109
+
-**Confirmed results**: Actual code references to the symbol being searched for. For example, searching for a member function called `Size`returns all references to `Size` that match the scope of the class that defines`Size`.
110
110
111
-
-**Disconfirmed Results**: This filter is off by default because it shows symbols whose name matches but are not actual references to the symbol you are searching for. For example, if you have two classes that each define a member function called `Size`, and you run a search for `Size` on a reference from an object of `Class1`, any references to `Size` from `Class2` appear as disconfirmed.
111
+
-**Disconfirmed results**: This filter is off by default because it shows symbols whose name matches but aren't actual references to the symbol you're searching for. For example, if you have two classes that each define a member function called `Size`, and you run a search for `Size` on a reference from an object of `Class1`, any references to `Size` from `Class2` appear as disconfirmed.
112
112
113
-
-**Unprocessed Results**: **Find All References** operations can take time to complete on larger codebases, so the Results list shows "unprocessed" results here. Unprocessed results match the name of the symbol being searched for but have not yet been confirmed as actual code references. You can turn on this filter to get faster results. Just be aware that some results might not be actual references.
113
+
-**Unprocessed results**: **Find All References** operations can take time to complete on larger codebases, so the Results list shows "unprocessed" results here. Unprocessed results match the name of the symbol being searched for but haven't yet been confirmed as actual code references. You can turn on this filter to get faster results. Just be aware that some results might not be actual references.
114
114
115
115
#### Sort results
116
116
117
-
You can sort results by any column by clicking on that column. You can swap between ascending/descending order by clicking the column again.
117
+
You can sort results by any column by selecting that column. You can swap between ascending or descending order by selecting the column again.
118
118
119
119
## Navigation Bar
120
120
121
-
You can navigate to the definition of a type in a file, or to type members, by using the **Navigation Bar** that is above the editor window.
121
+
You can navigate to the definition of a type in a file, or to type members, by using the **Navigation Bar** that's above the editor window.
0 commit comments