-
Notifications
You must be signed in to change notification settings - Fork 8
/
LSP-gopls.sublime-settings
314 lines (277 loc) · 11.2 KB
/
LSP-gopls.sublime-settings
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
// Packages/User/LSP-gopls.sublime-settings
{
"command": [
"${storage_path}/LSP-gopls/bin/gopls"
],
"selector": "source.go | source.gomod",
"settings": {
// Controls if LSP-gopls will automatically install and upgrade gopls.
// If this option is set to `False` the user will need to update the
// `command` to point to a valid gopls binary.
"manageGoplsBinary": true,
// Controls if the Terminus panel/tab will auto close on tests completing.
"closeTestResultsWhenFinished": false,
// Controls if the test results output to a panel instead of a tab.
"runTestsInPanel": true,
// buildFlags 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`.
//
"gopls.buildFlags": [],
// env adds environment variables to external commands run by `gopls`, most notably `go list`.
//
"gopls.env": {},
// directoryFilters can be used to exclude unwanted directories from the
// workspace. By default, all directories are included. Filters are an
// operator, `+` to include and `-` to exclude, followed by a path prefix
// relative to the workspace folder. They are evaluated in order, and
// the last filter that applies to a path controls whether it is included.
// The path prefix can be empty, so an initial `-` excludes everything.
//
// DirectoryFilters also supports the `**` operator to match 0 or more directories.
//
// Examples:
//
// Exclude node_modules at current depth: `-node_modules`
//
// Exclude node_modules at any depth: `-**/node_modules`
//
// Include only project_a: `-` (exclude everything), `+project_a`
//
// Include only project_a, but not node_modules inside it: `-`, `+project_a`, `-project_a/node_modules`
//
"gopls.directoryFilters": [
"-**/node_modules"
],
// templateExtensions gives the extensions of file names that are treateed
// as template files. (The extension
// is the part of the file name after the final dot.)
//
"gopls.templateExtensions": [],
// (experimental) obsolete, no effect
//
"gopls.memoryMode": "",
// (experimental) expandWorkspaceToModule determines which packages are considered
// "workspace packages" when the workspace is using modules.
//
// Workspace packages affect the scope of workspace-wide operations. Notably,
// gopls diagnoses all packages considered to be part of the workspace after
// every keystroke, so by setting "ExpandWorkspaceToModule" to false, and
// opening a nested workspace directory, you can reduce the amount of work
// gopls has to do to keep your workspace up to date.
//
"gopls.expandWorkspaceToModule": true,
// (experimental) allowImplicitNetworkAccess disables GOPROXY=off, allowing implicit module
// downloads rather than requiring user action. This option will eventually
// be removed.
//
"gopls.allowImplicitNetworkAccess": false,
// standaloneTags specifies a set of build constraints that identify
// individual Go source files that make up the entire main package of an
// executable.
//
// A common example of standalone main files is the convention of using the
// directive `//go:build ignore` to denote files that are not intended to be
// included in any package, for example because they are invoked directly by
// the developer using `go run`.
//
// Gopls considers a file to be a standalone main file if and only if it has
// package name "main" and has a build directive of the exact form
// "//go:build tag" or "// +build tag", where tag is among the list of tags
// configured by this setting. Notably, if the build constraint is more
// complicated than a simple tag (such as the composite constraint
// `//go:build tag && go1.18`), the file is not considered to be a standalone
// main file.
//
// This setting is only supported when gopls is built with Go 1.16 or later.
//
"gopls.standaloneTags": [
"ignore"
],
// hoverKind controls the information that appears in the hover text.
// SingleLine and Structured are intended for use only by authors of editor plugins.
//
"gopls.hoverKind": "FullDocumentation",
// linkTarget controls where documentation links go.
// It might be one of:
//
// * `"godoc.org"`
// * `"pkg.go.dev"`
//
// If company chooses to use its own `godoc.org`, its address can be used as well.
//
// Modules matching the GOPRIVATE environment variable will not have
// documentation links in hover.
//
"gopls.linkTarget": "pkg.go.dev",
// linksInHover controls the presence of documentation links
// in hover markdown.
//
// Its legal values are:
// - `false`, for no links;
// - `true`, for links to the `linkTarget` domain; or
// - `"gopls"`, for links to gopls' internal documentation viewer.
//
"gopls.linksInHover": true,
// placeholders enables placeholders for function parameters or struct
// fields in completion responses.
//
"gopls.usePlaceholders": false,
// (debug) completionBudget is the soft latency goal for completion requests. Most
// requests finish in a couple milliseconds, but in some cases deep
// completions can take much longer. As we use up our budget we
// dynamically reduce the search scope to ensure we return timely
// results. Zero means unlimited.
//
"gopls.completionBudget": "100ms",
// (advanced) matcher sets the algorithm that is used when calculating completion
// candidates.
//
"gopls.matcher": "Fuzzy",
// (experimental) experimentalPostfixCompletions enables artificial method snippets
// such as "someSlice.sort!".
//
"gopls.experimentalPostfixCompletions": true,
// completeFunctionCalls enables function call completion.
//
// When completing a statement, or when a function return type matches the
// expected of the expression being completed, completion may suggest call
// expressions (i.e. may include parentheses).
//
"gopls.completeFunctionCalls": true,
// importShortcut specifies whether import statements should link to
// documentation or go to definitions.
//
"gopls.importShortcut": "Both",
// (advanced) symbolMatcher sets the algorithm that is used when finding workspace symbols.
//
"gopls.symbolMatcher": "FastFuzzy",
// (advanced) symbolStyle controls how symbols are qualified in symbol responses.
//
// Example Usage:
//
// ```json5
// "gopls": {
// ...
// "symbolStyle": "Dynamic",
// ...
// }
// ```
//
"gopls.symbolStyle": "Dynamic",
// symbolScope controls which packages are searched for workspace/symbol
// requests. When the scope is "workspace", gopls searches only workspace
// packages. When the scope is "all", gopls searches all loaded packages,
// including dependencies and the standard library.
//
"gopls.symbolScope": "all",
// analyses specify analyses that the user would like to enable or disable.
// A map of the names of analysis passes that should be enabled/disabled.
// A full list of analyzers that gopls uses can be found in
// [analyzers.md](https://github.com/golang/tools/blob/master/gopls/doc/analyzers.md).
//
// Example Usage:
//
// ```json5
// ...
// "analyses": {
// "unreachable": false, // Disable the unreachable analyzer.
// "unusedvariable": true // Enable the unusedvariable analyzer.
// }
// ...
// ```
//
"gopls.analyses": {},
// (experimental) staticcheck enables additional analyses from staticcheck.io.
// These analyses are documented on
// [Staticcheck's website](https://staticcheck.io/docs/checks/).
//
"gopls.staticcheck": false,
// (experimental) annotations specifies the various kinds of optimization diagnostics
// that should be reported by the gc_details command.
//
"gopls.annotations": {
"bounds": true,
"escape": true,
"inline": true,
"nil": true
},
// (experimental) vulncheck enables vulnerability scanning.
//
"gopls.vulncheck": "Off",
// (advanced) diagnosticsDelay controls the amount of time that gopls waits
// after the most recent file modification before computing deep diagnostics.
// Simple diagnostics (parsing and type-checking) are always run immediately
// on recently modified packages.
//
// This option must be set to a valid duration string, for example `"250ms"`.
//
"gopls.diagnosticsDelay": "1s",
// (experimental) diagnosticsTrigger controls when to run diagnostics.
//
"gopls.diagnosticsTrigger": "Edit",
// analysisProgressReporting controls whether gopls sends progress
// notifications when construction of its index of analysis facts is taking a
// long time. Cancelling these notifications will cancel the indexing task,
// though it will restart after the next change in the workspace.
//
// When a package is opened for the first time and heavyweight analyses such as
// staticcheck are enabled, it can take a while to construct the index of
// analysis facts for all its dependencies. The index is cached in the
// filesystem, so subsequent analysis should be faster.
//
"gopls.analysisProgressReporting": true,
// (experimental) hints specify inlay hints that users want to see. A full list of hints
// that gopls uses can be found in
// [inlayHints.md](https://github.com/golang/tools/blob/master/gopls/doc/inlayHints.md).
//
"gopls.hints": {},
// codelenses overrides the enabled/disabled state of each of gopls'
// sources of [Code Lenses](codelenses.md).
//
// Example Usage:
//
// ```json5
// "gopls": {
// ...
// "codelenses": {
// "generate": false, // Don't show the `go generate` lens.
// "gc_details": true // Show a code lens toggling the display of gc's choices.
// }
// ...
// }
// ```
//
"gopls.codelenses": {
"gc_details": false,
"generate": true,
"regenerate_cgo": true,
"run_govulncheck": false,
"tidy": true,
"upgrade_dependency": true,
"vendor": true
},
// (experimental) semanticTokens controls whether the LSP server will send
// semantic tokens to the client.
//
"gopls.semanticTokens": false,
// (experimental) noSemanticString turns off the sending of the semantic token 'string'
//
"gopls.noSemanticString": false,
// (experimental) noSemanticNumber turns off the sending of the semantic token 'number'
//
"gopls.noSemanticNumber": false,
// local is the equivalent of the `goimports -local` flag, which puts
// imports beginning with this string after third-party packages. It should
// be the prefix of the import path whose imports should be grouped
// separately.
//
"gopls.local": "",
// gofumpt indicates if we should run gofumpt formatting.
//
"gopls.gofumpt": false,
// (debug) verboseOutput enables additional debug logging.
//
"gopls.verboseOutput": false,
}
}