From cdc556f1e9138529061c4afe5488388165bb1231 Mon Sep 17 00:00:00 2001 From: Gerry Agbobada Date: Sun, 13 Aug 2023 10:44:38 +0200 Subject: [PATCH] [beancount] Use Rust version of language-server The Python and Typescript versions of beancount-language-server are deprecated, the maintained version now is the Rust one. --- clients/lsp-beancount.el | 21 +++++++-------------- docs/lsp-clients.json | 5 +++-- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/clients/lsp-beancount.el b/clients/lsp-beancount.el index d2125e8cf51..7a2d89d1e2a 100644 --- a/clients/lsp-beancount.el +++ b/clients/lsp-beancount.el @@ -32,20 +32,16 @@ :link '(url-link "https://github.com/polarmutex/beancount-language-server") :package-version '(lsp-mode . "8.0.0")) -(defcustom lsp-beancount-langserver-executable "beancount-langserver" +(defcustom lsp-beancount-langserver-executable "beancount-language-server" "Command to start Beancount language server." :type 'string :group 'lsp-beancount :package-version '(lsp-mode . "8.0.0")) -(defcustom lsp-beancount-python-interpreter nil - "Path to Python executable." - :type 'string - :group 'lsp-beancount - :package-version '(lsp-mode . "8.0.0")) - (defcustom lsp-beancount-journal-file nil - "Pathg to Beancount journal file." + "Path to Beancount journal file. + +Use nil (the default) to use the current beancount buffer as the journal file." :type 'string :group 'lsp-beancount :package-version '(lsp-mode . "8.0.0")) @@ -55,14 +51,11 @@ :new-connection (lsp-stdio-connection (lambda () - (when (null lsp-beancount-python-interpreter) - (setq lsp-beancount-python-interpreter (or (executable-find "python3") - (executable-find "python")))) - `(,lsp-beancount-langserver-executable "--stdio"))) + (let ((lsp-beancount-journal-file (or lsp-beancount-journal-file (buffer-file-name)))) + `(,lsp-beancount-langserver-executable "--stdio")))) :major-modes '(beancount-mode) :initialization-options - `((journalFile . ,lsp-beancount-journal-file) - (pythonPath . ,lsp-beancount-python-interpreter)) + `((journalFile . ,lsp-beancount-journal-file)) :server-id 'beancount-ls)) (lsp-consistency-check lsp-beancount) diff --git a/docs/lsp-clients.json b/docs/lsp-clients.json index d3902f20228..aa6d53dfca5 100644 --- a/docs/lsp-clients.json +++ b/docs/lsp-clients.json @@ -63,9 +63,10 @@ { "name": "beancount", "full-name": "Beancount", - "server-name": "beancount-langserver", + "server-name": "beancount-language-server", "server-url": "https://github.com/polarmutex/beancount-language-server", - "installation": "npm install -g beancount-langserver", + "installation": "cargo install beancount-language-server", + "installation-url": "https://github.com/polarmutex/beancount-language-server#installation", "lsp-install-server": "beancount-ls", "debugger": "Not available" },