commit | dc31b401abb5f62558fefca1b34c7abab611c3c4 | [log] [tgz] |
---|---|---|
author | Pontus Leitzler <leitzler@gmail.com> | Tue Jun 16 17:33:51 2020 +0200 |
committer | Rebecca Stambler <rstambler@golang.org> | Tue Jun 16 19:50:46 2020 +0000 |
tree | 7a79e7564ea457059e16772c41489b73fdf18b20 | |
parent | e3971a17a80d55a668f5d1700ef9c3ac313da055 [diff] |
internal/lsp/source: avoid panic in rename check In a case where the type info for an ast.CompositeLit isn't found in forEachLexicalRef(...) gopls will panic. e.g. trying to rename "foo" where it is declared in this case: func fn() { var foo bool make(map[string]bool if foo { } } Note the missing ')' after make. This change will skip ast.CompositeLits if the type can't be found, and that fixes the panic. But it also do rename the identifier as long as it is possible, and I'm not convinced that we should allow rename at all if the source can't be compiled. Updates golang/go#39614 Change-Id: Ibb50b15ce4b31056f2f1da52a4dcab7b8b91a320 Reviewed-on: https://go-review.googlesource.com/c/tools/+/238042 Reviewed-by: Rebecca Stambler <rstambler@golang.org> Run-TryBot: 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.