diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ebfb6240..66efda114 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ ## master (unreleased) +### New features +- CIDER [History](https://docs.cider.mx/cider/repl/history.html): Add a command to delete history item at point. + +### Changes + +- Bump the injected nREPL version to [1.3.1](https://github.com/nrepl/nrepl/blob/master/CHANGELOG.md#131-2025-01-01). +- Bump the injected `cider-nrepl` to [0.51.0](https://github.com/clojure-emacs/cider-nrepl/blob/master/CHANGELOG.md#0510-2025-01-01). +- [#3574](https://github.com/clojure-emacs/cider/issues/3574): New value `per-project` for `cider-repl-history-file` to save the history on a per-project basis. + +### Bugs fixed + +- [#3763](https://github.com/clojure-emacs/cider/issues/3763): Fix `cider-docview-render` completion popup error when symbol being completed does not have a docstring. + ## 1.16.1 (2024-12-03) ### Changes diff --git a/cider-doc.el b/cider-doc.el index addfdeb82..d76c205e2 100644 --- a/cider-doc.el +++ b/cider-doc.el @@ -428,10 +428,11 @@ in a COMPACT format is specified, FOR-TOOLTIP if specified." "doc-first-sentence-fragments" (nrepl-dict-get info "doc-first-sentence-fragments")))) (fetched-doc (nrepl-dict-get info "doc")) (doc (or rendered-fragments - (if compact - (cider-docstring--trim - (cider-docstring--format fetched-doc)) - fetched-doc) + (when fetched-doc + (if compact + (cider-docstring--trim + (cider-docstring--format fetched-doc)) + fetched-doc)) (unless compact "Not documented."))) (url (nrepl-dict-get info "url")) diff --git a/cider-repl-history.el b/cider-repl-history.el index ec19298ad..c205b6502 100644 --- a/cider-repl-history.el +++ b/cider-repl-history.el @@ -220,7 +220,6 @@ call `cider-repl-history' again.") (defvar cider-repl-history-previous-overlay nil "Previous overlay within *cider-repl-history* buffer.") - (defun cider-repl-history-get-history () "Function to retrieve history from the REPL buffer." (if cider-repl-history-repl-buffer @@ -576,6 +575,16 @@ text from the *cider-repl-history* buffer." (with-current-buffer cider-repl-history-repl-buffer (undo))) +(defun cider-repl-history-delete-entry-at-point () + "Delete history entry (at point)." + (interactive) + (let* ((orig (point)) + (str (cider-repl-history-current-string orig))) + (with-current-buffer cider-repl-history-repl-buffer + (delete str cider-repl-input-history)) + (cider-repl-history-update) + (goto-char orig))) + (defun cider-repl-history-setup (repl-win repl-buf history-buf &optional regexp) "Setup. REPL-WIN and REPL-BUF are where to insert commands; @@ -637,16 +646,17 @@ HISTORY-BUF is the history, and optional arg REGEXP is a filter." #'cider-repl-history-update-highlighted-entry nil t)) (message - (let ((entry (if (= 1 (length cider-command-history)) - "entry" - "entries"))) + (let* ((history-length (length cider-command-history)) + (entry (if (= 1 history-length) + "entry" + "entries"))) (concat (if (and (not regexp) cider-repl-history-display-duplicates) (format "%s %s in the command history." - (length cider-command-history) entry) + history-length entry) (format "%s (of %s) %s in the command history shown." - (length items) (length cider-command-history) entry)) + (length items) history-length entry)) (substitute-command-keys (concat " Type \\[cider-repl-history-quit] to quit. " "\\[describe-mode] for help."))))) @@ -693,6 +703,7 @@ HISTORY-BUF is the history, and optional arg REGEXP is a filter." (define-key map (kbd "g") #'cider-repl-history-update) (define-key map (kbd "q") #'cider-repl-history-quit) (define-key map (kbd "U") #'cider-repl-history-undo-other-window) + (define-key map (kbd "D") #'cider-repl-history-delete-entry-at-point) (define-key map (kbd "?") #'describe-mode) (define-key map (kbd "h") #'describe-mode) map)) diff --git a/cider-repl.el b/cider-repl.el index 9fd17c4f6..6c89426fb 100644 --- a/cider-repl.el +++ b/cider-repl.el @@ -194,12 +194,6 @@ CIDER 1.7." This property value must be unique to avoid having adjacent inputs be joined together.") -(defvar-local cider-repl-input-history '() - "History list of strings read from the REPL buffer.") - -(defvar-local cider-repl-input-history-items-added 0 - "Variable counting the items added in the current session.") - (defvar-local cider-repl-output-start nil "Marker for the start of output. Currently its only purpose is to facilitate `cider-repl-clear-buffer'.") @@ -1468,13 +1462,15 @@ WIN, BUFFER and POS are the window, buffer and point under mouse position." (defvar cider-repl-history-pattern nil "The regexp most recently used for finding input history.") +(defvar cider-repl-input-history '() + "History list of strings read from the REPL buffer.") + (defun cider-repl--add-to-input-history (string) "Add STRING to the input history. Empty strings and duplicates are ignored." (unless (or (equal string "") (equal string (car cider-repl-input-history))) - (push string cider-repl-input-history) - (cl-incf cider-repl-input-history-items-added))) + (push string cider-repl-input-history))) (defun cider-repl-delete-current-input () "Delete all text after the prompt." @@ -1593,9 +1589,11 @@ If USE-CURRENT-INPUT is non-nil, use the current input." :safe #'integerp) (defcustom cider-repl-history-file nil - "File to save the persistent REPL history to." - :type 'string - :safe #'stringp) + "File to save the persistent REPL history to. +If this is set to a path the history will be global to all projects. If this is +set to `per-project', the history will be stored in a file (.cider-history) at +the root of each project." + :type '(choice string symbol)) (defun cider-repl--history-read-filename () "Ask the user which file to use, defaulting `cider-repl-history-file'." @@ -1612,6 +1610,12 @@ It does not yet set the input history." (read (current-buffer)))) '())) +(defun cider-repl--find-dir-for-history () + "Find the first suitable directory to store the project's history." + (seq-find + (lambda (dir) (and (not (null dir)) (not (tramp-tramp-file-p dir)))) + (list nrepl-project-dir (clojure-project-dir) default-directory))) + (defun cider-repl-history-load (&optional filename) "Load history from FILENAME into current session. FILENAME defaults to the value of `cider-repl-history-file' but user @@ -1619,21 +1623,35 @@ defined filenames can be used to read special history files. The value of `cider-repl-input-history' is set by this function." (interactive (list (cider-repl--history-read-filename))) - (let ((f (or filename cider-repl-history-file))) - ;; TODO: probably need to set cider-repl-input-history-position as well. - ;; in a fresh connection the newest item in the list is currently - ;; not available. After sending one input, everything seems to work. - (setq cider-repl-input-history (cider-repl--history-read f)))) + (cond + (filename (setq cider-repl-history-file filename)) + ((equal 'per-project cider-repl-history-file) + (make-local-variable 'cider-repl-input-history) + (when-let ((dir (cider-repl--find-dir-for-history))) + (setq-local + cider-repl-history-file (expand-file-name ".cider-history" dir))))) + (when cider-repl-history-file + (condition-case nil + ;; TODO: probably need to set cider-repl-input-history-position as + ;; well. In a fresh connection the newest item in the list is + ;; currently not available. After sending one input, everything + ;; seems to work. + (setq + cider-repl-input-history + (cider-repl--history-read cider-repl-history-file)) + (error + (message + "Malformed cider-repl-history-file: %s" cider-repl-history-file))) + (add-hook 'kill-buffer-hook #'cider-repl-history-just-save t t) + (add-hook 'kill-emacs-hook #'cider-repl-history-save-all))) (defun cider-repl--history-write (filename) "Write history to FILENAME. Currently coding system for writing the contents is hardwired to utf-8-unix." - (let* ((mhist (cider-repl--histories-merge cider-repl-input-history - cider-repl-input-history-items-added - (cider-repl--history-read filename))) + (let* ((end (min (length cider-repl-input-history) cider-repl-history-size)) ;; newest items are at the beginning of the list, thus 0 - (hist (cl-subseq mhist 0 (min (length mhist) cider-repl-history-size)))) + (hist (cl-subseq cider-repl-input-history 0 end))) (unless (file-writable-p filename) (error (format "History file not writable: %s" filename))) (let ((print-length nil) (print-level nil)) @@ -1658,15 +1676,12 @@ This function is meant to be used in hooks to avoid lambda constructs." (cider-repl-history-save cider-repl-history-file)) -;; SLIME has different semantics and will not save any duplicates. -;; we keep track of how many items were added to the history in the -;; current session in `cider-repl--add-to-input-history' and merge only the -;; new items with the current history found in the file, which may -;; have been changed in the meantime by another session. -(defun cider-repl--histories-merge (session-hist n-added-items file-hist) - "Merge histories from SESSION-HIST adding N-ADDED-ITEMS into FILE-HIST." - (append (cl-subseq session-hist 0 n-added-items) - file-hist)) +(defun cider-repl-history-save-all () + "Save all histories." + (dolist (buffer (buffer-list)) + (with-current-buffer buffer + (when (equal major-mode 'cider-repl-mode) + (cider-repl-history-just-save))))) ;;; REPL shortcuts @@ -2051,13 +2066,7 @@ in an unexpected place." (setq-local prettify-symbols-alist clojure--prettify-symbols-alist) ;; apply dir-local variables to REPL buffers (hack-dir-local-variables-non-file-buffer) - (when cider-repl-history-file - (condition-case nil - (cider-repl-history-load cider-repl-history-file) - (error - (message "Malformed cider-repl-history-file: %s" cider-repl-history-file))) - (add-hook 'kill-buffer-hook #'cider-repl-history-just-save t t) - (add-hook 'kill-emacs-hook #'cider-repl-history-just-save)) + (cider-repl-history-load) (add-hook 'completion-at-point-functions #'cider-complete-at-point nil t) (add-hook 'paredit-mode-hook (lambda () (clojure-paredit-setup cider-repl-mode-map))) (cider-repl-setup-paredit)) diff --git a/cider.el b/cider.el index e58a9fe2f..4f197ac3e 100644 --- a/cider.el +++ b/cider.el @@ -560,7 +560,7 @@ Throws an error if PROJECT-TYPE is unknown." "List of dependencies where elements are lists of artifact name and version.") (put 'cider-jack-in-dependencies 'risky-local-variable t) -(defcustom cider-injected-nrepl-version "1.3.0" +(defcustom cider-injected-nrepl-version "1.3.1" "The version of nREPL injected on jack-in. We inject the newest known version of nREPL just in case your version of Boot or Leiningen is bundling an older one." @@ -591,7 +591,7 @@ the artifact.") Used when `cider-jack-in-auto-inject-clojure' is set to `latest'.") -(defconst cider-required-middleware-version "0.50.3" +(defconst cider-required-middleware-version "0.51.0" "The CIDER nREPL version that's known to work properly with CIDER.") (defcustom cider-injected-middleware-version cider-required-middleware-version diff --git a/dev/docker-sample-project/project.clj b/dev/docker-sample-project/project.clj index 08ec5aa34..f2f559c05 100644 --- a/dev/docker-sample-project/project.clj +++ b/dev/docker-sample-project/project.clj @@ -2,4 +2,4 @@ :dependencies [[org.clojure/clojure "1.11.1"] [clj-http "3.12.3"]] :source-paths ["src"] - :plugins [[cider/cider-nrepl "0.50.3"]]) + :plugins [[cider/cider-nrepl "0.51.0"]]) diff --git a/dev/tramp-sample-project/project.clj b/dev/tramp-sample-project/project.clj index b72d27a1b..ca5e187f8 100644 --- a/dev/tramp-sample-project/project.clj +++ b/dev/tramp-sample-project/project.clj @@ -2,5 +2,5 @@ :dependencies [[org.clojure/clojure "1.11.1"] [clj-http "3.12.3"]] :source-paths ["src"] - :plugins [[cider/cider-nrepl "0.50.3"] + :plugins [[cider/cider-nrepl "0.51.0"] [refactor-nrepl "3.9.0"]]) diff --git a/doc/modules/ROOT/pages/basics/middleware_setup.adoc b/doc/modules/ROOT/pages/basics/middleware_setup.adoc index d10d2d044..77c5ff5b2 100644 --- a/doc/modules/ROOT/pages/basics/middleware_setup.adoc +++ b/doc/modules/ROOT/pages/basics/middleware_setup.adoc @@ -32,14 +32,14 @@ Use the convenient plugin for defaults, either in your project's [source,clojure] ---- -:plugins [[cider/cider-nrepl "0.50.3"]] +:plugins [[cider/cider-nrepl "0.51.0"]] ---- A minimal `profiles.clj` for CIDER would be: [source,clojure] ---- -{:repl {:plugins [[cider/cider-nrepl "0.50.3"]]}} +{:repl {:plugins [[cider/cider-nrepl "0.51.0"]]}} ---- WARNING: Be careful not to place this in the `:user` profile, as this way CIDER's @@ -59,7 +59,7 @@ all of their projects using a `~/.boot/profile.boot` file like so: (require 'boot.repl) (swap! boot.repl/*default-dependencies* - concat '[[cider/cider-nrepl "0.50.3"]]) + concat '[[cider/cider-nrepl "0.51.0"]]) (swap! boot.repl/*default-middleware* conj 'cider.nrepl/cider-middleware) @@ -76,11 +76,11 @@ run `cider-connect` or `cider-connect-cljs`. [source,clojure] ---- - :cider-clj {:extra-deps {cider/cider-nrepl {:mvn/version "0.50.3"}} + :cider-clj {:extra-deps {cider/cider-nrepl {:mvn/version "0.51.0"}} :main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]} :cider-cljs {:extra-deps {org.clojure/clojurescript {:mvn/version "1.10.339"} - cider/cider-nrepl {:mvn/version "0.50.3"} + cider/cider-nrepl {:mvn/version "0.51.0"} cider/piggieback {:mvn/version "0.5.3"}} :main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware,cider.piggieback/wrap-cljs-repl]"]} @@ -99,7 +99,7 @@ NOTE: Make sure you're using https://github.com/clojurephant/clojurephant[Clojur ---- dependencies { devImplementation 'nrepl:nrepl:0.9.0' - devImplementation 'cider:cider-nrepl:0.50.3' + devImplementation 'cider:cider-nrepl:0.51.0' } tasks.named('clojureRepl') { diff --git a/doc/modules/ROOT/pages/basics/up_and_running.adoc b/doc/modules/ROOT/pages/basics/up_and_running.adoc index 02cd3e3c0..52aa1757d 100644 --- a/doc/modules/ROOT/pages/basics/up_and_running.adoc +++ b/doc/modules/ROOT/pages/basics/up_and_running.adoc @@ -73,7 +73,7 @@ simple - CIDER simply passes the extra dependencies and nREPL configuration to your build tool in the command it runs to start the nREPL server. Here's how this looks for `tools.deps`: - $ clojure -Sdeps '{:deps {nrepl {:mvn/version "1.3.0"} cider/cider-nrepl {:mvn/version "0.50.3"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]' + $ clojure -Sdeps '{:deps {nrepl {:mvn/version "1.3.1"} cider/cider-nrepl {:mvn/version "0.51.0"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]' TIP: If you don't want `cider-jack-in` to inject dependencies automatically, set `cider-inject-dependencies-at-jack-in` to `nil`. Note that you'll have to setup @@ -350,7 +350,7 @@ It is also possible for plain `clj`, although the command is somewhat longer: [source,sh] ---- -$ clj -Sdeps '{:deps {cider/cider-nrepl {:mvn/version "0.50.3"}}}' -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]" +$ clj -Sdeps '{:deps {cider/cider-nrepl {:mvn/version "0.51.0"}}}' -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]" ---- Alternatively, you can start nREPL either manually or using the facilities diff --git a/doc/modules/ROOT/pages/cljs/shadow-cljs.adoc b/doc/modules/ROOT/pages/cljs/shadow-cljs.adoc index 63a26f705..2c67bf95e 100644 --- a/doc/modules/ROOT/pages/cljs/shadow-cljs.adoc +++ b/doc/modules/ROOT/pages/cljs/shadow-cljs.adoc @@ -62,7 +62,7 @@ And connect to it with `cider-connect`. ...For that to work, `shadow-cljs.edn` contents like the following are assumed: ```clj - :dependencies [[cider/cider-nrepl "0.50.3"] ;; mandatory (unless it's inherited from deps.edn or otherwise present in the classpath of shadow-cljs's JVM process) + :dependencies [[cider/cider-nrepl "0.51.0"] ;; mandatory (unless it's inherited from deps.edn or otherwise present in the classpath of shadow-cljs's JVM process) [refactor-nrepl/refactor-nrepl "3.9.0"]] ;; refactor-nrepl is optional :nrepl {:middleware [cider.nrepl/cider-middleware ;; it's advisable to explicitly add this middleware. It's automatically added by shadow-cljs (if available in the classpath), unless `:nrepl {:cider false}` diff --git a/doc/modules/ROOT/pages/cljs/up_and_running.adoc b/doc/modules/ROOT/pages/cljs/up_and_running.adoc index aec59e935..b0cf32066 100644 --- a/doc/modules/ROOT/pages/cljs/up_and_running.adoc +++ b/doc/modules/ROOT/pages/cljs/up_and_running.adoc @@ -60,8 +60,8 @@ or in `build.gradle`: [source, groovy] ---- dependencies { - devImplementation 'nrepl:nrepl:1.3.0' - devImplementation 'cider:cider-nrepl:0.50.3' + devImplementation 'nrepl:nrepl:1.3.1' + devImplementation 'cider:cider-nrepl:0.51.0' devImplementation 'cider:cider-piggieback:0.5.3' } diff --git a/doc/modules/ROOT/pages/repl/configuration.adoc b/doc/modules/ROOT/pages/repl/configuration.adoc index 774abc889..39458d474 100644 --- a/doc/modules/ROOT/pages/repl/configuration.adoc +++ b/doc/modules/ROOT/pages/repl/configuration.adoc @@ -340,12 +340,21 @@ reset automatically by the `track-state` middleware. (setq cider-repl-history-size 1000) ; the default is 500 ---- -* To store the REPL history in a file: +* To store the REPL history of all projects in a single file: [source,lisp] ---- (setq cider-repl-history-file "path/to/file") ---- -Note that CIDER writes the history to the file when you kill the REPL -buffer, which includes invoking `cider-quit`, or when you quit Emacs. +* To store the REPL history per project (by creating a + `.cider-history` file at the root of each): + +[source,lisp] +---- +(setq cider-repl-history-file 'per-project) +---- + +Note that CIDER writes the history to the file(s) when you kill the +REPL buffer, which includes invoking `cider-quit`, or when you quit +Emacs. diff --git a/doc/modules/ROOT/pages/repl/history.adoc b/doc/modules/ROOT/pages/repl/history.adoc index 7e095ee43..88a34a1a2 100644 --- a/doc/modules/ROOT/pages/repl/history.adoc +++ b/doc/modules/ROOT/pages/repl/history.adoc @@ -175,4 +175,7 @@ There are a number of important keybindings in history buffers. | kbd:[U] | Undo in the REPL buffer. + +| kbd:[D] +| Delete history item (at point). |=== diff --git a/test/cider-tests.el b/test/cider-tests.el index 76dbec9a7..7aba7a6e6 100644 --- a/test/cider-tests.el +++ b/test/cider-tests.el @@ -175,7 +175,7 @@ (describe "when there is a single dependency" (before-each (setq-local cider-injected-nrepl-version "0.9.0") - (setq-local cider-injected-middleware-version "0.50.3") + (setq-local cider-injected-middleware-version "0.51.0") (setq-local cider-jack-in-nrepl-middlewares '("cider.nrepl/cider-middleware")) (setq-local cider-jack-in-dependencies-exclusions '()) (setq-local cider-enrich-classpath t) @@ -186,7 +186,7 @@ :to-equal (concat "update-in :dependencies conj " (shell-quote-argument "[nrepl/nrepl \"0.9.0\"]") " -- update-in :plugins conj " - (shell-quote-argument "[cider/cider-nrepl \"0.50.3\"]") + (shell-quote-argument "[cider/cider-nrepl \"0.51.0\"]") " -- update-in :plugins conj " (shell-quote-argument "[mx.cider/lein-enrich-classpath \"1.19.3\"]") " -- update-in :jvm-opts conj '\"-Djdk.attach.allowAttachSelf\"'" @@ -200,7 +200,7 @@ "update-in :dependencies conj " (shell-quote-argument "[nrepl/nrepl \"0.9.0\" :exclusions [org.clojure/clojure]]") " -- update-in :plugins conj " - (shell-quote-argument "[cider/cider-nrepl \"0.50.3\"]") + (shell-quote-argument "[cider/cider-nrepl \"0.51.0\"]") " -- update-in :plugins conj " (shell-quote-argument "[mx.cider/lein-enrich-classpath \"1.19.3\"]") " -- update-in :jvm-opts conj '\"-Djdk.attach.allowAttachSelf\"'" @@ -213,7 +213,7 @@ :to-equal (concat "update-in :dependencies conj " (shell-quote-argument "[nrepl/nrepl \"0.9.0\" :exclusions [org.clojure/clojure foo.bar/baz]]") " -- update-in :plugins conj " - (shell-quote-argument "[cider/cider-nrepl \"0.50.3\"]") + (shell-quote-argument "[cider/cider-nrepl \"0.51.0\"]") " -- update-in :plugins conj " (shell-quote-argument "[mx.cider/lein-enrich-classpath \"1.19.3\"]") " -- update-in :jvm-opts conj '\"-Djdk.attach.allowAttachSelf\"'" @@ -227,7 +227,7 @@ " -d " (shell-quote-argument "nrepl/nrepl:0.9.0") " -d " - (shell-quote-argument "cider/cider-nrepl:0.50.3") + (shell-quote-argument "cider/cider-nrepl:0.51.0") " cider.tasks/add-middleware" " -m " (shell-quote-argument "cider.nrepl/cider-middleware") @@ -237,7 +237,7 @@ (expect (cider-inject-jack-in-dependencies "--no-daemon" ":clojureRepl" 'gradle) :to-equal (concat "--no-daemon " "-Pjdk.attach.allowAttachSelf " - (shell-quote-argument "-Pdev.clojurephant.jack-in.nrepl=nrepl:nrepl:0.9.0,cider:cider-nrepl:0.50.3") + (shell-quote-argument "-Pdev.clojurephant.jack-in.nrepl=nrepl:nrepl:0.9.0,cider:cider-nrepl:0.51.0") " :clojureRepl " (shell-quote-argument "--middleware=cider.nrepl/cider-middleware"))))) @@ -254,7 +254,7 @@ " -- update-in :plugins conj " (shell-quote-argument "[refactor-nrepl \"2.0.0\"]") " -- update-in :plugins conj " - (shell-quote-argument "[cider/cider-nrepl \"0.50.3\"]") + (shell-quote-argument "[cider/cider-nrepl \"0.51.0\"]") " -- update-in :plugins conj " (shell-quote-argument "[mx.cider/lein-enrich-classpath \"1.19.3\"]") " -- update-in :jvm-opts conj '\"-Djdk.attach.allowAttachSelf\"'" @@ -268,7 +268,7 @@ " -d " (shell-quote-argument "nrepl/nrepl:0.9.0") " -d " - (shell-quote-argument "cider/cider-nrepl:0.50.3") + (shell-quote-argument "cider/cider-nrepl:0.51.0") " -d " (shell-quote-argument "refactor-nrepl:2.0.0") " cider.tasks/add-middleware" @@ -290,7 +290,7 @@ :to-equal (concat "-o -U update-in :dependencies conj " (shell-quote-argument "[nrepl/nrepl \"0.9.0\"]") " -- update-in :plugins conj " - (shell-quote-argument "[cider/cider-nrepl \"0.50.3\"]") + (shell-quote-argument "[cider/cider-nrepl \"0.51.0\"]") " -- update-in :plugins conj " (shell-quote-argument "[mx.cider/lein-enrich-classpath \"1.19.3\"]") " -- update-in :jvm-opts conj '\"-Djdk.attach.allowAttachSelf\"'" @@ -302,7 +302,7 @@ " -d " (shell-quote-argument "nrepl/nrepl:0.9.0") " -d " - (shell-quote-argument "cider/cider-nrepl:0.50.3") + (shell-quote-argument "cider/cider-nrepl:0.51.0") " cider.tasks/add-middleware" " -m " (shell-quote-argument "cider.nrepl/cider-middleware") @@ -311,7 +311,7 @@ (expect (cider-inject-jack-in-dependencies "--no-daemon" ":clojureRepl" 'gradle) :to-equal (concat "--no-daemon " "-Pjdk.attach.allowAttachSelf " - (shell-quote-argument "-Pdev.clojurephant.jack-in.nrepl=nrepl:nrepl:0.9.0,cider:cider-nrepl:0.50.3") + (shell-quote-argument "-Pdev.clojurephant.jack-in.nrepl=nrepl:nrepl:0.9.0,cider:cider-nrepl:0.51.0") " :clojureRepl " (shell-quote-argument "--middleware=cider.nrepl/cider-middleware"))))) @@ -326,14 +326,14 @@ (setq-local cider-jack-in-nrepl-middlewares '(("refactor-nrepl.middleware/wrap-refactor" :predicate middlewares-predicate) "cider.nrepl/cider-middleware" ("another/middleware")))) (it "includes plugins whose predicates return true" (expect (cider-jack-in-normalized-lein-plugins) - :to-equal '(("refactor-nrepl" "2.0.0") ("cider/cider-nrepl" "0.50.3")))) + :to-equal '(("refactor-nrepl" "2.0.0") ("cider/cider-nrepl" "0.51.0")))) (it "includes middlewares whose predicates return true" (expect (cider-jack-in-normalized-nrepl-middlewares) :to-equal '("refactor-nrepl.middleware/wrap-refactor" "cider.nrepl/cider-middleware" "another/middleware"))) (it "ignores plugins whose predicates return false" (spy-on 'plugins-predicate :and-return-value nil) (expect (cider-jack-in-normalized-lein-plugins) - :to-equal '(("cider/cider-nrepl" "0.50.3"))) + :to-equal '(("cider/cider-nrepl" "0.51.0"))) (spy-on 'middlewares-predicate :and-return-value nil) (expect (cider-jack-in-normalized-nrepl-middlewares) :to-equal '("cider.nrepl/cider-middleware" "another/middleware"))) @@ -362,7 +362,7 @@ :and-return-value '("refactor-nrepl.middleware/wrap-refactor" "cider.nrepl/cider-middleware")) (spy-on 'cider-jack-in-normalized-lein-plugins :and-return-value '(("refactor-nrepl" "2.0.0") - ("cider/cider-nrepl" "0.50.3") + ("cider/cider-nrepl" "0.51.0") ("mx.cider/lein-enrich-classpath" "1.19.3"))) (setq-local cider-jack-in-dependencies-exclusions '()) (setq-local cider-enrich-classpath t)) @@ -373,7 +373,7 @@ " -- update-in :plugins conj " (shell-quote-argument "[refactor-nrepl \"2.0.0\"]") " -- update-in :plugins conj " - (shell-quote-argument "[cider/cider-nrepl \"0.50.3\"]") + (shell-quote-argument "[cider/cider-nrepl \"0.51.0\"]") " -- update-in :plugins conj " (shell-quote-argument "[mx.cider/lein-enrich-classpath \"1.19.3\"]") " -- update-in :jvm-opts conj '\"-Djdk.attach.allowAttachSelf\"'" @@ -392,7 +392,7 @@ " -d " (shell-quote-argument "nrepl/nrepl:0.9.0") " -d " - (shell-quote-argument "cider/cider-nrepl:0.50.3") + (shell-quote-argument "cider/cider-nrepl:0.51.0") " -d " (shell-quote-argument "refactor-nrepl:2.0.0") " cider.tasks/add-middleware" @@ -487,7 +487,7 @@ (setq-local cider-jack-in-dependencies nil) (setq-local cider-jack-in-nrepl-middlewares '("cider.nrepl/cider-middleware")) (let ((expected (string-join `("clojure -Sdeps " - ,(shell-quote-argument "{:deps {nrepl/nrepl {:mvn/version \"0.9.0\"} cider/cider-nrepl {:mvn/version \"0.50.3\"}} :aliases {:cider/nrepl {:jvm-opts [\"-Djdk.attach.allowAttachSelf\"], :main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}") + ,(shell-quote-argument "{:deps {nrepl/nrepl {:mvn/version \"0.9.0\"} cider/cider-nrepl {:mvn/version \"0.51.0\"}} :aliases {:cider/nrepl {:jvm-opts [\"-Djdk.attach.allowAttachSelf\"], :main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}") " -M:cider/nrepl") ""))) (setq-local cider-allow-jack-in-without-project t) @@ -502,7 +502,7 @@ (it "allows specifying custom aliases with `cider-clojure-cli-aliases`" (let ((expected (string-join `("clojure -Sdeps " - ,(shell-quote-argument "{:deps {nrepl/nrepl {:mvn/version \"0.9.0\"} cider/cider-nrepl {:mvn/version \"0.50.3\"}} :aliases {:cider/nrepl {:jvm-opts [\"-Djdk.attach.allowAttachSelf\"], :main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}") + ,(shell-quote-argument "{:deps {nrepl/nrepl {:mvn/version \"0.9.0\"} cider/cider-nrepl {:mvn/version \"0.51.0\"}} :aliases {:cider/nrepl {:jvm-opts [\"-Djdk.attach.allowAttachSelf\"], :main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}") " -M:dev:test:cider/nrepl") ""))) (setq-local cider-jack-in-dependencies nil) @@ -520,7 +520,7 @@ (it (format "should remove duplicates, yielding the same result (for %S command invocation)" command) ;; repeat the same test for PowerShell too (let ((expected (string-join `("-Sdeps " - ,(cider--shell-quote-argument "{:deps {cider/cider-nrepl {:mvn/version \"0.50.3\"} nrepl/nrepl {:mvn/version \"0.9.0\"}} :aliases {:cider/nrepl {:jvm-opts [\"-Djdk.attach.allowAttachSelf\"], :main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}" + ,(cider--shell-quote-argument "{:deps {cider/cider-nrepl {:mvn/version \"0.51.0\"} nrepl/nrepl {:mvn/version \"0.9.0\"}} :aliases {:cider/nrepl {:jvm-opts [\"-Djdk.attach.allowAttachSelf\"], :main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}" command) " -M:dev:test:cider/nrepl") ""))) @@ -530,7 +530,7 @@ :to-equal expected)))) (it "handles aliases correctly" (let ((expected (string-join `("-Sdeps " - ,(shell-quote-argument "{:deps {cider/cider-nrepl {:mvn/version \"0.50.3\"} nrepl/nrepl {:mvn/version \"0.9.0\"}} :aliases {:cider/nrepl {:jvm-opts [\"-Djdk.attach.allowAttachSelf\"], :main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}") + ,(shell-quote-argument "{:deps {cider/cider-nrepl {:mvn/version \"0.51.0\"} nrepl/nrepl {:mvn/version \"0.9.0\"}} :aliases {:cider/nrepl {:jvm-opts [\"-Djdk.attach.allowAttachSelf\"], :main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}") " -M:test:cider/nrepl") "")) (deps '(("nrepl/nrepl" "0.9.0")))) @@ -558,7 +558,7 @@ :to-equal expected))))) (it "allows for global options" (let ((expected (string-join `("-J-Xverify:none -Sdeps " - ,(shell-quote-argument "{:deps {cider/cider-nrepl {:mvn/version \"0.50.3\"} nrepl/nrepl {:mvn/version \"0.9.0\"}} :aliases {:cider/nrepl {:jvm-opts [\"-Djdk.attach.allowAttachSelf\"], :main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}") + ,(shell-quote-argument "{:deps {cider/cider-nrepl {:mvn/version \"0.51.0\"} nrepl/nrepl {:mvn/version \"0.9.0\"}} :aliases {:cider/nrepl {:jvm-opts [\"-Djdk.attach.allowAttachSelf\"], :main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}") " -M:test:cider/nrepl") "")) (deps '(("nrepl/nrepl" "0.9.0")))) @@ -569,7 +569,7 @@ (setq-local cider-jack-in-dependencies '(("org.clojure/tools.deps" (("git/sha" . "6ae2b6f71773de7549d7f22759e8b09fec27f0d9") ("git/url" . "https://github.com/clojure/tools.deps/"))))) (let ((expected (string-join `("clojure -Sdeps " - ,(shell-quote-argument "{:deps {nrepl/nrepl {:mvn/version \"0.9.0\"} cider/cider-nrepl {:mvn/version \"0.50.3\"} org.clojure/tools.deps { :git/sha \"6ae2b6f71773de7549d7f22759e8b09fec27f0d9\" :git/url \"https://github.com/clojure/tools.deps/\" }} :aliases {:cider/nrepl {:jvm-opts [\"-Djdk.attach.allowAttachSelf\"], :main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}") + ,(shell-quote-argument "{:deps {nrepl/nrepl {:mvn/version \"0.9.0\"} cider/cider-nrepl {:mvn/version \"0.51.0\"} org.clojure/tools.deps { :git/sha \"6ae2b6f71773de7549d7f22759e8b09fec27f0d9\" :git/url \"https://github.com/clojure/tools.deps/\" }} :aliases {:cider/nrepl {:jvm-opts [\"-Djdk.attach.allowAttachSelf\"], :main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}") " -M:cider/nrepl") ""))) (setq-local cider-allow-jack-in-without-project t)