2018-12-10 22:52:31 -07:00
|
|
|
package complit
|
|
|
|
|
|
|
|
type position struct { //@item(structPosition, "position", "struct{...}", "struct")
|
|
|
|
X, Y int //@item(fieldX, "X", "int", "field"),item(fieldY, "Y", "int", "field")
|
|
|
|
}
|
|
|
|
|
|
|
|
func _() {
|
2019-04-23 16:00:40 -06:00
|
|
|
_ = position{
|
2018-12-10 22:52:31 -07:00
|
|
|
//@complete("", fieldX, fieldY, structPosition)
|
|
|
|
}
|
2019-04-23 16:00:40 -06:00
|
|
|
_ = position{
|
2018-12-10 22:52:31 -07:00
|
|
|
X: 1,
|
|
|
|
//@complete("", fieldY)
|
|
|
|
}
|
2019-04-23 16:00:40 -06:00
|
|
|
_ = position{
|
2018-12-10 22:52:31 -07:00
|
|
|
//@complete("", fieldX)
|
|
|
|
Y: 1,
|
|
|
|
}
|
2019-08-28 21:53:48 -06:00
|
|
|
_ = []*position{
|
|
|
|
{
|
|
|
|
//@complete("", fieldX, fieldY, structPosition)
|
|
|
|
},
|
|
|
|
}
|
2018-12-10 22:52:31 -07:00
|
|
|
}
|
|
|
|
|
2019-04-23 16:00:40 -06:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
|
2019-05-13 15:37:08 -06:00
|
|
|
_ = []string{a: ""} //@complete(":", abVar, aaVar)
|
|
|
|
_ = [1]string{a: ""} //@complete(":", abVar, aaVar)
|
|
|
|
|
|
|
|
_ = position{X: a} //@complete("}", abVar, aaVar)
|
|
|
|
_ = position{a} //@complete("}", abVar, aaVar)
|
|
|
|
_ = position{a, } //@complete("}", abVar, aaVar, structPosition)
|
2019-04-23 16:00:40 -06:00
|
|
|
|
|
|
|
_ = []int{a} //@complete("a", abVar, aaVar, structPosition)
|
|
|
|
_ = [1]int{a} //@complete("a", abVar, aaVar, structPosition)
|
|
|
|
|
2019-05-13 15:37:08 -06:00
|
|
|
type myStruct struct {
|
2019-04-23 16:00:40 -06:00
|
|
|
AA int //@item(fieldAA, "AA", "int", "field")
|
|
|
|
AB string //@item(fieldAB, "AB", "string", "field")
|
|
|
|
}
|
2019-05-13 15:37:08 -06:00
|
|
|
|
|
|
|
_ = myStruct{
|
|
|
|
AB: a, //@complete(",", aaVar, abVar)
|
|
|
|
}
|
|
|
|
|
|
|
|
var s myStruct
|
|
|
|
|
|
|
|
_ = map[int]string{1: "" + s.A} //@complete("}", fieldAB, fieldAA)
|
2019-04-23 16:00:40 -06:00
|
|
|
_ = map[int]string{1: (func(i int) string { return "" })(s.A)} //@complete(")}", fieldAA, fieldAB)
|
2019-05-13 15:37:08 -06:00
|
|
|
_ = map[int]string{1: func() string { s.A }} //@complete(" }", fieldAA, fieldAB)
|
|
|
|
|
|
|
|
_ = position{s.A} //@complete("}", fieldAA, fieldAB)
|
|
|
|
|
|
|
|
var X int //@item(varX, "X", "int", "var")
|
|
|
|
_ = position{X} //@complete("}", fieldX, varX)
|
2019-04-23 16:00:40 -06:00
|
|
|
}
|
|
|
|
|
2018-12-10 22:52:31 -07:00
|
|
|
func _() {
|
|
|
|
_ := position{
|
|
|
|
X: 1, //@complete("X", fieldX),complete(" 1", structPosition)
|
|
|
|
Y: , //@complete(":", fieldY),complete(" ,", structPosition)
|
|
|
|
}
|
|
|
|
}
|