1
0
mirror of https://github.com/golang/go synced 2024-10-01 01:38:33 -06:00
go/internal/lsp/testdata/badstmt
Muir Manders 3cd124fa3e 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>
2019-09-10 16:55:22 +00:00
..
badstmt_2.go.in internal/lsp: improve completions in go and defer statements 2019-09-09 19:09:43 +00:00
badstmt_3.go.in internal/lsp: improve completions in go and defer statements 2019-09-09 19:09:43 +00:00
badstmt_4.go.in internal/lsp: fix completion for nested *ast.BadStmt 2019-09-10 16:55:22 +00:00
badstmt.go.in internal/lsp: improve completions in go and defer statements 2019-09-09 19:09:43 +00:00