Skip to content

Commit

Permalink
Switch to using TCP mode instead of stdio (#4622)
Browse files Browse the repository at this point in the history
TCP mode has proven to be more reliable than stdio and is required for container
mode
  • Loading branch information
dcermak authored Nov 28, 2024
1 parent e095b31 commit 5ce1932
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions clients/lsp-rpm-spec.el
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
:tag "Language Server"
:link '(url-link "https://github.com/dcermak/rpm-spec-language-server"))

(defcustom lsp-rpm-spec-server-command '("python" "-m" "rpm_spec_language_server" "--stdio")
(defcustom lsp-rpm-spec-server-command '("python" "-m" "rpm_spec_language_server" "-vvv")
"Command to start rpm-spec-language-server."
:risky t
:group 'lsp-rpm-spec
Expand All @@ -48,8 +48,12 @@ If UPDATE? is true, then pip will update the server."
error-callback
"pip" "install" "--user" "rpm-spec-language-server" (when update? "-U")))

(defun lsp-rpm-spec-server-start-fun (port)
"Command to start the language server in TCP mode, requires PORT."
`(append lsp-rpm-spec-server-command (list "--port" (number-to-string port))))

(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection (lambda () lsp-rpm-spec-server-command))
(make-lsp-client :new-connection (lsp-tcp-connection 'lsp-rpm-spec-server-start-fun)
:activation-fn (lsp-activate-on "rpm-spec")
:server-id 'rpm-spec-language-server))

Expand Down

0 comments on commit 5ce1932

Please sign in to comment.