1
0
mirror of https://github.com/golang/go synced 2024-11-18 21:24:44 -07:00
go/internal/lsp/testdata/rank/assign_rank.go.in
Rebecca Stambler 6e267b5cc7 internal/lsp: add additional tests for completion
New tests include cases for anonymous structs, composite literals,
ranking of results in binary expressions, and import cycles.

Change-Id: Ic02e84e09101bb9873fc1705bba2594d655bb45b
Reviewed-on: https://go-review.googlesource.com/c/153443
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2018-12-19 22:27:14 +00:00

20 lines
540 B
Go

package rank
var (
apple int = 3 //@item(apple, "apple", "int", "var")
pear string = "hello" //@item(pear, "pear", "string", "var")
)
func _() {
orange := 1 //@item(orange, "orange", "int", "var")
grape := "hello" //@item(grape, "grape", "string", "var")
orange, grape = 2, "hello" //@complete(" \"", grape, pear, orange, apple)
}
func _() {
var pineapple int //@item(pineapple, "pineapple", "int", "var")
pineapple = //@complete(" /", pineapple, apple, pear)
y := //@complete(" /", pineapple, apple, pear)
}