mirror of
https://github.com/golang/go
synced 2024-11-18 13:34:41 -07:00
9267083701
The logic for extracting a function is quite signficant, and the code is expensive enough that we should only call it when requested by the user. This means that we should support extracting through a command rather than text edits in the code action. To that end, we create a new struct for commands. Features like extract variable and extract function can supply functions to determine if they are relevant to the given range, and if so, to generate their text edits. source.Analyzers now point to Commands, rather than SuggestedFixFuncs. The "canExtractVariable" and "canExtractFunction" functions still need improvements, but I think that can be done in a follow-up. Change-Id: I9ec894c5abdbb28505a0f84ad7c76aa50977827a Reviewed-on: https://go-review.googlesource.com/c/tools/+/244598 Run-TryBot: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> |
||
---|---|---|
.. | ||
tests_go115.go | ||
tests.go | ||
util.go |