mirror of
https://github.com/golang/go
synced 2024-11-05 11:56:12 -07:00
110bd3ba6b
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> |
||
---|---|---|
.. | ||
code_lens.go | ||
command.go | ||
comment_test.go | ||
comment.go | ||
completion_builtin.go | ||
completion_format.go | ||
completion_keywords.go | ||
completion_labels.go | ||
completion_literal.go | ||
completion_snippet.go | ||
completion_statements.go | ||
completion.go | ||
deep_completion.go | ||
diagnostics.go | ||
extract.go | ||
folding_range.go | ||
format_test.go | ||
format.go | ||
gc_annotations.go | ||
highlight.go | ||
hover.go | ||
identifier_test.go | ||
identifier.go | ||
implementation.go | ||
options.go | ||
references.go | ||
rename_check.go | ||
rename.go | ||
signature_help.go | ||
source_test.go | ||
symbols.go | ||
types_format.go | ||
util.go | ||
view.go | ||
workspace_symbol.go |