Skip to content

Commit 327b6a6

Browse files
authored
fix: snippets description (#423)
1 parent 599d3b6 commit 327b6a6

File tree

1 file changed

+14
-19
lines changed
  • web/src/components/features/workspace/CodeEditor/autocomplete/symbols

1 file changed

+14
-19
lines changed

web/src/components/features/workspace/CodeEditor/autocomplete/symbols/snippets.ts

+14-19
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const snippets = [
1515
{
1616
label: 'iferr',
1717
insertText: ['if err != nil {', '\treturn ${1:nil, err}', '}'].join('\n'),
18-
documentation: 'Return error if err != nil',
18+
detail: 'Return error if err != nil',
1919
},
2020
{
2121
label: 'switch',
@@ -27,72 +27,67 @@ const snippets = [
2727
'\t\t// TODO: implement',
2828
'}',
2929
].join('\n'),
30-
documentation: 'Insert switch statement',
30+
detail: 'Insert switch statement',
3131
},
3232
{
3333
label: 'go',
3434
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',
4136
},
4237
{
4338
label: 'typestruct',
4439
insertText: ['type ${1:name} struct {', '\t$0', '}'].join('\n'),
45-
documentation: 'Declare a struct',
40+
detail: 'Declare a struct',
4641
},
4742
{
4843
label: 'typeinterface',
4944
insertText: ['type ${1:name} interface {', '\t$0', '}'].join('\n'),
50-
documentation: 'Declare a struct',
45+
detail: 'Declare a struct',
5146
},
5247
{
5348
label: 'fmtprintf',
5449
insertText: 'fmt.Printf("${1:format}", $0)',
55-
documentation: 'fmt.Printf() shorthand',
50+
detail: 'fmt.Printf() shorthand',
5651
},
5752
{
5853
label: 'fmtprintln',
5954
insertText: 'fmt.Println(${0:message})',
60-
documentation: 'fmt.Println() shorthand',
55+
detail: 'fmt.Println() shorthand',
6156
},
6257
{
6358
label: 'returnnil',
6459
insertText: 'return nil',
65-
documentation: 'return nil',
60+
detail: 'return nil',
6661
},
6762
{
6863
label: 'timenow',
6964
insertText: '${0:t} := time.Now()',
70-
documentation: 'time.Now() shorthand',
65+
detail: 'time.Now() shorthand',
7166
},
7267
{
7368
label: 'makeslice',
7469
insertText: '${0:items} := make([]${1:string}, ${2:0}, ${3:0})',
75-
documentation: 'Make a new slice',
70+
detail: 'Make a new slice',
7671
},
7772
{
7873
label: 'slice',
7974
insertText: '${1:items} := []${2:string}{${0}}',
80-
documentation: 'Declare slice',
75+
detail: 'Declare slice',
8176
},
8277
{
8378
label: 'map',
8479
insertText: 'map[${1:string}]${0:value}',
85-
documentation: 'Insert map type',
80+
detail: 'Insert map type',
8681
},
8782
{
8883
label: 'func',
8984
insertText: ['func ${1:functionName}(${3:param}) $4 {', ' $0', '}'].join('\n'),
90-
documentation: 'Insert a function',
85+
detail: 'Insert a function',
9186
},
9287
{
9388
label: 'for',
9489
insertText: ['for _, ${1:v} := range ${2:value} {', ' $0', '}'].join('\n'),
95-
documentation: 'Insert a for range statement',
90+
detail: 'Insert a for range statement',
9691
},
9792
].map((s) => ({
9893
kind: monaco.languages.CompletionItemKind.Snippet,

0 commit comments

Comments
 (0)