Replies: 1 comment
-
Check this: https://emacs-lsp.github.io/lsp-mode/page/adding-new-language/#sections . Also some servers require sending the initialization options explicitly like this: https://github.com/emacs-lsp/lsp-mode/blob/master/clients/lsp-rust.el#L1734 or like this: https://github.com/emacs-lsp/lsp-mode/blob/master/clients/lsp-kotlin.el#L339 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'd like to be able to set a variable for typst-lsp (https://github.com/nvarner/typst-lsp). It runs fine with typst-ts-mode, following the instructions on this page : https://emacs-lsp.github.io/lsp-mode/page/adding-new-language/
There is an option in typst-lsp, on by default, to compile the source code to produce the pdf on file save. I would like to disable it. As it is explained on this post : nvarner/typst-lsp#158, I have to set exportPdf to "never" in the language server configuration. Some editors apparently provide ways to set it from the GUI (VSCode) or with a config file (helix).
How can I configure typst-lsp in emacs ? Ideally I would set it in my init file during the lsp initialization.
For information here is what I tried, using environment-fn. The lsp works fine but the exportPdf option has not been set. I think I didn't understand what environment-fn is used for.
(with-eval-after-load 'lsp-mode
(add-to-list 'lsp-language-id-configuration
'(typst-ts-mode . "typst"))
(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection "typst-lsp")
:activation-fn (lsp-activate-on "typst")
:environment-fn (lambda ()
'(("exportPdf" . "never")))
:server-id 'typst)))
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions