1
0
mirror of https://github.com/golang/go synced 2024-11-19 01:24:39 -07:00
go/internal/lsp/testdata/foo/foo.go

31 lines
794 B
Go
Raw Normal View History

package 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()", "string", "method")
func Foo() { //@item(Foo, "Foo()", "", "func")
var err error
err.Error() //@complete("E", Error)
}
func _() {
var sFoo StructFoo //@complete("t", StructFoo)
if x := sFoo; x.Value == 1 { //@complete("V", Value),typdef("sFoo", StructFoo)
return
}
}
func _() {
shadowed := 123
{
shadowed := "hi" //@item(shadowed, "shadowed", "string", "var")
sha //@complete("a", shadowed)
}
}
type IntFoo int //@item(IntFoo, "IntFoo", "int", "type"),complete("", Foo, IntFoo, StructFoo)