Files
doomemacs/modules/tools/lsp/demos.org
Henrik Lissner 03e286feb4 docs(lsp): add demos.org
Picked up by the :lang emacs-lisp module's elisp-demos package when
displaying help.el/helpful documentation.
2025-09-14 23:17:31 -04:00

1.6 KiB

:tools lsp API demos

set-eglot-client!

;; 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\")))))
(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"))))))