Pagsasanay
Learning path
Use Visual Studio for modern development - Training
Want to learn more about using Visual Studio to develop and test apps, but don't know where to start? Start here!
Hindi na suportado ang browser na ito.
Mag-upgrade sa Microsoft Edge para samantalahin ang mga pinakabagong tampok, update sa seguridad, at teknikal na suporta.
Visual Studio provides a suite of tools that you can use to navigate around your codebase quickly and efficiently.
Right-click an #include
directive, and select Go To Document. Or, select F12 with the cursor over that line to open the file.
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.
You can navigate to the definition of a code element with a right-click 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.
Go To refers to a set of navigation features that each provide a specific result based on filters you specify.
You can open Go To with Ctrl+,. This action creates a search box over the document you're editing.
Go To includes these search filters:
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.
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:
The following example shows results from a Go To Files operation by using the "f" filter:
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.
You can run a text search for anything in your solution with Find (Ctrl+F) or Find in Files (Ctrl+Shift+F).
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 file types, and more.
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.
For more information, see Find in Files in the Visual Studio documentation.
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.
You can group results by the following categories:
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.
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
.
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.
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. Some results might not be actual references.
You can sort results by any column by selecting that column. You can swap between ascending or descending order by selecting the column again.
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.
Pagsasanay
Learning path
Use Visual Studio for modern development - Training
Want to learn more about using Visual Studio to develop and test apps, but don't know where to start? Start here!
Dokumentasyon
Create Declaration / Definition
Learn more about: Create Declaration / Definition
Set your C++ coding preferences in Visual Studio
Learn more about: Set your C++ coding preferences in Visual Studio
Edit and refactor C++ code in Visual Studio
Use the C++ code editor in Visual Studio to format, navigate, understand and refactor your code.