@@ -15,7 +15,7 @@ const snippets = [
15
15
{
16
16
label : 'iferr' ,
17
17
insertText : [ 'if err != nil {' , '\treturn ${1:nil, err}' , '}' ] . join ( '\n' ) ,
18
- documentation : 'Return error if err != nil' ,
18
+ detail : 'Return error if err != nil' ,
19
19
} ,
20
20
{
21
21
label : 'switch' ,
@@ -27,72 +27,67 @@ const snippets = [
27
27
'\t\t// TODO: implement' ,
28
28
'}' ,
29
29
] . join ( '\n' ) ,
30
- documentation : 'Insert switch statement' ,
30
+ detail : 'Insert switch statement' ,
31
31
} ,
32
32
{
33
33
label : 'go' ,
34
34
insertText : [ 'go func(){' , '\t$0' , '}()' ] . join ( '\n' ) ,
35
- documentation : 'Call goroutine' ,
36
- } ,
37
- {
38
- label : 'append' ,
39
- insertText : '$1 = append($1, $0)' ,
40
- documentation : 'Append to slice' ,
35
+ detail : 'Call goroutine' ,
41
36
} ,
42
37
{
43
38
label : 'typestruct' ,
44
39
insertText : [ 'type ${1:name} struct {' , '\t$0' , '}' ] . join ( '\n' ) ,
45
- documentation : 'Declare a struct' ,
40
+ detail : 'Declare a struct' ,
46
41
} ,
47
42
{
48
43
label : 'typeinterface' ,
49
44
insertText : [ 'type ${1:name} interface {' , '\t$0' , '}' ] . join ( '\n' ) ,
50
- documentation : 'Declare a struct' ,
45
+ detail : 'Declare a struct' ,
51
46
} ,
52
47
{
53
48
label : 'fmtprintf' ,
54
49
insertText : 'fmt.Printf("${1:format}", $0)' ,
55
- documentation : 'fmt.Printf() shorthand' ,
50
+ detail : 'fmt.Printf() shorthand' ,
56
51
} ,
57
52
{
58
53
label : 'fmtprintln' ,
59
54
insertText : 'fmt.Println(${0:message})' ,
60
- documentation : 'fmt.Println() shorthand' ,
55
+ detail : 'fmt.Println() shorthand' ,
61
56
} ,
62
57
{
63
58
label : 'returnnil' ,
64
59
insertText : 'return nil' ,
65
- documentation : 'return nil' ,
60
+ detail : 'return nil' ,
66
61
} ,
67
62
{
68
63
label : 'timenow' ,
69
64
insertText : '${0:t} := time.Now()' ,
70
- documentation : 'time.Now() shorthand' ,
65
+ detail : 'time.Now() shorthand' ,
71
66
} ,
72
67
{
73
68
label : 'makeslice' ,
74
69
insertText : '${0:items} := make([]${1:string}, ${2:0}, ${3:0})' ,
75
- documentation : 'Make a new slice' ,
70
+ detail : 'Make a new slice' ,
76
71
} ,
77
72
{
78
73
label : 'slice' ,
79
74
insertText : '${1:items} := []${2:string}{${0}}' ,
80
- documentation : 'Declare slice' ,
75
+ detail : 'Declare slice' ,
81
76
} ,
82
77
{
83
78
label : 'map' ,
84
79
insertText : 'map[${1:string}]${0:value}' ,
85
- documentation : 'Insert map type' ,
80
+ detail : 'Insert map type' ,
86
81
} ,
87
82
{
88
83
label : 'func' ,
89
84
insertText : [ 'func ${1:functionName}(${3:param}) $4 {' , ' $0' , '}' ] . join ( '\n' ) ,
90
- documentation : 'Insert a function' ,
85
+ detail : 'Insert a function' ,
91
86
} ,
92
87
{
93
88
label : 'for' ,
94
89
insertText : [ 'for _, ${1:v} := range ${2:value} {' , ' $0' , '}' ] . join ( '\n' ) ,
95
- documentation : 'Insert a for range statement' ,
90
+ detail : 'Insert a for range statement' ,
96
91
} ,
97
92
] . map ( ( s ) => ( {
98
93
kind : monaco . languages . CompletionItemKind . Snippet ,
0 commit comments