1
0
mirror of https://github.com/golang/go synced 2024-11-18 23:44:43 -07:00
go/internal/lsp/testdata/func_rank/func_rank.go.in
Andzej Maciusovic 7414d4c1f7 internal/lsp: rank types higher when completing in return of a function
Completion now ranks type names higher for func receiver, type params and type results (e.g. func (<>) foo(<>) (<>) {}).

Fixes golang/go#29152

Change-Id: Icdd18b1b344c1cd617a4f45a7b071e53c1345478
GitHub-Last-Rev: e6acb1f2d2a7e571ffcecc500e407fdefd118fed
GitHub-Pull-Request: golang/tools#73
Reviewed-on: https://go-review.googlesource.com/c/159797
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-02-02 23:51:57 +00:00

13 lines
500 B
Go

package func_rank
var stringAVar = "var" //@item(stringAVar, "stringAVar", "string", "var")
func stringBFunc() string { return "str" } //@item(stringBFunc, "stringBFunc()", "string", "func")
type stringer struct{} //@item(stringer, "stringer", "struct{...}", "struct")
func _() stringer //@complete("tr", stringer, stringAVar, stringBFunc)
func _(val stringer) {} //@complete("tr", stringer, stringAVar, stringBFunc)
func (stringer) _() {} //@complete("tr", stringer, stringAVar, stringBFunc)