emacs-lsp / lsp-mode

Emacs client/library for the Language Server Protocol
https://emacs-lsp.github.io/lsp-mode
GNU General Public License v3.0
4.76k stars 874 forks source link

lsp-mode using shell-file-name for TRAMP connections #4371

Open cj-obrien opened 6 months ago

cj-obrien commented 6 months ago

Thank you for the bug report

Bug description

lsp-mode.el uses shell-file-name to launch the language server (clangd, in my case) even when connected to a remote host via TRAMP. I use fish on my local host, but it is not installed on a remote machine I use for development; this prevents me from using lsp-mode unless I first customize shell-file-name.

Surely the TRAMP remote-shell property would be a more appropriate choice?

https://www.gnu.org/software/tramp/#Predefined-connection-information

Steps to reproduce

  1. Launch emacs from fish shell
  2. Browse remote host via TRAMP
  3. Open C source file on remote host
  4. Configure project root when prompted
  5. Receive notification that clangd process has failed to start
  6. Check clangd-tramp::stderr buffer and observe that clangd did not start because /usr/bin/fish was not found.

Expected behavior

The shell specified by the TRAMP remote-shell property for this host is used in place of fish

Which Language Server did you use?

lsp-clangd

OS

Linux

Error callstack

No response

Anything else?

No response

sprig commented 3 weeks ago

Affected by same issue. The PR fixes it for me