| 1 |
This test checks completion related to anonymous structs. |
| 2 |
|
| 3 |
-- flags -- |
| 4 |
-ignore_extra_diags |
| 5 |
|
| 6 |
-- settings.json -- |
| 7 |
{ |
| 8 |
"deepCompletion": false |
| 9 |
} |
| 10 |
|
| 11 |
-- anon.go -- |
| 12 |
package anon |
| 13 |
|
| 14 |
// Literal completion results. |
| 15 |
/* int() */ //@item(int, "int()", "int", "var") |
| 16 |
|
| 17 |
func _() { |
| 18 |
for _, _ := range []struct { |
| 19 |
i, j int //@item(anonI, "i", "int", "field"),item(anonJ, "j", "int", "field") |
| 20 |
}{ |
| 21 |
{ |
| 22 |
i: 1, |
| 23 |
//@complete("", anonJ) |
| 24 |
}, |
| 25 |
{ |
| 26 |
//@complete("", anonI, anonJ, int) |
| 27 |
}, |
| 28 |
} { |
| 29 |
continue |
| 30 |
} |
| 31 |
|
| 32 |
s := struct{ f int }{ } //@item(anonF, "f", "int", "field"),item(structS, "s", "struct{...}", "var"),complete(re"() }", anonF, int) |
| 33 |
|
| 34 |
_ = map[struct{ x int }]int{ //@item(anonX, "x", "int", "field") |
| 35 |
struct{ x int }{ }: 1, //@complete(re"() }", anonX, int, structS) |
| 36 |
} |
| 37 |
} |