reddit / emacs

LSP Mode no output whatsoever

Under-Estimated · 2022-08-23 14:25
i am trying to get LSP mode to work, using Python as a test case. I have Pyright installed and on my PATH. `executable-find` also finds `pyright.cmd`. Here is my relevant config: ```el (use-package lsp-mode :config (lsp-enable-which-key-integration t)) (use-package lsp-pyright :hook (python-mode . (lambda () (require 'lsp-pyright) (lsp)))) ``` when I open a new buffer with Python Mode and then `lsp-describe-session`, I get nothing. When I run `lsp` I get nothing. When I run `lsp` for an Emacs Lisp file, I get errors saying there is no languages server installed for that language. I have spent many hours trying to solve this but I can't find anything.
paretoOptimalDev · 2022-08-23 15:01
Toggle the lsp-log-io variable, restart everything, then call lsp-workspace-show-log and paste buffer output here. Also https://emacs-lsp.github.io/lsp-mode/page/troubleshooting/
lebensterben · 2022-08-23 16:19
> When I run lsp for an Emacs Lisp file, I get errors saying there is no languages server installed for that language. This is the expected behavior. You should try to do that in a python file and see what happens.
kiennq · 2022-08-23 18:01
Also lsp-mode provides language server auto-installation as well. You should try to open a python file (not just a new buffer without file) and then will have the language server installation offered
Under-Estimated · 2022-08-23 23:33
Yeah, i know. Is it because lsp doesn’t work for a buffer without an underlying file?
lebensterben · 2022-08-23 23:47
nope, it's because lsp-mode (and the lsp command) requires an actual language server. and there's no language server for emacs lisp file.
Under-Estimated · 2022-08-23 23:50
I do have a language server for python installed though
lebensterben · 2022-08-23 23:51
so what happens if you call lsp command in a python file?
Under-Estimated · 2022-08-24 00:03
It returns nil and nothing happens
lebensterben · 2022-08-24 00:09
This doesn't seem like an error (there's no actual error thrown here)... I suggest you go to lsp-mode's discord server and ask them for help. I don't use M$ Windows so I really am not familiar with how it works.
yyoncho · 2022-08-24 20:27
M-x lsp will start language server for the current file if there is language server that supports that format. Similarly, in vscode if you haven't installed java extension and you open java file you won't get completion.
Under-Estimated · 2022-08-24 22:59
I have installed the language server though. Also when there’s no suitable language server it should create a warning message like it did for emacs lisp