@@ -65,6 +65,11 @@ Use http://download.eclipse.org/che/che-ls-jdt/snapshots/che-jdt-language-server
6565 " face for activity message"
6666 :group 'lsp-java )
6767
68+ (defcustom lsp-java-project-types '(" pom.xml" " build.gradle" " build.gradle.kts" " .project" )
69+ " File names of possible project configuration files found at project root."
70+ :group 'lsp-java
71+ :type '(repeat file))
72+
6873(defcustom lsp-java-workspace-dir (expand-file-name (locate-user-emacs-file " workspace/" ))
6974 " LSP java workspace directory."
7075 :group 'lsp-java
@@ -472,9 +477,8 @@ The current directory is assumed to be the java project’s root otherwise."
472477 ((string= default-directory lsp-java-workspace-cache-dir) default-directory)
473478 ((and (featurep 'projectile ) (projectile-project-p)) (projectile-project-root))
474479 ((vc-backend default-directory) (expand-file-name (vc-root-dir )))
475- (t (let ((project-types '(" pom.xml" " build.gradle" " .project" )))
476- (or (seq-some (lambda (file ) (locate-dominating-file default-directory file)) project-types)
477- default-directory)))))
480+ (t (or (seq-some (lambda (file ) (locate-dominating-file default-directory file)) lsp-java-project-types)
481+ default-directory))))
478482
479483(defun lsp-java--language-status-callback (workspace params )
480484 " Callback for client initialized.
@@ -1122,7 +1126,7 @@ PROJECT-URI uri of the item."
11221126 (" registerOptions" (ht (" watchers"
11231127 (vector (ht (" globPattern" " **/*.java" ))
11241128 (ht (" globPattern" " **/pom.xml" ))
1125- (ht (" globPattern" " **/*.gradle" ))
1129+ (ht (" globPattern" " **/*.gradle{,.kts} " ))
11261130 (ht (" globPattern" " **/.project" ))
11271131 (ht (" globPattern" " **/.classpath" ))
11281132 (ht (" globPattern" " **/settings/*.prefs" ))))))))))
0 commit comments