| 1 |
This test checks completion of map keys and values. |
| 2 |
|
| 3 |
-- flags -- |
| 4 |
-ignore_extra_diags |
| 5 |
|
| 6 |
-- settings.json -- |
| 7 |
{ |
| 8 |
"completeUnimported": false |
| 9 |
} |
| 10 |
|
| 11 |
-- maps.go -- |
| 12 |
package maps |
| 13 |
|
| 14 |
func _() { |
| 15 |
var aVar int //@item(mapVar, "aVar", "int", "var") |
| 16 |
|
| 17 |
// not comparabale |
| 18 |
type aSlice []int //@item(mapSliceType, "aSlice", "[]int", "type") |
| 19 |
|
| 20 |
*aSlice //@item(mapSliceTypePtr, "*aSlice", "[]int", "type") |
| 21 |
|
| 22 |
// comparable |
| 23 |
type aStruct struct{} //@item(mapStructType, "aStruct", "struct{...}", "struct") |
| 24 |
|
| 25 |
map[]a{} //@complete(re"()\\]", mapSliceType, mapStructType),snippet(re"()]", mapSliceType, "*aSlice") |
| 26 |
|
| 27 |
map[a]a{} //@complete(re"()\\]", mapSliceType, mapStructType) |
| 28 |
map[a]a{} //@complete(re"(){", mapSliceType, mapStructType) |
| 29 |
} |