I wish to run LSP using the pyls from the virtualenv of my project.
I don't have pyls installed globally (only in the local virtualenv).
I found this snippet online:
(lsp-define-stdio-client lsp-python "python"
#'projectile-project-root
'("pyls"))
However the function lsp-define-stdio-client has been deprecated.
I can enable lsp with python-mode, and when opening a python file, I get a message saying LSP :: No LSP server running for python-mode (which is expected), then run:
(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection "/path/to/my/project/bin/pyls")
:major-modes '(python-mode)
:server-id 'pyls))
And finally run lsp from the buffer containing the python file.
However I would like this to be done automatically (when I open a python file, emacs finds the corresponding pyls and runs it).
Is there a way to do this?