Skip to content

Commit

Permalink
Ensure there's a leading : when using cider-clojure-cli-aliases (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
vemv authored Aug 24, 2023
1 parent 0926261 commit 73f0d05
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
- [#3419](https://github.com/clojure-emacs/cider/issues/3419): Also match friendly sessions based on the buffer's ns form.
- `cider-test`: only show diffs for collections.
- [#3375](https://github.com/clojure-emacs/cider/pull/3375): `cider-test`: don't render a newline between expected and actual, most times.
- Ensure there's a leading `:` when using `cider-clojure-cli-aliases`.
- Improve `nrepl-dict` error reporting.
- Bump the injected `piggieback` to [0.5.3](https://github.com/nrepl/piggieback/blob/0.5.3/CHANGES.md#053-2021-10-26).
- Bump the injected `cider-nrepl` to [0.36.0](https://github.com/clojure-emacs/cider-nrepl/blob/v0.36.0/CHANGELOG.md#0360-2023-08-21).
Expand Down
5 changes: 4 additions & 1 deletion cider.el
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,10 @@ your aliases contain any mains, the cider/nrepl one will be the one used."
(if cider-clojure-cli-aliases
;; remove exec-opts flags -A -M -T or -X from cider-clojure-cli-aliases
;; concatenated with :cider/nrepl to ensure :cider/nrepl comes last
(format "%s" (replace-regexp-in-string "^-\\(A\\|M\\|T\\|X\\)" "" cider-clojure-cli-aliases))
(let ((aliases (format "%s" (replace-regexp-in-string "^-\\(A\\|M\\|T\\|X\\)" "" cider-clojure-cli-aliases))))
(if (string-prefix-p ":" aliases)
aliases
(concat ":" aliases)))
"")
(if params (format " %s" params) ""))))

Expand Down
2 changes: 1 addition & 1 deletion dev/tramp-sample-project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This way, for development purposes, we can SSH into it with TRAMP and exercise C
To get started:

* In one terminal tab, run `make run` to run the Docker image
* Once it's ready, from another tab, run `make ssh`
* Once it's ready, from another tab, run `make ssh` and start a repl manually from there
* The password is `cider`
* `cd /usr/src/app; lein repl :headless :host 0.0.0.0 :port 7888`

Expand Down
8 changes: 7 additions & 1 deletion test/cider-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,13 @@
(let ((cider-clojure-cli-aliases ":test"))
(expect (cider-clojure-cli-jack-in-dependencies nil nil deps)
:to-equal expected))
(describe "should strip out leading exec opts -A -M -T -X"
(describe "should strip out leading exec opts -A -M -T -X, and ensure there's a leading :"
(let ((cider-clojure-cli-aliases ":test"))
(expect (cider-clojure-cli-jack-in-dependencies nil nil deps)
:to-equal expected))
(let ((cider-clojure-cli-aliases "test"))
(expect (cider-clojure-cli-jack-in-dependencies nil nil deps)
:to-equal expected))
(let ((cider-clojure-cli-aliases "-A:test"))
(expect (cider-clojure-cli-jack-in-dependencies nil nil deps)
:to-equal expected))
Expand Down

0 comments on commit 73f0d05

Please sign in to comment.