File tree Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -782,13 +782,24 @@ server."
782782
783783(defun lsp-java--find-project-uri (file-uri )
784784 " Return the java project corresponding FILE-URI."
785- (->> (lsp--uri-to-path file-uri)
786- (lsp-find-workspace 'jdtls )
787- lsp-java--get-project-uris
788- (--filter (s-starts-with? (lsp--uri-to-path it) (lsp--uri-to-path file-uri)))
789- (-max-by (lambda (project-a project-b )
790- (> (length project-a)
791- (length project-b))))))
785+ (if (functionp 'lsp-find-workspace )
786+ (->> (lsp--uri-to-path file-uri)
787+ (lsp-find-workspace 'jdtls )
788+ lsp-java--get-project-uris
789+ (--filter (s-starts-with? (lsp--uri-to-path it) (lsp--uri-to-path file-uri)))
790+ (-max-by (lambda (project-a project-b )
791+ (> (length project-a)
792+ (length project-b)))))
793+ (->> lsp--workspaces
794+ ht-values
795+ -uniq
796+ (-map 'lsp-java--get-project-uris )
797+ -flatten
798+ (--filter (s-starts-with? (lsp--uri-to-path it)
799+ (lsp--uri-to-path file-uri)))
800+ (-max-by (lambda (project-a project-b )
801+ (> (length project-a)
802+ (length project-b)))))))
792803
793804(defun lsp-java--before-start (&rest _args )
794805 " Initialize lsp java variables."
You can’t perform that action at this time.
0 commit comments