Skip to content

Commit a45a55e

Browse files
authored
Merge pull request #10350 from MicrosoftDocs/repo_sync_working_branch
Confirm merge from repo_sync_working_branch to main to sync with https://github.com/MicrosoftDocs/visualstudio-docs (branch main)
2 parents 3cdd91e + 3ab2928 commit a45a55e

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

docs/python/refactoring-python-code.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -43,29 +43,6 @@ Visual Studio provides several commands for automatically transforming and clean
4343
:::image type="content" source="media/vs-2022/code-refactor-rename-1.png" alt-text="Screenshot of Rename prompt for new identifer name.":::
4444
::: moniker-end
4545

46-
## Extract method
47-
48-
::: moniker range="<=vs-2019"
49-
50-
1. Select the lines of code or the expression to extract into a separate method.
51-
1. Select the **Edit** > **Refactor** > **Extract method** menu command or press **Ctrl**+**R** > **M**.
52-
1. In the dialog that appears, enter a new method name, indicate where to extract it to, and select any closure variables. Variables not selected for closure are turned into method arguments:
53-
:::image type="content" source="media/code-refactor-extract-method-1.png" alt-text="Screenshot of Extract method dialog.":::
54-
55-
1. Select **OK**, and the code is modified.
56-
:::image type="content" source="media/code-refactor-extract-method-2.png" alt-text="Screenshot showing the effect of extracting a method.":::
57-
::: moniker-end
58-
::: moniker range=">=vs-2022"
59-
60-
1. Select the lines of code or the expression to extract into a separate method.
61-
1. When you place the caret on code sample, Visual Studio provides a smart tag (the wrench icon to the left of the code).
62-
1. In the dialog that appears, select **Extract** for closure to be turned into method arguments:
63-
:::image type="content" source="media/vs-2022/code-refactor-extract-method-1.png" alt-text="Screenshot of Extract method dialog.":::
64-
65-
1. Select **OK** and the code is modified.
66-
:::image type="content" source="media/vs-2022/code-refactor-extract-method-2.png" alt-text="Screenshot of Effects of extracting a method.":::
67-
::: moniker-end
68-
6946
## Add import
7047

7148
When you place the caret on an identifier that lacks type information, Visual Studio provides a smart tag (the light bulb icon to the left of the code) whose commands add the necessary `import` or `from ... import` statement.

0 commit comments

Comments
 (0)