1 package comment_completion
29 // //@complete(" ", variableC)
30 var C string //@item(variableC, "C", "string", "var") //@complete(" ", variableC)
32 // //@complete(" ", constant)
33 const Constant = "example" //@item(constant, "Constant", "string", "const") //@complete(" ", constant)
35 // //@complete(" ", structType, fieldB, fieldA)
36 type StructType struct { //@item(structType, "StructType", "struct{...}", "struct") //@complete(" ", structType, fieldA, fieldB)
37 // //@complete(" ", fieldA, structType, fieldB)
38 A string //@item(fieldA, "A", "string", "field") //@complete(" ", fieldA, structType, fieldB)
39 b int //@item(fieldB, "b", "int", "field") //@complete(" ", fieldB, structType, fieldA)
42 // //@complete(" ", method, structRecv, paramX, resultY, fieldB, fieldA)
43 func (structType *StructType) Method(X int) (Y int) { //@item(structRecv, "structType", "*StructType", "var"),item(method, "Method", "func(X int) (Y int)", "method"),item(paramX, "X", "int", "var"),item(resultY, "Y", "int", "var")
44 // //@complete(" ", method, structRecv, paramX, resultY, fieldB, fieldA)
48 // //@complete(" ", newType)
49 type NewType string //@item(newType, "NewType", "string", "type") //@complete(" ", newType)
51 // //@complete(" ", testInterface, testA, testB)
52 type TestInterface interface { //@item(testInterface, "TestInterface", "interface{...}", "interface")
53 // //@complete(" ", testA, testInterface, testB)
54 TestA(L string) (M int) //@item(testA, "TestA", "func(L string) (M int)", "method"),item(paramL, "L", "var", "string"),item(resM, "M", "var", "int") //@complete(" ", testA, testInterface, testB)
55 TestB(N int) bool //@item(testB, "TestB", "func(N int) bool", "method"),item(paramN, "N", "var", "int") //@complete(" ", testB, testInterface, testA)
58 // //@complete(" ", function)
59 func Function() int { //@item(function, "Function", "func() int", "func") //@complete(" ", function)
60 // //@complete(" ", function)
64 // This tests multiline block comments and completion with prefix
65 // Lorem Ipsum Multili//@complete("Multi", multiline)
66 // Lorem ipsum dolor sit ametom
67 func Multiline() int { //@item(multiline, "Multiline", "func() int", "func")
68 // //@complete(" ", multiline)