Description
Thank you for the bug report
- I am using the latest version of
lsp-mode
related packages. - I checked FAQ and Troubleshooting sections
- You may also try reproduce the issue using clean environment using the following command:
M-x lsp-start-plain
Bug description
I have been using the nextflow language server and tried to use it both locally and on remote host. I have set the path of the server file as follow:
(setq lsp-nextflow-server-file "~/nextflow_language_server/language-server-all.jar")
The tilde is well expanded when local but when I connect to the remote host where I stored my jar in the same path as locally the server can't be started.
Steps to reproduce
Just use the tilde to define the path to the jar of the server file as I did:
(setq lsp-nextflow-server-file "~/nextflow_language_server/language-server-all.jar")
Then try to connect locally and on a remote host where you stored the jar in the same path. It should faill for the remote host. Now just replace in the line before the tilde (~) by the full path on remote host and it will work on the remote host but not on your local host if your home dir is not the same (as it happens for a lot of people).
Expected behavior
Right path expansion when on remote host
Which Language Server did you use?
nextflow language server
OS
Linux
Error callstack
This doesn't return any bug or traceback you can track
Anything else?
I did a hotfix in the lsp-nextflow.el as follow:
replace the function lsp-nextflow-server-command
by the following function:
(defun lsp-nextflow-server-command ()
(if (file-remote-p default-directory)
(setq lsp-nextflow-server-file lsp-nextflow-server-file-remote) (setq lsp-nextflow-server-file lsp-nextflow-server-file-local))
`("java" "-jar" ,(substitute-in-file-name lsp-nextflow-server-file)))
Then add two new variables (in your .emacs) that will hold the full path of the remote jar and local jar and named:
(setq lsp-nextflow-server-file-local "/full_path_local_home/nextflow_language_server/language-server-all.jar")
(setq lsp-nextflow-server-file-remote "/full_path_home/nextflow_language_server/language-server-all.jar")
This hotfix should work as I tested it.