doomemacs / doomemacs/core

Remote LSP servers (over Tramp) cannot be found and started

Open
#8,626 0 comments 0 reactions 0 assignees View on GitHub
is:bug needs-triage
Dominant language
Emacs Lisp
Stars
22.7k
Forks
3.1k
Avg merge
10h 46m
Merged PRs (30d)
4

Description

### Describe your issue

Let's say that we want to use `pyright` as LSP server for python files. If a local python file is opened and pyright is installed with `lsp-install-server`, the executable `/home/local_user/.config/emacs/.local/etc/lsp/npm/pyright/bin/pyright-langserver` is correctly found. All works well.

Something is however not working well when using tramp. If you now want to open a remote python file through SSH with tramp, and you have pyright installed in the remote location, the pyright executable is not correctly found. In fact, the same executable path used for the local pyright is attempted to be used in the remote location. That is, emacs tries to execute the file:
```sh
/home/local_user/.config/emacs/.local/etc/lsp/npm/pyright/bin/pyright-langserver
```
This is a problem if you don't have Doom Emacs in the remote location and the `local_user` does not match the `remote_user`.

### Steps to reproduce

1. Add to the init.el file the `python` module with `+lsp` and `+pyright` flag.
2. Configure a remote SSH host in `~/.ssh/config such as with
```conf
Host remotemachine
HostName 192.168.0.10
User some_remote_user
```
3. Install pyright in `remotemachine`
4. Open a Python file with emacs through tramp using:
```sh
/ssh:remotemachine:python_file.py
```
4. Observe how pyright cannot be found and LSP will fail. One of the LSP log files will say that the pyright executable could not be found.

### System information

https://pastebin.com/5zjj6pga

### Disclosures

- [ ] This issue was written with/by AI.

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure using the init.el LSP configuration, the ~/.ssh/config host, and the /ssh:remotemachine:python_file.py Tramp path. Start by inspecting the LSP log and how the pyright executable path is resolved for local versus remote files. Done means a remote Python file finds and starts the pyright installation on the remote host instead of attempting the local executable path.

Written by the indexing model from the issue text.

Assessment

Tech stack
emacs-lisp
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.