@@ -382,73 +382,15 @@ finding the executable with `exec-path'."
382382 :type '(repeat string)
383383 :group 'lsp-clients-go )
384384
385- (defcustom lsp-clients-go-func-snippet-enabled t
386- " Enable the returning of argument snippets on `func' completions, eg.
387- `func(foo string, arg2 bar)'. Requires code completion to be enabled."
388- :type 'boolean
389- :group 'lsp-clients-go )
390-
391- (defcustom lsp-clients-go-gocode-completion-enabled t
392- " Enable code completion feature (using gocode)."
393- :type 'boolean
394- :group 'lsp-clients-go )
395-
396- (defcustom lsp-clients-go-format-tool " goimports"
397- " The tool to be used for formatting documents. Defaults to `goimports' if nil."
398- :type '(choice (const :tag " goimports" " goimports" )
399- (const :tag " gofmt" " gofmt" ))
400- :group 'lsp-clients-go )
401-
402- (defcustom lsp-clients-go-imports-local-prefix " "
403- " The local prefix (comma-separated string) that goimports will use."
404- :type 'string
405- :group 'lsp-clients-go )
406-
407- (defcustom lsp-clients-go-max-parallelism nil
408- " The maximum number of goroutines that should be used to fulfill requests.
409- This is useful in editor environments where users do not want results ASAP,
410- but rather just semi quickly without eating all of their CPU. When nil,
411- defaults to half of your CPU cores."
412- :type '(choice integer (const nil " Half of CPU cores." ))
413- :group 'lsp-clients-go )
414-
415- (defcustom lsp-clients-go-use-binary-pkg-cache t
416- " Whether or not $GOPATH/pkg binary .a files should be used."
417- :type 'boolean
418- :group 'lsp-clients-go )
419-
420- (defcustom lsp-clients-go-diagnostics-enabled t
421- " Whether diagnostics are enabled."
422- :type 'boolean
423- :group 'lsp-clients-go )
424-
425- (defcustom lsp-clients-go-library-directories '(" /usr" )
426- " List of directories which will be considered to be libraries."
427- :group 'lsp-clients-go
428- :risky t
429- :type '(repeat string))
430-
431385(define-inline lsp-clients-go--bool-to-json (val)
432386 (inline-quote (if , val t :json-false )))
433387
434- (defun lsp-clients-go--make-init-options ()
435- " Init options for golang."
436- `(:funcSnippetEnabled ,(lsp-clients-go--bool-to-json lsp-clients-go-func-snippet-enabled)
437- :disableFuncSnippet ,(lsp-clients-go--bool-to-json (not lsp-clients-go-func-snippet-enabled))
438- :gocodeCompletionEnabled ,(lsp-clients-go--bool-to-json lsp-clients-go-gocode-completion-enabled)
439- :formatTool , lsp-clients-go-format-tool
440- :goimportsLocalPrefix , lsp-clients-go-imports-local-prefix
441- :maxParallelism , lsp-clients-go-max-parallelism
442- :useBinaryPkgCache , lsp-clients-go-use-binary-pkg-cache
443- :diagnosticsEnabled , lsp-clients-go-diagnostics-enabled ))
444-
445388(lsp-register-client
446389 (make-lsp-client :new-connection (lsp-stdio-connection
447390 (lambda () (cons lsp-clients-go-server
448391 lsp-clients-go-server-args)))
449392 :major-modes '(go-mode )
450393 :priority -1
451- :initialization-options 'lsp-clients-go--make-init-options
452394 :server-id 'go-bingo
453395 :library-folders-fn (lambda (_workspace )
454396 lsp-clients-go-library-directories)))
@@ -457,7 +399,6 @@ defaults to half of your CPU cores."
457399 (make-lsp-client :new-connection (lsp-stdio-connection " go-langserver" )
458400 :major-modes '(go-mode )
459401 :priority -2
460- :initialization-options 'lsp-clients-go--make-init-options
461402 :server-id 'go-ls
462403 :library-folders-fn (lambda (_workspace )
463404 lsp-clients-go-library-directories)))
0 commit comments