Skip to content

Commit

Permalink
Make lsp-clients-go-server configurable
Browse files Browse the repository at this point in the history
Current logic ignored `lsp-clients-go-server` and fixed to `gopls`,
while `gopls` does not work all the time.
  • Loading branch information
nanjj committed Apr 1, 2019
1 parent 22a2319 commit 9d42168
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions lsp-clients.el
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ finding the executable with `exec-path'."
:tag "Go language")

(defcustom lsp-clients-go-server "bingo"
"The go language server executable to use."
"The go language server executable to use. One of `bingo',
`gopls', `go-langserver' to use. Defaults to `bingo'."
:group 'lsp-clients-go
:risky t
:type 'file)
Expand Down Expand Up @@ -452,32 +453,14 @@ defaults to half of your CPU cores."
:diagnosticsEnabled ,lsp-clients-go-diagnostics-enabled))


(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection "gopls")
:major-modes '(go-mode)
:priority 0
:initialization-options 'lsp-clients-go--make-init-options
:server-id 'gopls
:library-folders-fn (lambda (_workspace)
lsp-clients-go-library-directories)))

(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection
(lambda () (cons lsp-clients-go-server
lsp-clients-go-server-args)))
:major-modes '(go-mode)
:priority -1
:initialization-options 'lsp-clients-go--make-init-options
:server-id 'go-bingo
:library-folders-fn (lambda (_workspace)
lsp-clients-go-library-directories)))

(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection "go-langserver")
:major-modes '(go-mode)
:priority -2
:initialization-options 'lsp-clients-go--make-init-options
:server-id 'go-ls
:server-id (intern (concat "go-" lsp-clients-go-server))
:library-folders-fn (lambda (_workspace)
lsp-clients-go-library-directories)))

Expand Down

0 comments on commit 9d42168

Please sign in to comment.