mirror of
https://github.com/doomemacs/doomemacs
synced 2025-09-18 16:06:56 -05:00
Picked up by the :lang emacs-lisp module's elisp-demos package when displaying help.el/helpful documentation.
41 lines
1.6 KiB
Org Mode
41 lines
1.6 KiB
Org Mode
#+title: :tools lsp API demos
|
|
#+property: header-args:elisp :results pp :exports both :eval never-export
|
|
|
|
* set-eglot-client!
|
|
#+begin_src emacs-lisp
|
|
;; For setting a single server command:
|
|
(set-eglot-client! 'python-mode
|
|
`(,(concat doom-data-dir \"lsp/mspyls/Microsoft.Python.LanguageServer\")))
|
|
|
|
;; This is equivalent to
|
|
(with-eval-after-load 'eglot
|
|
(add-to-list 'eglot-server-programs `(python-mode . (,(concat doom-data-dir "lsp/mspyls/Microsoft.Python.LanguageServer\")))))
|
|
#+end_src
|
|
|
|
#+begin_src emacs-lisp
|
|
(set-eglot-client! '(python-mode python-ts-mode)
|
|
"pylsp" "pyls"
|
|
'("basedpyright" "--stdio")
|
|
'("basedpyright-langserver" "--stdio")
|
|
'("pyright" "--stdio")
|
|
'("pyright-langserver" "--stdio")
|
|
'("pyrefly" "lsp")
|
|
"jedi-language-server"
|
|
'("ruff" "server")
|
|
"ruff-lsp")
|
|
|
|
;; This is equivalent to
|
|
(with-eval-after-load 'eglot
|
|
(add-to-list 'eglot-server-programs
|
|
`(python-mode
|
|
. ,(eglot-alternatives '("pylsp" "pyls"
|
|
("basedpyright" "--stdio")
|
|
("basedpyright-langserver" "--stdio")
|
|
("pyright" "--stdio")
|
|
("pyright-langserver" "--stdio")
|
|
("pyrefly" "lsp")
|
|
"jedi-language-server"
|
|
("ruff" "server")
|
|
"ruff-lsp"))))))
|
|
#+end_src
|