reddit / emacs

Eglot not working over tramp out of the box?

CorysInTheHouse69 · 2022-12-08 03:56
I’m using tramp to connect to a server to edit a file. When I `M-x eglot` I get the following prompt: `Sorry, couldn’t guess for python-mode! Enter the program to execute (or <host>:<port>):` When given an lsp server like `pylsp` it either fails connection or cannot find the executable. I’m using eglot and tramp with no settings. Straight out of the box.
ieure · 2022-12-08 05:50
*Do not* let the tramp out of the box. No telling what might happen.
soumya6097 · 2022-12-08 09:26
1. Do you have the pyright/pylsp on the remote server? 2. If yes then is it in a common installation path like /usr/local/bin or /usr/bin/ ? 3. If yes and you still see the same problem, then set the tramp-remote-path in init file such as : `(connection-local-set-profile-variables 'remote-path-mylinux` `'((tramp-remote-path . ("*/bin" "/usr/local/bin" tramp-default-remote-path))))` `(connection-local-set-profiles` `'(:application tramp :machine "mylinux") 'remote-path-mylinux)` 4. After adding these setting and restarting emacs, don't forget to do M-x tramp-cleanup-all-connections. 5. Then M-x eglot. I Hope it works.
7890yuiop · 2022-12-08 09:33
This stuff is heavily in flux. Which versions of everything are you using?
404cn · 2022-12-08 13:43
I can confirm that's tramp path problem, eglot work out of box, not tramp.
[deleted] · 2022-12-08 17:05
[deleted]
CorysInTheHouse69 · 2022-12-08 17:06
Thanks. And if the language server is not on the server then is the best method to use sshfs?
soumya6097 · 2022-12-08 20:04
Yes. That's the only option then.