Skip to content

Commit

Permalink
Improve integration with Clojure 1.11's new :as-alias namespace dir…
Browse files Browse the repository at this point in the history
  • Loading branch information
vemv committed Mar 15, 2022
1 parent 0a58b02 commit fbea695
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Change log
# Changelog

## Unreleased

## 3.5.0

* Use refactor-nrepl [3.5.0](https://github.com/clojure-emacs/refactor-nrepl/blob/v3.5.0/CHANGELOG.md#350).
* Improve integration with Clojure 1.11's new `:as-alias` namespace directive.
* Closes [#515](https://github.com/clojure-emacs/clj-refactor.el/issues/515), [#515](https://github.com/clojure-emacs/clj-refactor.el/issues/516)

## 3.4.3

- Use refactor-nrepl [3.4.2](https://github.com/clojure-emacs/refactor-nrepl/blob/v3.4.2/CHANGELOG.md#342).
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Either in your project's `project.clj` or in the `:user`
profile found at `~/.lein/profiles.clj`:

```clojure
:plugins [[refactor-nrepl "3.4.2"]
:plugins [[refactor-nrepl "3.5.0"]
[cider/cider-nrepl "0.28.3"]]
```

Expand Down
7 changes: 4 additions & 3 deletions clj-refactor.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
;; Lars Andersen <expez@expez.com>
;; Benedek Fazekas <benedek.fazekas@gmail.com>
;; Bozhidar Batsov <bozhidar@batsov.dev>
;; Version: 3.4.3
;; Version: 3.5.0
;; Keywords: convenience, clojure, cider

;; Package-Requires: ((emacs "26.1") (seq "2.19") (yasnippet "0.6.1") (paredit "24") (multiple-cursors "1.2.2") (clojure-mode "5.14") (cider "1.3") (parseedn "1.0.6") (inflections "2.3") (hydra "0.13.2"))
Expand Down Expand Up @@ -693,7 +693,7 @@ refactor-nrepl.util will be returned."
(save-excursion
(cljr--goto-ns)
(when (re-search-forward
(format ":as\\s-*\n*\\s-*%s\\_>" (regexp-quote alias))
(format ":as\\(-alias\\)?\\s-*\n*\\s-*%s\\_>" (regexp-quote alias))
(cljr--point-after 'paredit-forward)
:noerror)
(paredit-backward-up)
Expand Down Expand Up @@ -2039,6 +2039,7 @@ will add the corresponding require statement to the ns form."
(candidates (mapcar 'identity (cl-second aliases))))
(when-let (long (cljr--prompt-user-for "Require " candidates))
(when (and (not (cljr--in-namespace-declaration-p (concat ":as " short "\b")))
(not (cljr--in-namespace-declaration-p (concat ":as-alias " short "\b")))
(or (not (eq :prompt cljr-magic-requires))
(not (> (length candidates) 1)) ; already prompted
(yes-or-no-p (format "Add %s :as %s to requires?" long short))))
Expand Down Expand Up @@ -3294,7 +3295,7 @@ if REMOVE-PACKAGE_VERSION is t get rid of the (package: 20150828.1048) suffix."
;; We used to derive the version out of `(cljr--version t)`,
;; but now prefer a fixed version to fully decouple things and prevent unforeseen behavior.
;; This suits better our current pace of development.
(defcustom cljr-injected-middleware-version "3.4.2"
(defcustom cljr-injected-middleware-version "3.5.0"
"The refactor-nrepl version to be injected.

You can customize this in order to try out new releases.
Expand Down

0 comments on commit fbea695

Please sign in to comment.