2019-05-10 08:32:25 -06:00
|
|
|
package foo //@mark(PackageFoo, "foo")
|
2018-11-07 13:21:31 -07:00
|
|
|
|
2018-11-14 17:25:49 -07:00
|
|
|
type StructFoo struct { //@item(StructFoo, "StructFoo", "struct{...}", "struct")
|
|
|
|
Value int //@item(Value, "Value", "int", "field")
|
2018-11-07 13:21:31 -07:00
|
|
|
}
|
|
|
|
|
2019-01-15 15:04:34 -07:00
|
|
|
// Pre-set this marker, as we don't have a "source" for it in this package.
|
2018-11-14 17:25:49 -07:00
|
|
|
/* Error() */ //@item(Error, "Error()", "string", "method")
|
2018-11-07 13:21:31 -07:00
|
|
|
|
2018-11-14 17:25:49 -07:00
|
|
|
func Foo() { //@item(Foo, "Foo()", "", "func")
|
2018-11-07 13:21:31 -07:00
|
|
|
var err error
|
|
|
|
err.Error() //@complete("E", Error)
|
|
|
|
}
|
|
|
|
|
|
|
|
func _() {
|
2019-06-07 08:04:22 -06:00
|
|
|
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)
|
2018-11-07 13:21:31 -07:00
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-25 15:19:24 -06:00
|
|
|
func _() {
|
|
|
|
shadowed := 123
|
|
|
|
{
|
2019-06-07 08:04:22 -06:00
|
|
|
shadowed := "hi" //@item(shadowed, "shadowed", "string", "var"),refs("shadowed", shadowed)
|
2019-04-25 15:19:24 -06:00
|
|
|
sha //@complete("a", shadowed)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-19 06:54:24 -07:00
|
|
|
type IntFoo int //@item(IntFoo, "IntFoo", "int", "type"),complete("", Foo, IntFoo, StructFoo)
|