mirror of
https://github.com/golang/go
synced 2024-11-19 02:24:41 -07:00
1e8e1cfdf9
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>
10 lines
251 B
Go
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)
|
|
} |