1
0
mirror of https://github.com/golang/go synced 2024-10-01 12:48:33 -06:00
go/internal/lsp/testdata/maps/maps.go.in
Muir Manders 5228f4b59c internal/lsp: improve completions in *ast.MapType
We now expect a type name when in the key or value of a *ast.MapType.
I also added an extra filter to expect a comparable type for the key.

Change-Id: I647cf4d791b2c0960ad3b12702b91b9bc168599b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/197439
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-24 19:03:17 +00:00

19 lines
518 B
Go

package maps
func _() {
var aVar int //@item(mapVar, "aVar", "int", "var")
// not comparabale
type aSlice []int //@item(mapSliceType, "aSlice", "[]int", "type")
// comparable
type aStruct struct{} //@item(mapStructType, "aStruct", "struct{...}", "struct")
map[]a{} //@complete("]", mapStructType, mapSliceType, mapVar)
map[a]a{} //@complete("]", mapStructType, mapSliceType, mapVar)
map[a]a{} //@complete("{", mapSliceType, mapStructType, mapVar)
map[]a{} //@rank("]", int, mapSliceType)
}