2018-12-14 13:46:12 -07:00
|
|
|
package a
|
|
|
|
|
2019-04-02 10:06:03 -06:00
|
|
|
import "fmt"
|
|
|
|
|
2018-12-14 13:46:12 -07:00
|
|
|
type Thing struct { //@Thing
|
|
|
|
Member string //@Member
|
|
|
|
}
|
|
|
|
|
|
|
|
var Other Thing //@Other
|
|
|
|
|
|
|
|
func Things(val []string) []Thing { //@Things
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t Thing) Method(i int) string { //@Method
|
|
|
|
return t.Member
|
|
|
|
}
|
|
|
|
|
|
|
|
func useThings() {
|
|
|
|
t := Thing{} //@mark(aStructType, "ing")
|
|
|
|
fmt.Print(t.Member) //@mark(aMember, "ember")
|
|
|
|
fmt.Print(Other) //@mark(aVar, "ther")
|
|
|
|
Things() //@mark(aFunc, "ings")
|
|
|
|
t.Method() //@mark(aMethod, "eth")
|
|
|
|
}
|
|
|
|
|
|
|
|
/*@
|
2019-02-19 19:11:15 -07:00
|
|
|
definition(aStructType, "", Thing, "$file:$line:$col-$ecol: defined here as type Thing struct{Member string}")
|
2018-12-14 13:46:12 -07:00
|
|
|
definition(aStructType, "-emulate=guru", Thing, "$file:$line:$col: defined here as type Thing")
|
|
|
|
|
2019-02-19 19:11:15 -07:00
|
|
|
definition(aMember, "", Member, "$file:$line:$col-$ecol: defined here as field Member string")
|
2018-12-14 13:46:12 -07:00
|
|
|
definition(aMember, "-emulate=guru", Member, "$file:$line:$col: defined here as field Member string")
|
|
|
|
|
2019-02-19 19:11:15 -07:00
|
|
|
definition(aVar, "", Other, "$file:$line:$col-$ecol: defined here as var Other Thing")
|
2018-12-14 13:46:12 -07:00
|
|
|
definition(aVar, "-emulate=guru", Other, "$file:$line:$col: defined here as var Other")
|
|
|
|
|
2019-02-19 19:11:15 -07:00
|
|
|
definition(aFunc, "", Things, "$file:$line:$col-$ecol: defined here as func Things(val []string) []Thing")
|
2019-04-02 10:06:03 -06:00
|
|
|
definition(aFunc, "-emulate=guru", Things, "$file:$line:$col: defined here as func Things")
|
2018-12-14 13:46:12 -07:00
|
|
|
|
2019-02-19 19:11:15 -07:00
|
|
|
definition(aMethod, "", Method, "$file:$line:$col-$ecol: defined here as func (Thing).Method(i int) string")
|
2018-12-14 13:46:12 -07:00
|
|
|
definition(aMethod, "-emulate=guru", Method, "$file:$line:$col: defined here as func (Thing).Method(i int) string")
|
|
|
|
|
|
|
|
//param
|
|
|
|
//package name
|
|
|
|
//const
|
|
|
|
//anon field
|
|
|
|
|
|
|
|
// JSON tests
|
|
|
|
|
|
|
|
definition(aStructType, "-json", Thing, `{
|
2019-02-19 19:11:15 -07:00
|
|
|
"span": {
|
|
|
|
"uri": "$euri",
|
2018-12-14 13:46:12 -07:00
|
|
|
"start": {
|
|
|
|
"line": $line,
|
|
|
|
"column": $col,
|
|
|
|
"offset": $offset
|
|
|
|
},
|
|
|
|
"end": {
|
|
|
|
"line": $eline,
|
|
|
|
"column": $ecol,
|
|
|
|
"offset": $eoffset
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"description": "type Thing struct{Member string}"
|
|
|
|
}`)
|
|
|
|
definition(aStructType, "-json -emulate=guru", Thing, `{
|
|
|
|
"objpos": "$efile:$line:$col",
|
2019-04-02 10:06:03 -06:00
|
|
|
"desc": "type Thing$$"
|
2018-12-14 13:46:12 -07:00
|
|
|
}`)
|
|
|
|
*/
|