1
0
mirror of https://github.com/golang/go synced 2024-09-30 20:28:32 -06:00
go/internal/lsp/testdata
Josh Baum 110bd3ba6b internal/lsp: make function extraction smarter
In the previous implementation, the extracted function would
sometimes include superfluous parameters and return values. It
might also  unnecessarily initialize variables. This CL introduces
3 rules to limit this behavior. (1) a variable is not passed as a
parameter to the extracted function if its first use within the
function is its own redefinition. (2) a variable is not returned
from the extracted function if its first use after the function is its
own redefinition. (3) when possible, we redefine variables in the call
expression to the extracted function.

Change-Id: Ideb5a7eff8a1bf462c83271a2f043116ff5d8b76
Reviewed-on: https://go-review.googlesource.com/c/tools/+/244770
Run-TryBot: Josh Baum <joshbaum@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2020-08-06 19:37:29 +00:00
..
lsp internal/lsp: make function extraction smarter 2020-08-06 19:37:29 +00:00
missingdep internal/lsp: fix go.mod.golden test file to have sorted mod names 2020-07-30 22:19:56 +00:00
missingtwodep internal/lsp: support extract function 2020-07-20 18:55:41 +00:00
unused internal/lsp: support extract function 2020-07-20 18:55:41 +00:00
upgradedep internal/lsp: support extract function 2020-07-20 18:55:41 +00:00