Skip to content

Commit

Permalink
Don't apply indentation inference for :style/indent nil metadata (#884
Browse files Browse the repository at this point in the history
  • Loading branch information
vemv authored Jun 13, 2024
1 parent 6ec50c3 commit 7fdca13
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## master (unreleased)

## Bugs fixed

* [CIDER#3684](https://github.com/clojure-emacs/cider/issues/3684): Don't apply indentation inference for `:style/indent nil` metadata.

## 0.49.0 (2024-06-02)

### Changes
Expand Down
4 changes: 2 additions & 2 deletions src/cider/nrepl/middleware/track_state.clj
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
[m]
(and (:macro m)
(:arglists m)
(not (:style/indent m))
(not (:indent m))
(not (contains? m :style/indent))
(not (contains? m :indent))
(if-let [namespace-name (some-> (cond
(instance? Namespace (:ns m)) ;; JVM clojure
(-> m :ns ns-name)
Expand Down
5 changes: 4 additions & 1 deletion test/clj/cider/nrepl/middleware/track_state_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
(defmacro macro-without-style-indent-1 [opts & body])
(defmacro macro-without-style-indent-2 [opts body])
(defmacro macro-without-style-indent-3 [opts baddy])
(defmacro macro-with-explicitly-nil-style-indent {:style/indent nil} [opts & body])

(def mock-msg (reify nrepl.transport/Transport
(recv [this])
Expand All @@ -226,7 +227,9 @@
(is (= "1"
(-> interns (get 'macro-without-style-indent-2) :style/indent)))
(is (= nil
(-> interns (get 'macro-without-style-indent-3) :style/indent))))))
(-> interns (get 'macro-without-style-indent-3) :style/indent)))
(is (= nil
(-> interns (get 'macro-with-explicitly-nil-style-indent) :style/indent))))))

(deftest inferrable-indent?-test
(testing "clojure.* macros are not inferrable"
Expand Down

0 comments on commit 7fdca13

Please sign in to comment.