forked from josa42/coc-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
555 lines (555 loc) · 17 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
{
"name": "coc-go",
"version": "0.9.1",
"description": "gopls extension for coc",
"author": "Josa Gesell <[email protected]>",
"license": "MIT",
"main": "lib/extension.js",
"repository": {
"type": "git",
"url": "https://github.com/josa42/coc-go.git"
},
"engines": {
"coc": "^0.0.73",
"node": ">=10"
},
"keywords": [
"coc.nvim",
"languageserver",
"gopls",
"go",
"golang",
"vim",
"neovim"
],
"scripts": {
"test": "mocha --require ts-node/register '**/*.test.ts'",
"test:watch": "mocha --watch --watch-files '**/*.ts' --require ts-node/register '**/*.test.ts'",
"clean": "rimraf lib",
"build": "tsc -p tsconfig.json",
"build:watch": "tsc --watch -p tsconfig.json",
"prepare": "yarn clean && yarn build",
"link:add": "node ./scripts/link.js add",
"link:remove": "node ./scripts/link.js remove",
"update": "yarn run update:snippets && yarn run update:options && yarn run update:readme && yarn run update:readme",
"update:snippets": "./scripts/update-snippets.js",
"update:options": "./scripts/update-options.sh && node ./scripts/update-options-interface.js",
"update:commands": "./scripts/update-commands.js",
"update:readme": "./scripts/update-tables.sh",
"lint": "eslint . --ext .ts,.js"
},
"activationEvents": [
"onLanguage:go",
"onCommand:go.install.gomodifytags",
"onCommand:go.install.goplay",
"onCommand:go.install.gopls",
"onCommand:go.install.gotests",
"onCommand:go.install.impl",
"onCommand:go.version"
],
"contributes": {
"rootPatterns": [
{
"filetype": "go",
"patterns": [
"go.mod",
"glide.yaml"
]
}
],
"configuration": {
"type": "object",
"title": "gols",
"properties": {
"go.enable": {
"type": "boolean",
"default": true,
"description": "Enable Go extension"
},
"go.trace.server": {
"type": "string",
"default": "off",
"enum": [
"off",
"messages",
"verbose"
],
"description": "Trace level of gopls"
},
"go.goplsPath": {
"type": "string",
"description": "Path to `gopls` bin (Change requires `:CocRestart`)"
},
"go.goplsArgs": {
"type": "array",
"items": {
"type": "string"
},
"description": "Arguments passed to `gopls` (Change requires `:CocRestart`)"
},
"go.disable": {
"type": "object",
"description": "Disable gopls features",
"properties": {
"workspaceFolders": {
"type": "boolean",
"default": false,
"description": "Disable workspaceFolders feature (Change requires `:CocRestart`)"
},
"diagnostics": {
"type": "boolean",
"default": false,
"description": "Disable handle diagnostics (Change requires `:CocRestart`)"
},
"completion": {
"type": "boolean",
"default": false,
"description": "Disable completion feature (Change requires `:CocRestart`)"
}
}
},
"go.goplsOptions": {
"type": "object",
"description": "See `gopls` documentation: https://github.com/golang/tools/blob/master/gopls/doc/settings.md",
"properties": {
"buildFlags": {
"type": "array",
"items": {
"type": "string"
},
"description": "This is the set of flags passed on to the build system when invoked. It is applied to queries like `go list`, which is used when discovering files. The most common use is to set `-tags`."
},
"env": {
"type": "object",
"patternProperties": {
".+": {
"type": "string"
}
},
"description": "This can be used to add environment variables. These will not affect `gopls` itself, but will be used for any external commands it invokes."
},
"hoverKind": {
"type": "string",
"default": "SynopsisDocumentation",
"enum": [
"NoDocumentation",
"SynopsisDocumentation",
"FullDocumentation"
],
"description": "This controls the information that appears in the hover text."
},
"usePlaceholders": {
"type": "boolean",
"default": false,
"description": "If true, then completion responses may contain placeholders for function parameters or struct fields."
},
"linkTarget": {
"type": "string",
"default": "pkg.go.dev",
"enum": [
"godoc.org",
"pkg.go.dev"
],
"description": "This controls where points documentation for given package in `textDocument/documentLink`."
},
"local": {
"type": "string",
"default": "",
"description": "This is the equivalent of the `goimports -local` flag, which puts imports beginning with this string after 3rd-party packages."
},
"analyses": {
"description": "[EXPERIMENTAL] Analyses specify analyses that the user would like to enable or disable.",
"type": "object",
"required": [],
"additionalProperties": false,
"properties": {
"asmdecl": {
"type": "boolean",
"default": true
},
"assign": {
"type": "boolean",
"default": true
},
"atomic": {
"type": "boolean",
"default": true
},
"atomicalign": {
"type": "boolean",
"default": true
},
"bools": {
"type": "boolean",
"default": true
},
"buildtag": {
"type": "boolean",
"default": true
},
"cgocall": {
"type": "boolean",
"default": true
},
"composites": {
"type": "boolean",
"default": true
},
"copylock": {
"type": "boolean",
"default": true
},
"errorsas": {
"type": "boolean",
"default": true
},
"httpresponse": {
"type": "boolean",
"default": true
},
"loopclosure": {
"type": "boolean",
"default": true
},
"lostcancel": {
"type": "boolean",
"default": true
},
"nilfunc": {
"type": "boolean",
"default": true
},
"printf": {
"type": "boolean",
"default": true
},
"shift": {
"type": "boolean",
"default": true
},
"stdmethods": {
"type": "boolean",
"default": true
},
"structtag": {
"type": "boolean",
"default": true
},
"tests": {
"type": "boolean",
"default": true
},
"unmarshal": {
"type": "boolean",
"default": true
},
"unreachable": {
"type": "boolean",
"default": true
},
"unsafeptr": {
"type": "boolean",
"default": true
},
"unusedresult": {
"type": "boolean",
"default": true
},
"deepequalerrors": {
"type": "boolean",
"default": true
},
"fillreturns": {
"type": "boolean",
"default": false
},
"nonewvars": {
"type": "boolean",
"default": false
},
"noresultvalues": {
"type": "boolean",
"default": true
},
"simplifycompositelit": {
"type": "boolean",
"default": true
},
"simplifyrange": {
"type": "boolean",
"default": true
},
"simplifyslice": {
"type": "boolean",
"default": true
},
"sortslice": {
"type": "boolean",
"default": true
},
"testinggoroutine": {
"type": "boolean",
"default": true
},
"undeclaredname": {
"type": "boolean",
"default": false
},
"unusedparams": {
"type": "boolean",
"default": false
}
}
},
"codelens": {
"description": "[EXPERIMENTAL]",
"type": "object",
"required": [],
"additionalProperties": false,
"properties": {
"generate": {
"type": "boolean",
"default": true
},
"upgrade.dependency": {
"type": "boolean",
"default": true
},
"test": {
"type": "boolean",
"default": false
}
}
},
"completionDocumentation": {
"type": "boolean",
"default": true,
"description": "[EXPERIMENTAL] If false, indicates that the user does not want documentation with completion results."
},
"completeUnimported": {
"type": "boolean",
"default": false,
"description": "[EXPERIMENTAL] If true, the completion engine is allowed to make suggestions for packages that you do not currently import."
},
"deepCompletion": {
"type": "boolean",
"default": true,
"description": "[EXPERIMENTAL] If true, this turns on the ability to return completions from deep inside relevant entities, rather than just the locally accessible ones."
},
"fuzzyMatching": {
"type": "boolean",
"default": true,
"description": "[EXPERIMENTAL] If true, this enables server side fuzzy matching of completion candidates."
},
"staticcheck": {
"type": "boolean",
"description": "[EXPERIMENTAL] If true, it enables the use of the staticcheck.io analyzers."
},
"matcher": {
"type": "string",
"default": "caseInsensitive",
"enum": [
"fuzzy",
"caseSensitive",
"caseInsensitive"
],
"description": "[EXPERIMENTAL] "
},
"symbolMatcher": {
"type": "string",
"default": "caseInsensitive",
"enum": [
"fuzzy",
"caseSensitive",
"caseInsensitive"
],
"description": "[EXPERIMENTAL] "
}
}
},
"go.tags": {
"type": "object",
"properties": {
"tags": {
"type": "string",
"default": "json",
"description": "Comma separated tags to be used by `go.tags.add` command"
},
"options": {
"type": "string",
"default": "json=omitempty",
"description": "Comma separated tag=options pairs to be used by `go.tags.add` command"
},
"transform": {
"type": "string",
"enum": [
"snakecase",
"camelcase"
],
"default": "snakecase",
"description": "Transformation rule used by `go.tags.add` command to add tags"
},
"skipUnexported": {
"type": "boolean",
"default": false,
"description": "If true, skip unexported fields"
}
}
},
"go.tests": {
"type": "object",
"properties": {
"generateFlags": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "Additional command line flags to pass to `gotests` for generating tests."
}
}
},
"go.checkForUpdates": {
"description": "[EXPERIMENTAL] Check for gopls updates on start.",
"type": "string",
"default": "disabled",
"enum": [
"disabled",
"inform",
"ask",
"install"
]
}
}
},
"commands": [
{
"title": "Generate interface stubs",
"category": "Go",
"command": "go.impl.cursor"
},
{
"title": "Install / update gomodifytags",
"category": "Go",
"command": "go.install.gomodifytags"
},
{
"title": "Install / update goplay",
"category": "Go",
"command": "go.install.goplay"
},
{
"title": "Install / update gopls",
"category": "Go",
"command": "go.install.gopls"
},
{
"title": "Install / update gotests",
"category": "Go",
"command": "go.install.gotests"
},
{
"title": "Install / update impl",
"category": "Go",
"command": "go.install.impl"
},
{
"title": "Run on go playground",
"category": "Go",
"command": "go.playground"
},
{
"title": "Add tags to struct fields",
"category": "Go",
"command": "go.tags.add"
},
{
"title": "Add tags to struct field in current line",
"category": "Go",
"command": "go.tags.add.line"
},
{
"title": "Add tags to struct fields (prompt)",
"category": "Go",
"command": "go.tags.add.prompt"
},
{
"title": "Remove all tags from struct fields",
"category": "Go",
"command": "go.tags.clear"
},
{
"title": "Remove all tags from struct fields in current line",
"category": "Go",
"command": "go.tags.clear.line"
},
{
"title": "Remove tags from struct fields",
"category": "Go",
"command": "go.tags.remove"
},
{
"title": "Remove tags from struct field in current line",
"category": "Go",
"command": "go.tags.remove.line"
},
{
"title": "Remove tags from struct fields (prompt)",
"category": "Go",
"command": "go.tags.remove.prompt"
},
{
"title": "Generate unit tests for exported functions in file",
"category": "Go",
"command": "go.test.generate.exported"
},
{
"title": "Generate unit tests for file",
"category": "Go",
"command": "go.test.generate.file"
},
{
"title": "Toggle test file",
"category": "Go",
"command": "go.test.toggle"
},
{
"title": "Print extension version",
"category": "Go",
"command": "go.version"
}
],
"snippets": [
{
"language": "go",
"path": "./snippets/go.json"
},
{
"language": "gomod",
"path": "./snippets/gomod.json"
}
]
},
"devDependencies": {
"@types/mocha": "^7.0.2",
"@types/node": "^14.0.5",
"@types/node-fetch": "^2.5.7",
"@types/tmp": "^0.2.0",
"@types/which": "^1.3.2",
"@typescript-eslint/eslint-plugin": "^3.0.0",
"@typescript-eslint/parser": "^3.0.0",
"coc.nvim": "0.0.77",
"eslint": "^7.1.0",
"eslint-config-josa-typescript": "^0.1.2",
"mocha": "^7.2.0",
"rimraf": "^3.0.2",
"tmp": "^0.2.1",
"ts-node": "^8.10.1",
"typescript": "~3.9.3"
},
"dependencies": {
"node-fetch": "^2.6.0",
"tslib": "^2.0.0",
"which": "^2.0.2"
}
}