commit | 3cd124fa3ebbb91c857cd65b7c8c50d5ce84fda4 | [log] [tgz] |
---|---|---|
author | Muir Manders <muir@mnd.rs> | Mon Sep 09 09:25:22 2019 -0700 |
committer | Rebecca Stambler <rstambler@golang.org> | Tue Sep 10 16:55:22 2019 +0000 |
tree | 94d62791b67544377056691483ae6049198f6f6a | |
parent | c1ad8a4bd1ba0adac45b88805aa387f496122397 [diff] |
internal/lsp: fix completion for nested *ast.BadStmt Now when trying to fix *ast.BadStmt, we parse the manually extracted expression using parser.ParseFile instead of parser.ParseExpr. ParseFile will yield *ast.BadStmt nodes for any bad statements nested in our first bad statement, allowing us to fix them recursively. To turn our expression into a "valid" file we can pass to parser.ParseFile, I wrapped it thusly: package fake func _() { <our expression> } Change-Id: I0d4fd4ebce6450021da8e03caa11d0ae5152ea8d Reviewed-on: https://go-review.googlesource.com/c/tools/+/194342 Run-TryBot: Rebecca Stambler <rstambler@golang.org> 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 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.