commit | 110bd3ba6bd29331b82199e91b95cc39738d6a74 | [log] [tgz] |
---|---|---|
author | Josh Baum <joshbaum@google.com> | Fri Jul 24 16:27:51 2020 -0400 |
committer | Josh Baum <joshbaum@google.com> | Thu Aug 06 19:37:29 2020 +0000 |
tree | 3aeb7981f0229a670eb6d8ee8824956f01ae6fed | |
parent | ee49e490f2e5ab5b4d84b0707a810bec7b25c65f [diff] |
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>
This subrepository holds the source for various packages and tools that support the Go programming language.
Some of the tools, godoc
and vet
for example, are included in binary Go distributions.
Others, including the Go guru
and the test coverage tool, can be fetched with go get
.
Packages include a type-checker for Go and an implementation of the Static Single Assignment form (SSA) representation for Go programs.
The easiest way to install is to run go get -u golang.org/x/tools/...
. You can also manually git clone the repository to $GOPATH/src/golang.org/x/tools
.
This repository uses prettier to format JS and CSS files.
The version of prettier
used is 1.18.2.
It is encouraged that all JS and CSS code be run through this before submitting a change. However, it is not a strict requirement enforced by CI.
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.
The main issue tracker for the tools repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/tools/(your subdir):” in the subject line, so it is easy to find.