1
0
mirror of https://github.com/golang/go synced 2024-10-01 03:18:33 -06:00
go/internal/lsp/testdata/badstmt/badstmt.go
Rebecca Stambler 1e8e1cfdf9 internal/lsp: handle completion after defer, go statements
This change adds support for completion of incomplete selectors after a
defer or go statement. We modify the AST before type-checking it with a
fake *ast.CallExpr.

Updates golang/go#29313

Change-Id: Ic9e8c9c49aa569cd7874791692c70a28c3146251
Reviewed-on: https://go-review.googlesource.com/c/tools/+/172974
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-04-24 22:01:01 +00:00

10 lines
251 B
Go

package badstmt
import (
"golang.org/x/tools/internal/lsp/foo"
)
func _() {
defer foo.F //@complete("F", Foo, IntFoo, StructFoo),diag(" //", "LSP", "function must be invoked in defer statement")
go foo.F //@complete("F", Foo, IntFoo, StructFoo)
}