Open ltrojan opened 2 months ago
Unsure if I can help as I use eglot
rather than lsp-mode
. However, a couple of points.
flymake
and flycheck
enabled at the same time. (setq lsp-prefer-flymake t)) ;; Disable `flymake`
This suggests you enable flymake
rather than disable it and you prefer it presumably over flycheck
.
Your pyproject.toml
also seems incorrect.
python-lsp-ruff
under poetry dependencies.python
as a poetry dependency. I appreciate it is a python project manager but does python
have to be listed here?ruff
then isort
and black
are probabaly unnecessary.ruff
is a dependency of python-lsp-ruff
so shouldn't need to be listed separately.You make no mention of how you have installed python-lsp-server
. You probably want to install it once and make it available to all your projects rather than install it for each project. If so I suggest you install with pipx
for your own user which will make it available globally.
3a. First install pipx
either through your system package manager in the usual way or with pip
as follows:
python3 -m pip install --user pipx
3b. Use pipx
to install python-lsp-server
into an isolated virtual environment with pylsp
made available globally
python3 -m pipx install python-lsp-server
3c. Use pipx
to inject python-lsp-ruff
into the same isolated virtual environment as python-lsp-server
making ruff
(and pylsp
) globally available
python3 -m pipx inject --include-deps python-lsp-server python-lsp-ruff
3d. Use pipx
to inject pylsp-mypy
into the same isolated virtual environment as python-lsp-server
making mypy
etc. globally available
python3 -m pipx inject --include-deps python-lsp-server pylsp-mypy
direnv
rather than pyvenv
. Packages to integrate with Emacs exist. I use envrc
.
I'm encountering an issue where the
flycheck
creates a host of errors that seems to be related to the way thelsp
checker interprets the errors from what appears to be the ruff linteryou can see a screenshow of my emacs window with the error
I'm pasting my emacs
init.el
file belowIf anyone could point me in the right direction on how to fix this and whether this is just a configuration issue or an actual bug triggered by an unusual configuration, that'd be much appreciated...