File tree Expand file tree Collapse file tree 4 files changed +35
-2
lines changed
doc/modules/ROOT/pages/basics Expand file tree Collapse file tree 4 files changed +35
-2
lines changed Original file line number Diff line number Diff line change 5
5
### New features
6
6
7
7
- [ #3262 ] ( https://github.com/clojure-emacs/cider/issues/3262 ) : Add navigation functionality to ` npfb ` keys inside the data inspector's buffer.
8
+ - [ #3310 ] ( https://github.com/clojure-emacs/cider/issues/3310 ) : Add ability to use custom coordinates in jack-in-dependecies
8
9
9
10
### Changes
10
11
Original file line number Diff line number Diff line change @@ -708,7 +708,15 @@ one used."
708
708
; ; `java.lang.IllegalArgumentException: Duplicate key [...]`:
709
709
(cider--dedupe-deps)
710
710
(seq-map (lambda (dep )
711
- (format " %s {:mvn/version \" %s \" }" (car dep) (cadr dep))))))
711
+ (if (listp (cadr dep))
712
+ (format " %s {%s }"
713
+ (car dep)
714
+ (seq-reduce
715
+ (lambda (acc v )
716
+ (concat acc (format " :%s \" %s \" " (car v) (cdr v))))
717
+ (cadr dep)
718
+ " " ))
719
+ (format " %s {:mvn/version \" %s \" }" (car dep) (cadr dep)))))))
712
720
(middleware (mapconcat
713
721
(apply-partially #'format " %s" )
714
722
(cider-jack-in-normalized-nrepl-middlewares)
Original file line number Diff line number Diff line change @@ -86,6 +86,13 @@ Here's how you can modify the injected dependencies for `cider-jack-in-clj`:
86
86
;; auto-inject version 1.0 of the library foo/bar
87
87
(cider-add-to-alist 'cider-jack-in-dependencies
88
88
"foo/bar" "1.0")
89
+ ;; if you want to have full control over the coordinate description set it as an alist
90
+ ;; auto-inject {:git/sha "6ae2b6f71773de7549d7f22759e8b09fec27f0d9" for library org.clojure/tools.deps
91
+ ;; :git/url "https://github.com/clojure/tools.deps/"}
92
+ (cider-add-to-alist 'cider-jack-in-dependencies
93
+ "org.clojure/tools.deps"
94
+ '(("git/sha" . "6ae2b6f71773de7549d7f22759e8b09fec27f0d9")
95
+ ("git/url" . "https://github.com/clojure/tools.deps/")))
89
96
----
90
97
91
98
IMPORTANT: Always use the fully qualified `group/artifact` (e.g. `re-frame/re-frame`) in these dependencies, since only Leiningen supports the bare `re-frame` syntax.
Original file line number Diff line number Diff line change 506
506
(deps '((" nrepl/nrepl" " 0.9.0" ))))
507
507
(let ((cider-clojure-cli-aliases " :test" ))
508
508
(expect (cider-clojure-cli-jack-in-dependencies " -J-Djdk.attach.allowAttachSelf" nil deps)
509
- :to-equal expected))))))
509
+ :to-equal expected))))
510
+ (it " allows to specify git coordinate as cider-jack-in-dependency"
511
+ (setq-local cider-jack-in-dependencies '((" org.clojure/tools.deps" ((" git/sha" . " 6ae2b6f71773de7549d7f22759e8b09fec27f0d9" )
512
+ (" git/url" . " https://github.com/clojure/tools.deps/" )))))
513
+ (let ((expected (string-join '(" clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version \" 0.9.0\" } "
514
+ " cider/cider-nrepl {:mvn/version \" 0.28.5\" } "
515
+ " org.clojure/tools.deps { :git/sha \" 6ae2b6f71773de7549d7f22759e8b09fec27f0d9\" :git/url \" https://github.com/clojure/tools.deps/\" }} "
516
+ " :aliases {:cider/nrepl {:main-opts [\" -m\" \" nrepl.cmdline\" "
517
+ " \" --middleware\" \" [cider.nrepl/cider-middleware]\" ]}}}' -M:cider/nrepl" )
518
+ " " )))
519
+ (setq-local cider-allow-jack-in-without-project t )
520
+ (setq-local cider-clojure-cli-command " clojure" )
521
+ (setq-local cider-inject-dependencies-at-jack-in t )
522
+ (setq-local cider-clojure-cli-aliases nil )
523
+ (spy-on 'cider-project-type :and-return-value 'clojure-cli )
524
+ (spy-on 'cider-jack-in-resolve-command :and-return-value " clojure" )
525
+ (expect (plist-get (cider--update-jack-in-cmd nil ) :jack-in-cmd )
526
+ :to-equal expected)))))
510
527
511
528
(defmacro with-temp-shadow-config (contents &rest body )
512
529
" Run BODY with a mocked shadow-cljs.edn project file with the CONTENTS."
You can’t perform that action at this time.
0 commit comments