mirror of
https://github.com/golang/go
synced 2024-11-19 02:04:42 -07:00
747b8b11d4
This change adds a source.Error type which is used to collect the error information that comes out of the loading, parsing, and type checking stages. We also add specific sources per-error, rather than having them all be labeled as "LSP". This change will enable follow-ups that do a better job of extracting error ranges. Change-Id: I3fbb5e42d66aa2c5bb1b2f41d1eadfc45f3a749b Reviewed-on: https://go-review.googlesource.com/c/tools/+/202298 Run-TryBot: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Cottrell <iancottrell@google.com>
26 lines
464 B
Go
26 lines
464 B
Go
package badstmt
|
|
|
|
import (
|
|
"golang.org/x/tools/internal/lsp/foo"
|
|
)
|
|
|
|
func _() {
|
|
defer foo.F //@complete(" //", Foo),diag(" //", "syntax", "function must be invoked in defer statement")
|
|
y := 1
|
|
defer foo.F //@complete(" //", Foo)
|
|
}
|
|
|
|
func _() {
|
|
switch true {
|
|
case true:
|
|
go foo.F //@complete(" //", Foo)
|
|
}
|
|
}
|
|
|
|
func _() {
|
|
defer func() {
|
|
foo.F //@complete(" //", Foo),snippet(" //", Foo, "Foo()", "Foo()")
|
|
foo. //@complete(" //", Foo, IntFoo, StructFoo)
|
|
}
|
|
}
|