1
0
mirror of https://github.com/golang/go synced 2024-11-06 19:36:30 -07:00
go/internal/lsp/testdata/foo/foo.go
Rebecca Stambler 719fbf7c21 internal/lsp: move function signature into detail instead of label
Fixes golang/go#32414

Change-Id: If08e655d7a0e29b0865c13d8377e98be01cf24c5
Reviewed-on: https://go-review.googlesource.com/c/tools/+/184777
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-07-03 21:07:46 +00:00

31 lines
923 B
Go

package foo //@mark(PackageFoo, "foo")
type StructFoo struct { //@item(StructFoo, "StructFoo", "struct{...}", "struct")
Value int //@item(Value, "Value", "int", "field")
}
// Pre-set this marker, as we don't have a "source" for it in this package.
/* Error() */ //@item(Error, "Error", "func() string", "method")
func Foo() { //@item(Foo, "Foo", "func()", "func")
var err error
err.Error() //@complete("E", Error)
}
func _() {
var sFoo StructFoo //@mark(sFoo1, "sFoo"),complete("t", StructFoo)
if x := sFoo; x.Value == 1 { //@mark(sFoo2, "sFoo"),complete("V", Value),typdef("sFoo", StructFoo),refs("sFo", sFoo1, sFoo2)
return
}
}
func _() {
shadowed := 123
{
shadowed := "hi" //@item(shadowed, "shadowed", "string", "var"),refs("shadowed", shadowed)
sha //@complete("a", shadowed)
}
}
type IntFoo int //@item(IntFoo, "IntFoo", "int", "type"),complete("", Foo, IntFoo, StructFoo)