Skip to content

Commit 816e6b9

Browse files
authored
Update refactoring-python-code.md
Removing "Extract Method" as it is deprecated
1 parent cf88eb2 commit 816e6b9

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
@@ -44,29 +44,6 @@ Visual Studio provides several commands for automatically transforming and clean
4444
:::image type="content" source="media/vs-2022/code-refactor-rename-1.png" alt-text="Screenshot of Rename prompt for new identifer name.":::
4545
::: moniker-end
4646

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

7249
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)