emacs-lsp / lsp-pyright

lsp-mode :heart: pyright
https://emacs-lsp.github.io/lsp-pyright
GNU General Public License v3.0
291 stars 25 forks source link

lsp-mode doesn't seem to try to load pyright when opening python file #80

Closed CamJN closed 1 year ago

CamJN commented 1 year ago

I have the following in my ~/.emacs.d/init.el:

(require 'lsp-pyright)
(with-eval-after-load 'lsp-mode
  (add-hook 'python-mode-hook #'lsp-deferred)
)

and when I open a python file I see the following in the minibuffer: Unable to find installed server supporting this file. The following servers could be installed automatically: and the lsp-log says:

Command "pyls" is not present on the path.
Command "pylsp" is not present on the path.

Which seems like emacs isn't even trying to use pyright.

I have lsp-pyright 20221201.1501 and lsp-mode 20230126.1057 installed.

rgri commented 1 year ago

Do you happen to be running DOOM emacs?

CamJN commented 1 year ago

Nope, my own artisanal emacs config.

CamJN commented 1 year ago

Command "ruff-lsp" is not present on the path. has started to appear in the list but pyright still does not.

CamJN commented 1 year ago

Ok so it turns out that at least on macOS, this is completely broken unless you activate a venv in emacs in the python buffer before activating lsp-mode there. Otherwise, for some reason lsp-pyright cannot install pyright, and lsp-mode doesn't even know pyright is an language server for python. No idea why that is.