You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Fix lsp-mode's tramp support
- This fixes the implementation of `lsp-mode` tramp support. After this PR the
remote clients will be automatically registered and in most of the cases it will
work out of the box. The remote connection is managed to a way similar to what
eglot does.
Fixes#4158Fixes#4150Fixes#4158Fixes#4150Fixes#3841Fixes#3642Fixes#3579Fixes#3530Fixes#3491Fixes#3490Fixes#3391Fixes#3369Fixes#3364Fixes#3020Fixes#3018Fixes#3020
* Use executable-find with remote = t everywhere
Copy file name to clipboardExpand all lines: docs/page/remote.md
+2-21
Original file line number
Diff line number
Diff line change
@@ -5,33 +5,14 @@ root_file: docs/page/remote.md
5
5
6
6
## TRAMP
7
7
8
-
LSP mode has support for tramp buffers with the following requirements:
8
+
`lsp-mode` has support for tramp buffers with the following requirements:
9
9
10
10
- The language server has to be present on the remote server.
11
11
- Having multi folder language server (like [Eclipse JDT LS](https://github.com/eclipse/eclipse.jdt.ls)) cannot have local and remote workspace folders.
12
12
13
13
### How does it work?
14
14
15
-
`lsp-mode` detects whether a particular file is located on remote machine and looks for a client which matches current file and it is marked as `:remote?` t. Then `lsp-mode` starts the client through tramp.
16
-
17
-
### Sample configuration
18
-
19
-
Here it is example how you can configure python language server to work when using `TRAMP`. Note that if you are trying to convert existing language server configuration you should copy all of it's properties(e. g. `:request-handlers`, `activation-fn`, etc). Also, when you are doing that you should make sure that none of the custom language server settings are not pointing to local path because those settings will be sent to the remote server.
20
-
21
-
```elisp
22
-
(lsp-register-client
23
-
(make-lsp-client :new-connection (lsp-tramp-connection "<binary name (e. g. pyls, rls)>")
24
-
:major-modes '(python-mode)
25
-
:remote? t
26
-
:server-id 'pyls-remote))
27
-
```
28
-
29
-
_Note:_ when you do not have root privileges on the remote machine to put the language server on the path you may alter the remote path by changing `tramp-remote-path`.
30
-
31
-
### Dealing with stderr
32
-
33
-
With TRAMP, Emacs does not have an easy way to distinguish stdout and stderr, so when the underlying LSP process writes to stderr, it breaks the `lsp-mode` parser. As a workaround, `lsp-mode` is redirecting stderr to `/tmp/<process-name>-<id>~stderr`.
34
-
15
+
`lsp-mode` detects whether a particular file is located on remote machine and looks for a client which matches current file and it is marked as `:remote?` t. Then `lsp-mode` starts the client through tramp. By default `lsp-mode` will copy the local client and mark it as `remote? t`. In most of the cases it is good enough but certain cases this may not work (e. g. if the server configuration contains references to local paths). In this case the user is supposed to create `.dir-local` configuration to override the references to local paths or open an issue on `lsp-mode` side to make the setting remote agnostic. To turn of automatic remote clients registration you can set `lsp-auto-register-remote-clients` to `nil`.
0 commit comments