lsp-mode icon indicating copy to clipboard operation
lsp-mode copied to clipboard

question about proper setup of TRAMP for Spacemacs

Open xyderos opened this issue 3 years ago • 5 comments

I have set up my Golang language server(gopls) and some helper extensions as mentioned in the go layer at Spacemacs.

I tried to ssh into a pc via TRAMP and open a file remotely, I opened the file but I thought that gopls would work locally(it didn't).

I got this output from Spacemacs:

1. The language you are trying to use does not have built-in support in lsp-mode. You must install the required support manually. Examples of this are lsp-java or lsp-metals. 2. The language server that you expect to run is not configured to run for major mode go-mode. You may check that by checking the :major-modes that are passed to lsp-register-client. 3. lsp-mode doesn't have any integration for the language behind go-mode. Refer to https://emacs-lsp.github.io/lsp-mode/page/languages and https://langserver.org/ . 4. You are over tramp. In this case follow https://emacs-lsp.github.io/lsp-mode/page/remote/. 5. You have disabled the lsp-mode clients for that file. (Check lsp-enabled-clients and lsp-disabled-clients).

I installed gopls on the remote, added it in the path and I also made a .dir-locals.el file on the remote.

Since the connection is over TRAMP, I checked the link given but I am fairly new to emacs and I dont know where to place the script given, is there a guide or a "plug and play" way to set it up? I tried to put the function inside the user-init() function but I got an error that the function is of type void.

Below is the code snippet I found from the 4th option from the output(:

(lsp-register-client (make-lsp-client :new-connection (lsp-tramp-connection "<binary name (e. g. pyls, rls)>") :major-modes '(python-mode) :remote? t :server-id 'pyls-remote))

xyderos avatar Apr 28 '21 16:04 xyderos

It is currently broken anyway (see #2709 ) so you'd be better off avoiding LSP-over-TRAMP at the moment

zilti avatar May 06 '21 12:05 zilti

any updates on this?

xyderos avatar Aug 10 '21 17:08 xyderos

Any updates?

sstepashka avatar Mar 01 '22 06:03 sstepashka

no updates

uncomfyhalomacro avatar Aug 23 '23 00:08 uncomfyhalomacro

@xyderos here you go

https://codeberg.org/uncomfyhalomacro/erudite-macs/src/commit/463256c5ab046fd458fb86098d936b5362a7ef02/modules/erudite-languages.el#L42-L49

Tested on a go project zk:

image

uncomfyhalomacro avatar Aug 24 '23 02:08 uncomfyhalomacro