branch: externals/jarchive
commit 81c4b345bf6a627fe8e9d96de0343189cd242e5e
Author: dannyfreeman <[email protected]>
Commit: dannyfreeman <[email protected]>
Set dependency-scheme to "jar" on clojure-lsp initialization
Without this, jarchive won't work. Another option would be to enable
working with zipfile type URIs
---
jarchive.el | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/jarchive.el b/jarchive.el
index 44f6b6b294..587ba747a7 100644
--- a/jarchive.el
+++ b/jarchive.el
@@ -106,11 +106,20 @@ TODO: this might be unnecessary, try to remove"
(and (string-match-p jarchive--uri-regex buffer-file-name)
t))
+;; Eventually clojure-lsp devs may make this the default.
+(defvar jarchive-eglot-clojure-lsp-initialization-options '(:dependency-scheme
"jar")
+ "If non-nil, use these options when starting clojure-lsp servers with
eglot.")
+
;;;###autoload
(defun jarchive-setup ()
+ "setup jarchive, enabling emacs to open files inside jar archives.
+the files can be identified with the `jar' uri scheme."
(interactive)
(with-eval-after-load 'eglot
- (setq eglot-preserve-jar-uri t))
+ (when (and jarchive-eglot-clojure-lsp-initialization-options (boundp
'eglot-server-programs))
+ (add-to-list 'eglot-server-programs
+ `((clojure-mode clojurescript-mode clojurec-mode) .
+ ("clojure-lsp" :initializationOptions
,jarchive-eglot-clojure-lsp-initialization-options)))))
(add-to-list 'file-name-handler-alist (cons jarchive--uri-regex
#'jarchive--file-name-handler))
(add-to-list 'find-file-not-found-functions #'jarchive--find-file-not-found))