lang/beancount: add beancount-langserver support
Mentioned in #5035. Remove when emacs-lsp/lsp-mode#2863 is resolved.
This commit is contained in:
parent
b0e59ccdcc
commit
5fca440beb
1 changed files with 14 additions and 1 deletions
|
@ -31,7 +31,20 @@ This msut be advised *before* beancount-mode loads, because
|
|||
(when (featurep! +lsp)
|
||||
(after! lsp-mode
|
||||
;; TODO PR this upstream
|
||||
(add-to-list 'lsp-language-id-configuration '(beancount-mode . "beancount")))
|
||||
(add-to-list 'lsp-language-id-configuration '(beancount-mode . "beancount"))
|
||||
(defvar lsp-beancount-langserver-executable "beancount-langserver")
|
||||
(defvar lsp-beancount-journal-file nil)
|
||||
(defvar lsp-beancount-python-interpreter
|
||||
(or (executable-find "python3")
|
||||
(executable-find "python")))
|
||||
(lsp-register-client
|
||||
(make-lsp-client :new-connection
|
||||
(lsp-stdio-connection `(,lsp-beancount-langserver-executable "--stdio"))
|
||||
:major-modes '(beancount-mode)
|
||||
:initialization-options
|
||||
`((journalFile . ,lsp-beancount-journal-file)
|
||||
(pythonPath . ,lsp-beancount-python-interpreter))
|
||||
:server-id 'beancount-ls)))
|
||||
(add-hook 'beancount-mode-local-vars-hook #'lsp!))
|
||||
|
||||
(setq beancount-electric-currency t)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue