Skip to content

Commit 6631251

Browse files
Use local path for file args to java for tramp support (#394)
`lsp-java-server-install-dir` (for example) is user config that can be set to remote directory in user config. But, the command takes the remote path as is and passes to java command which fails to resolve the path. Using local file for the command running on remote server solves the problem and starts server normally.
1 parent 94742f3 commit 6631251

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lsp-java.el

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -675,8 +675,8 @@ FULL specify whether full or incremental build will be performed."
675675

676676
(defun lsp-java--ls-command ()
677677
"LS startup command."
678-
(let ((server-jar (lsp-java--locate-server-jar))
679-
(server-config (lsp-java--locate-server-config))
678+
(let ((server-jar (lsp-file-local-name (lsp-java--locate-server-jar)))
679+
(server-config (lsp-file-local-name (lsp-java--locate-server-config)))
680680
(java-9-args (when (lsp-java--java-9-plus-p)
681681
lsp-java-9-args)))
682682
(lsp-java--ensure-dir lsp-java-workspace-dir)
@@ -692,7 +692,7 @@ FULL specify whether full or incremental build will be performed."
692692
"-configuration"
693693
,server-config
694694
"-data"
695-
,lsp-java-workspace-dir
695+
,(lsp-file-local-name lsp-java-workspace-dir)
696696
,@java-9-args)))
697697

698698
(eval-and-compile
@@ -803,7 +803,7 @@ PARAMS progress report notification data."
803803

804804
(defun lsp-java--bundles-dir ()
805805
"Get default bundles dir."
806-
(concat (file-name-as-directory lsp-java-server-install-dir) "bundles"))
806+
(concat (lsp-file-local-name (file-name-as-directory lsp-java-server-install-dir)) "bundles"))
807807

808808
(defun lsp-java--ensure-server (_client callback error-callback _update?)
809809
"Ensure that JDT server and the other configuration."

0 commit comments

Comments
 (0)