reddit / emacs

Adding a new language server for LSP mode.

pcorrectness · 2022-04-11 12:43
Hi everyone, I am trying to add a new language server for lsp-mode. My current configuration to add it is this: ``` (defgroup lsp-gobra nil "LSP group for gobra." :group 'lsp-mode) (with-eval-after-load 'lsp-mode (add-to-list 'lsp-language-id-configuration '(gobra-mode . "gobra"))) (defcustom lsp-gobra-executable "<path to jar file>" "Command to start the Gobra language server." :group 'lsp-gobra :risky t :type 'file) (defun lsp-gobra-server-command () "Startup command for Gobra language server." (format "java -jar %s" lsp-gobra-executable)) (lsp-register-client (make-lsp-client :new-connection (lsp-stdio-connection #'lsp-gobra-server-command) :major-modes '(gobra-mode) :activation-fn (lsp-activate-on "gobra") :priority -1 :server-id 'gobra)) ``` I have already defined a major mode called gobra-mode which is enabled when I open a gobra file. This configuration doesn't seem to start the jar file server. Manually starting lsp mode in a gobra-mode buffer doesn't seem to do anything either. Any ideas?
yyoncho · 2022-04-11 14:15
`lsp-gobra-server-command` should return a list. Check `*lsp-log*`
pcorrectness · 2022-04-11 14:19
There is no `*lsp-log*` buffer. It doesn't even try starting lsp mode.
yyoncho · 2022-04-11 21:31
Did you change the binary to be a list?