2018-12-10 22:52:31 -07:00
|
|
|
package complit
|
|
|
|
|
2019-12-10 14:40:37 -07:00
|
|
|
// //@complete(" ", cVar)
|
|
|
|
var C string //@item(cVar, "C", "string", "var")
|
|
|
|
|
2018-12-10 22:52:31 -07:00
|
|
|
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{
|
2019-12-10 14:40:37 -07:00
|
|
|
//@complete("", fieldX, fieldY, cVar, structPosition)
|
2018-12-10 22:52:31 -07:00
|
|
|
}
|
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{
|
|
|
|
{
|
2019-12-10 14:40:37 -07:00
|
|
|
//@complete("", fieldX, fieldY, cVar, structPosition)
|
2019-08-28 21:53:48 -06:00
|
|
|
},
|
|
|
|
}
|
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{
|
2019-12-10 14:40:37 -07:00
|
|
|
//@complete("", abVar, aaVar, cVar, structPosition)
|
2019-04-23 16:00:40 -06:00
|
|
|
}
|
|
|
|
|
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)
|
2019-12-10 14:40:37 -07:00
|
|
|
_ = position{a, } //@complete("}", abVar, aaVar, cVar, structPosition)
|
2019-04-23 16:00:40 -06:00
|
|
|
|
2019-12-10 14:40:37 -07:00
|
|
|
_ = []int{a} //@complete("a", abVar, aaVar, cVar, structPosition)
|
|
|
|
_ = [1]int{a} //@complete("a", abVar, aaVar, cVar, structPosition)
|
2019-04-23 16:00:40 -06:00
|
|
|
|
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{
|
2019-12-10 14:40:37 -07:00
|
|
|
X: 1, //@complete("X", fieldX),complete(" 1", cVar, structPosition)
|
|
|
|
Y: , //@complete(":", fieldY),complete(" ,", cVar, structPosition)
|
2018-12-10 22:52:31 -07:00
|
|
|
}
|
|
|
|
}
|