Skip to content

Commit a9f1d7d

Browse files
Merge pull request #12845 from Mikejo5000/mikejo-br24
Update IDE steps for rename when refactoring
2 parents 7fcce75 + ecbe938 commit a9f1d7d

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

docs/ide/reference/rename.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Refactor rename
3-
description: Learn how to use the Refactor Rename feature to rename identifiers for code symbols, such as fields, local variables, methods, namespaces, properties and types.
3+
description: Learn how to use the Refactor Rename feature to rename identifiers for code symbols, such as fields, local variables, methods, namespaces, properties, and types.
44
ms.date: 05/04/2020
55
ms.topic: reference
66
author: Mikejo5000
@@ -21,11 +21,11 @@ This refactoring applies to:
2121

2222
- Visual Basic
2323

24-
**What:** Lets you rename identifiers for code symbols, such as fields, local variables, methods, namespaces, properties and types.
24+
**What:** Lets you rename identifiers for code symbols, such as fields, local variables, methods, namespaces, properties, and types.
2525

2626
**When:** You want to safely rename something without having to find all instances, and copy/paste the new name.
2727

28-
**Why:** Copy and pasting the new name across an entire project would likely result in errors. This refactoring tool will accurately perform the renaming action.
28+
**Why:** Copy and pasting the new name across an entire project would likely result in errors. This refactoring tool accurately performs the renaming action.
2929

3030
## How-to
3131

@@ -42,7 +42,7 @@ This refactoring applies to:
4242
2. Next, use your keyboard or mouse as follows:
4343

4444
- **Keyboard**
45-
- Press **Ctrl+R**, then **Ctrl+R**. (Note that your keyboard shortcut may be different based on which profile you've selected.)
45+
- Press **Ctrl+R**, then **Ctrl+R**. (Your keyboard shortcut may be different based on which profile you selected.)
4646
- **Mouse**
4747
- Select **Edit > Refactor > Rename**.
4848
- Right-click the code and select **Rename**.
@@ -57,18 +57,25 @@ This refactoring applies to:
5757

5858
![Rename - VB](media/rename-rename-vb.png)
5959

60+
::: moniker range=">= vs-2022"
61+
> [!TIP]
62+
> You can also update comments and other strings to use this new name, as well as [preview the changes](../../ide/preview-changes.md) before saving, using the checkboxes in the **Rename** box that appear when you open the drop-down menu.
63+
::: moniker-end
64+
65+
::: moniker range="vs-2019"
6066
> [!TIP]
6167
> You can also update comments and other strings to use this new name, as well as [preview the changes](../../ide/preview-changes.md) before saving, using the checkboxes in the **Rename** box that appears at the top right of your editor.
68+
::: moniker-end
6269

63-
4. When you're happy with the change, choose the **Apply** button or press **Enter** and the changes will be committed.
70+
4. When you're happy with the change, choose the **Apply** button or press **Enter** and the changes are committed.
6471

6572
## Remarks
6673

67-
- Starting in Visual Studio 2019 version 16.3, when you rename a type that matches the name of the file it's in, a checkbox appears that enables you to rename the file at the same time. This option appears when you rename a class, interface, or enumeration. This option is not supported for partial types with multiple definitions.
74+
- Starting in Visual Studio 2019 version 16.3, when you rename a type that matches the name of the file it's in, a checkbox appears that enables you to rename the file at the same time. This option appears when you rename a class, interface, or enumeration. This option isn't supported for partial types with multiple definitions.
6875

6976
![Rename animation with file - C#](media/rename-with-file-animated-cs.gif)
7077

71-
- If you use a name that already exists which would cause a conflict, the **Rename** box will warn you.
78+
- If you use a name that already exists which would cause a conflict, the **Rename** box warns you.
7279

7380
![Rename Conflict](media/rename-conflict-cs.png)
7481

0 commit comments

Comments
 (0)