fix(python): eglot not recognizing (based)?pyright

Because the upstream python entries in eglot-server-programs assume
basedpyright-langserver and pyright-langserver to be the executable
names.

Fix: #8436
This commit is contained in:
Henrik Lissner
2025-09-14 11:51:32 -04:00
parent da5d22ad35
commit 5776adc6be

View File

@@ -33,7 +33,20 @@
(when (modulep! +lsp) (when (modulep! +lsp)
(add-hook 'python-mode-local-vars-hook #'lsp! 'append) (add-hook 'python-mode-local-vars-hook #'lsp! 'append)
(add-hook 'python-ts-mode-local-vars-hook #'lsp! 'append)) (add-hook 'python-ts-mode-local-vars-hook #'lsp! 'append)
;; REVIEW: PR this upstream, which assumes the wrong names for the
;; (based)pyright executables.
(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"))
(set-repl-handler! '(python-mode python-ts-mode) #'+python/open-repl (set-repl-handler! '(python-mode python-ts-mode) #'+python/open-repl
:persist t :persist t