Skip to content

Commit 5755472

Browse files
committed
Always expand file name for the root dir.
Otherwise lsp-mode may generate invalid URI such as file://~/path/to/project
1 parent ed23aae commit 5755472

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lsp-javacomp.el

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,13 @@ Requires to be ended with a slash."
7171
"Retrieves the root directory of the java project root if available.
7272
7373
The current directory is assumed to be the java project’s root otherwise."
74-
(cond
75-
((and (featurep 'projectile) (projectile-project-p)) (projectile-project-root))
76-
((vc-backend default-directory) (expand-file-name (vc-root-dir)))
77-
(t (let ((project-types '("pom.xml" "build.gradle" ".project" "WORKSPACE")))
74+
(expand-file-name
75+
(cond
76+
((and (featurep 'projectile) (projectile-project-p)) (projectile-project-root))
77+
((vc-backend default-directory) (vc-root-dir))
78+
(t (let ((project-types '("pom.xml" "build.gradle" ".project" "WORKSPACE")))
7879
(or (seq-some (lambda (file) (locate-dominating-file default-directory file)) project-types)
79-
default-directory)))))
80+
default-directory))))))
8081

8182
;;;###autoload
8283
(defun lsp-javacomp-install-server (&optional prompt-exists)

0 commit comments

Comments
 (0)