Skip to content

Commit

Permalink
[beancount] Use Rust version of language-server
Browse files Browse the repository at this point in the history
The Python and Typescript versions of beancount-language-server are
deprecated, the maintained version now is the Rust one.
  • Loading branch information
gagbo committed Aug 13, 2023
1 parent d14d3d5 commit cdc556f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
21 changes: 7 additions & 14 deletions clients/lsp-beancount.el
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand All @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions docs/lsp-clients.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down

0 comments on commit cdc556f

Please sign in to comment.