blob: fec5aadd93d8d5f99c9552d8e9f86c5b8b9ff004 [file] [log] [blame]
package complit
type position struct { //@item(structPosition, "position", "struct{...}", "struct")
X, Y int //@item(fieldX, "X", "int", "field"),item(fieldY, "Y", "int", "field")
}
func _() {
_ = position{
//@complete("", fieldX, fieldY, structPosition)
}
_ = position{
X: 1,
//@complete("", fieldY)
}
_ = position{
//@complete("", fieldX)
Y: 1,
}
}
func _() {
var (
aa string //@item(aaVar, "aa", "string", "var")
ab int //@item(abVar, "ab", "int", "var")
)
_ = map[int]int{
a: a, //@complete(":", abVar, aaVar),complete(",", abVar, aaVar)
}
_ = map[int]int{
//@complete("", abVar, aaVar, structPosition)
}
_ = position{X: a} //@complete("}", abVar, aaVar)
_ = position{a} //@complete("}", abVar, aaVar)
_ = []int{a} //@complete("a", abVar, aaVar, structPosition)
_ = [1]int{a} //@complete("a", abVar, aaVar, structPosition)
var s struct {
AA int //@item(fieldAA, "AA", "int", "field")
AB string //@item(fieldAB, "AB", "string", "field")
}
_ = map[int]string{1: "" + s.A} //@complete("}", fieldAB, fieldAA)
_ = map[int]string{1: (func(i int) string { return "" })(s.A)} //@complete(")}", fieldAA, fieldAB)
}
func _() {
_ := position{
X: 1, //@complete("X", fieldX),complete(" 1", structPosition)
Y: , //@complete(":", fieldY),complete(" ,", structPosition)
}
}