1
0
mirror of https://github.com/golang/go synced 2024-11-19 01:24:39 -07:00
go/internal/lsp/testdata/bar/bar.go.in
Rebecca Stambler b5f2cae84d internal/lsp: fix a bug stopped package names from being printed
Also, trigger signature help on completion of a function (the "(" as a
trigger character doesn't work if it's part of a completion).

Change-Id: I952cb875fa72a741d7952178f85e20f9efa3ebff
Reviewed-on: https://go-review.googlesource.com/c/150638
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2018-11-20 23:48:46 +00:00

46 lines
1.1 KiB
Go

// +build go1.11
package bar
import (
"golang.org/x/tools/internal/lsp/foo" //@item(foo, "foo", "\"golang.org/x/tools/internal/lsp/foo\"", "package")
)
func helper(i foo.IntFoo) {} //@item(helper, "helper(i foo.IntFoo)", "", "func")
func _() {
help //@complete("l", helper)
_ = foo.StructFoo{} //@complete("S", Foo, IntFoo, StructFoo)
}
func Bar() { //@item(Bar, "Bar()", "", "func")
foo.Foo() //@complete("F", Foo, IntFoo, StructFoo)
var _ foo.IntFoo //@complete("I", Foo, IntFoo, StructFoo)
foo.() //@complete("(", Foo, IntFoo, StructFoo)
}
func _() {
var Valentine int //@item(Valentine, "Valentine", "int", "var")
_ = foo.StructFoo{
Val //@complete("l", Value)
}
_ = foo.StructFoo{
Va //@complete("a", Value)
}
_ = foo.StructFoo{
Value: 5, //@complete("a", Value)
}
_ = foo.StructFoo{
//@complete("", Value)
}
_ = foo.StructFoo{
Value: Valen //@complete("le", Valentine)
}
_ = foo.StructFoo{
Value: //@complete(re"$", Valentine, foo, Bar, helper)
}
_ = foo.StructFoo{
Value: //@complete(" ", Valentine, foo, Bar, helper)
}
}