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
Copy file name to clipboardExpand all lines: docs/ide/finding-references.md
+11-8Lines changed: 11 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Finding references in your code
3
3
description: Explore the Find All References command in Visual Studio to find references to particular code elements in your code, including by reference type.
4
-
ms.date: 02/15/2023
4
+
ms.date: 04/10/2024
5
5
ms.topic: conceptual
6
6
helpviewer_keywords:
7
7
- code editor, find all references
@@ -13,30 +13,29 @@ ms.subservice: general-ide
13
13
---
14
14
# Find references in your code
15
15
16
-
You can use the **Find All References** command to find where particular code elements are referenced throughout your codebase. The **Find All References** command is available on the context (right-click) menu of the element you want to find references to. Or, if you're a keyboard user, press **Shift + F12**.
16
+
You can use the **Find All References** command to find where particular code elements are referenced throughout your codebase. The **Find All References** command is available on the context (right-click) menu of the element you want to find references to. Or, press **Alt + F2**.
17
17
18
18
The results appear in a tool window named **\<element> references**, where *element* is the name of the item you're searching for. A toolbar in the **references** window enables you to do the following:
19
19
20
-
- Change the scope of the search in a drop-down list box. You can choose to look only in changed documents all the way up to the entire solution.
21
-
- Copy the selected referenced item by choosing the **Copy** button.
22
-
- Choose buttons to go to the next or previous location in the list, or press the **F8** and **Shift + F8** keys to do so.
20
+
- Change the scope of the search in a drop-down list box. You can choose to look only in open or changed documents, all the way up to the entire solution.
21
+
- Copy the selected referenced item(s) by choosing the **Copy** button. All the values in all the columns for all selected rows are copied to the clipboard, preceded by the column headings. This makes it easy to paste into a spreadsheet.
22
+
- Choose buttons to go to the next or previous location in the list, or press the up and down arrow keys to do so.
23
23
- Remove any filters on the returned results by choosing the **Clear All Filters** button.
24
24
- Change how returned items are grouped by choosing a setting in the **Group by:** drop-down list box.
25
25
- Keep the current search results window by choosing the **Keep Results** button. When you choose this button, the current search results stay in this window, and new search results appear in a new tool window.
26
26
- Search for strings within the search results by entering text in the **Search Find All References** text box.
27
27
28
-
You can also hover the mouse over any search result to see a preview of the reference.
28
+
You can also hover the mouse over any search result to see the reference in the context of the surrounding code.
29
29
30
30

31
31
32
32
## Navigate to references
33
33
34
34
You can use the following methods to navigate to references in the **references** window:
35
35
36
-
- Press **F8** to go to the next reference, or **Shift + F8** to go to the previous reference.
37
36
- Press the **Enter** key on a reference, or double-click it, to go to it in code.
38
37
- On the right-click menu (context menu) of a reference, choose the **Go To Previous Location** or **Go To Next Location** commands.
39
-
-Choose the **Up Arrow** and **Down Arrow** keys (if they're enabled in the **Options** dialog box). To enable this functionality, on the menu bar, choose **Tools** > **Options** > **Environment** > **Tabs and Windows**, and then in the **Preview Tab** section, select the **Allow new files to be opened in the preview tab** and **Preview selected files in Find Results** boxes.
38
+
-Use the **Up Arrow** and **Down Arrow** keys.
40
39
41
40
## Change reference groupings
42
41
@@ -52,6 +51,10 @@ In C# or Visual Basic, the **Find References** window has a **Kind** column wher
52
51
53
52
After you apply a filter or a filter set, you can easily remove it by using the **Clear All Filters** button.
54
53
54
+
## Customize the experience
55
+
56
+
To customize the experience, on the menu bar, choose **Tools** > **Options** > **Environment** > **Tabs and Windows**, and then in the **Preview Tab** section, if you select the **Allow new files to be opened in the preview tab** checkbox, you can select or unselect the **Preview selected files in Find Results** checkbox. When selected, the file is opened in the editor at the place where the reference occurs. When unset, the file is only opened if you explicitly press **Enter** or double-click on the row.
0 commit comments