Debian Codegraph @

gopls/internal/test/marker/testdata/completion/index.txt

raw
1 This test checks completion related to index expressions.
2
3 -- flags --
4 -ignore_extra_diags
5
6 -- settings.json --
7 {
8 "completeUnimported": false
9 }
10
11 -- index.go --
12 package index
13
14 func _() {
15 var (
16 aa = "123" //@item(indexAA, "aa", "string", "var")
17 ab = 123 //@item(indexAB, "ab", "int", "var")
18 )
19
20 var foo [1]int
21 foo[a] //@complete(re"()\\]", indexAB, indexAA)
22 foo[:a] //@complete(re"()\\]", indexAB, indexAA)
23 a[:a] //@complete(re"()\\[", indexAA, indexAB)
24 a[a] //@complete(re"()\\[", indexAA, indexAB)
25
26 var bar map[string]int
27 bar[a] //@complete(re"()\\]", indexAA, indexAB)
28
29 type myMap map[string]int
30 var baz myMap
31 baz[a] //@complete(re"()\\]", indexAA, indexAB)
32
33 type myInt int
34 var mi myInt //@item(indexMyInt, "mi", "myInt", "var")
35 foo[m] //@snippet(re"()\\]", indexMyInt, "mi")
36 }