Skip to content

Commit 2e51473

Browse files
authored
Update gopls settings except the experimental ones (#4574)
1 parent 532d38b commit 2e51473

File tree

1 file changed

+98
-12
lines changed

1 file changed

+98
-12
lines changed

clients/lsp-go.el

Lines changed: 98 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ completing function calls."
7272
(defcustom lsp-go-build-flags []
7373
"A vector of flags passed on to the build system when invoked,
7474
applied to queries like `go list'."
75-
:type 'lsp-string-vector
75+
:type '(lsp-repeatable-vector string)
7676
:group 'lsp-go
7777
:risky t
7878
:package-version '(lsp-mode "6.2"))
@@ -188,11 +188,11 @@ The codelenses can be found at https://github.com/golang/tools/blob/3fa0e8f87c1a
188188
'lsp-go-library-directories
189189
"lsp-mode 7.0.1")
190190

191-
(defcustom lsp-go-library-directories '("/usr")
191+
(defcustom lsp-go-library-directories ["/usr"]
192192
"List of directories which will be considered to be libraries."
193193
:group 'lsp-go
194194
:risky t
195-
:type '(repeat string))
195+
:type '(lsp-repeatable-vector string))
196196

197197
(define-obsolete-variable-alias
198198
'lsp-clients-go-library-directories-include-go-modules
@@ -231,6 +231,7 @@ $GOPATH/pkg/mod along with the value of
231231
(defcustom lsp-go-link-target "pkg.go.dev"
232232
"Which website to use for displaying Go documentation."
233233
:type '(choice (const "pkg.go.dev")
234+
(const "godoc.org")
234235
(string :tag "A custom website"))
235236
:group 'lsp-go
236237
:package-version '(lsp-mode "7.0.1"))
@@ -275,9 +276,10 @@ $GOPATH/pkg/mod along with the value of
275276
:risky t
276277
:package-version '(lsp-mode "8.0.0"))
277278

278-
(defcustom lsp-go-symbol-matcher "Fuzzy"
279+
(defcustom lsp-go-symbol-matcher "FastFuzzy"
279280
"Sets the algorithm that is used when finding workspace symbols."
280281
:type '(choice (const "Fuzzy")
282+
(const "FastFuzzy")
281283
(const "CaseInsensitive")
282284
(const "CaseSensitive"))
283285
:group 'lsp-go
@@ -301,21 +303,105 @@ $GOPATH/pkg/mod along with the value of
301303
:risky t
302304
:package-version '(lsp-mode "8.0.0"))
303305

306+
(defcustom lsp-go-template-extensions []
307+
"The extensions of file names that are treated as template files.
308+
309+
The extension is the part of the file name after the final dot."
310+
:type '(lsp-repeatable-vector string)
311+
:group 'lsp-go
312+
:package-version '(lsp-mode "9.1"))
313+
314+
(defcustom lsp-go-standalone-tags ["ignore"]
315+
"Specifies a set of build constraints that identify individual Go
316+
source files that make up the entire main package of an
317+
executable."
318+
:type '(lsp-repeatable-vector string)
319+
:group 'lsp-go
320+
:package-version '(lsp-mode "9.1"))
321+
322+
(defcustom lsp-go-completion-budget "100ms"
323+
"Soft latency goal for completion requests"
324+
:type 'string
325+
:group 'lsp-go
326+
:package-version '(lsp-mode "9.1"))
327+
328+
(defcustom lsp-go-matcher "Fuzzy"
329+
"Sets the algorithm that is used when calculating completion candidates."
330+
:type '(choice (const "CaseInsensitive")
331+
(const "CaseSensitive")
332+
(const "Fuzzy"))
333+
:group 'lsp-go
334+
:package-version '(lsp-mode "9.1"))
335+
336+
(defcustom lsp-go-complete-function-calls t
337+
"Enables function call completion.
338+
339+
When completing a statement, or when a function return type
340+
matches the expected of the expression being completed,
341+
completion may suggest call expressions."
342+
:type 'boolean
343+
:group 'lsp-go
344+
:package-version '(lsp-mode "9.1"))
345+
346+
(defcustom lsp-go-diagnostics-delay "1s"
347+
"Controls the amount of time that gopls waits after the most
348+
recent file modification before computing deep diagnostics."
349+
:type 'string
350+
:group 'lsp-go
351+
:package-version '(lsp-mode "9.1"))
352+
353+
(defcustom lsp-go-analysis-progress-reporting t
354+
"Controls whether gopls sends progress notifications when
355+
construction of its index of analysis facts is taking a long
356+
time."
357+
:type 'boolean
358+
:group 'lsp-go
359+
:package-version '(lsp-mode "9.1"))
360+
361+
(defcustom lsp-go-symbol-scope "all"
362+
"Controls which packages are searched for workspace/symbol
363+
requests.
364+
365+
When the scope is \"workspace\", gopls searches only workspace
366+
packages.
367+
368+
When the scope is \"all\", gopls searches all loaded packages,
369+
including dependencies and the standard library."
370+
:type '(choice (const "all")
371+
(const "workspace"))
372+
:group 'lsp-go
373+
:package-version '(lsp-mode "9.1"))
374+
375+
(defcustom lsp-go-verbose-output t
376+
"Enables additional debug logging."
377+
:type 'boolean
378+
:group 'lsp-go
379+
:package-version '(lsp-mode "9.1"))
380+
304381
(lsp-register-custom-settings
305-
'(("gopls.usePlaceholders" lsp-go-use-placeholders t)
306-
("gopls.hoverKind" lsp-go-hover-kind)
382+
'(("gopls.analyses" lsp-go-analyses)
383+
("gopls.analysisProgressReporting" lsp-go-analysis-progress-reporting t)
307384
("gopls.buildFlags" lsp-go-build-flags)
385+
("gopls.codelenses" lsp-go-codelenses)
386+
("gopls.completeFunctionCalls" lsp-go-complete-function-calls t)
387+
("gopls.completionBudget" lsp-go-completion-budget)
388+
("gopls.diagnosticsDelay" lsp-go-diagnostics-delay)
389+
("gopls.directoryFilters" lsp-go-directory-filters)
308390
("gopls.env" lsp-go-env)
391+
("gopls.gofumpt" lsp-go-use-gofumpt t)
392+
("gopls.hoverKind" lsp-go-hover-kind)
393+
("gopls.importShortcut" lsp-go-import-shortcut)
309394
("gopls.linkTarget" lsp-go-link-target)
310-
("gopls.codelenses" lsp-go-codelenses)
311395
("gopls.linksInHover" lsp-go-links-in-hover t)
312-
("gopls.gofumpt" lsp-go-use-gofumpt t)
313396
("gopls.local" lsp-go-goimports-local)
314-
("gopls.directoryFilters" lsp-go-directory-filters)
315-
("gopls.analyses" lsp-go-analyses)
316-
("gopls.importShortcut" lsp-go-import-shortcut)
397+
("gopls.matcher" lsp-go-matcher)
398+
("gopls.standaloneTags" lsp-go-standalone-tags)
317399
("gopls.symbolMatcher" lsp-go-symbol-matcher)
318-
("gopls.symbolStyle" lsp-go-symbol-style)))
400+
("gopls.symbolScope" lsp-go-symbol-scope)
401+
("gopls.symbolStyle" lsp-go-symbol-style)
402+
("gopls.templateExtensions" lsp-go-template-extensions)
403+
("gopls.usePlaceholders" lsp-go-use-placeholders t)
404+
("gopls.verboseOutput" lsp-go-verbose-output t)))
319405

320406
(defcustom lsp-go-server-wrapper-function
321407
#'identity

0 commit comments

Comments
 (0)