From 5776adc6be94826d25fabd3ab8799dd3a6fbe14a Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 14 Sep 2025 11:51:32 -0400 Subject: [PATCH] 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 --- modules/lang/python/config.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/lang/python/config.el b/modules/lang/python/config.el index a0c0c0603..5d28b0ea8 100644 --- a/modules/lang/python/config.el +++ b/modules/lang/python/config.el @@ -33,7 +33,20 @@ (when (modulep! +lsp) (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 :persist t