Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gopls/doc/features/transformation.md
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ newly created declaration that contains the selected code:
![Before extracting a var](../assets/extract-var-before.png)
![After extracting a var](../assets/extract-var-after.png)

- **`refactor.extract.constant** does the same thing for a constant
- **`refactor.extract.constant`** does the same thing for a constant
expression, introducing a local const declaration.
- **`refactor.extract.variable-all`** replaces all occurrences of the selected expression
within the function with a reference to a new local variable named `newVar`.
Expand All @@ -419,7 +419,7 @@ This extracts the expression once and reuses it wherever it appears in the funct
![Before extracting all occurrences of EXPR](../assets/extract-var-all-before.png)
![After extracting all occurrences of EXPR](../assets/extract-var-all-after.png)

- **`refactor.extract.constant-all** does the same thing for a constant
- **`refactor.extract.constant-all`** does the same thing for a constant
expression, introducing a local const declaration.
If the default name for the new declaration is already in use, gopls
generates a fresh name.
Expand Down