-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gopls/internal/codeaction: replace all occurrences of expression (ref…
…actor.extract.variable.all) This change introduces a new refactoring code action "Extract n occurrences of expression". The original "Extract Variable" is treated as a limited version of "Extract n occurrences of expression", they share the same underlying implementation. The difference is that "extract_all" utilizes a slice of structural equal expression by searching through the entire function body, while the limited version simply append the expression under selection to that slice. Also: - change default variable name from "x" to "newVar", default const name from "k" to "newConst", users will almost always perform a rename after extraction, so this change make it more discoverable, especially when there are multiple matches. - add marker test extract_expressions.txt and extract_expressions_resolve.txt. Updates golang/go#70085 Fixes golang/go#70563 Change-Id: I767b82be8a60d39c7aff087197c65d435b138826 GitHub-Last-Rev: b66a18d GitHub-Pull-Request: #539 Reviewed-on: https://go-review.googlesource.com/c/tools/+/624035 Reviewed-by: Alan Donovan <[email protected]> Reviewed-by: Robert Findley <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
- Loading branch information
Showing
21 changed files
with
1,068 additions
and
209 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.