tweak(python): don't use basedpyright by default

Because of the python dev's propensity to use env managers, setting the
pyright executable globally doesn't make much sense, and could in fact
end up intrusively overriding a user's local settings.

A better approach may be to introduce an envvar here that can be set
from external .envrc or venv config files, or making
`lsp-pyright-langserver-command` a safe file-local variable (so it can
be set from .dir-locals.el or in the file-local variables of a python
file), but if I decide to do one or the other, I'd like to be consistent
about it across all python executables/external dependencies (and
possibly even to all :lang modules that depend on env managers), so I'll
defer implementing that until I have the time to give it more thought
and plan it better.

Amend: 1fa1eba5ac
This commit is contained in:
Henrik Lissner
2025-07-01 13:45:40 +02:00
parent 7d69c5f7df
commit 6bd38e2c4d

View File

@ -265,7 +265,4 @@
:when (modulep! +lsp)
:when (modulep! +pyright)
:when (modulep! :tools lsp -eglot)
:defer t
:init
(when (executable-find "basedpyright")
(setq lsp-pyright-langserver-command "basedpyright")))
:defer t)