Skip to content

Commit 1646dd4

Browse files
committed
Don't apply indentation inference for :style/indent nil metadata
Fixes clojure-emacs/cider#3684
1 parent 6ec50c3 commit 1646dd4

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## master (unreleased)
44

5+
## Bugs fixed
6+
7+
* [CIDER#3684](https://github.com/clojure-emacs/cider/issues/3684): Don't apply indentation inference for `:style/indent nil` metadata.
8+
59
## 0.49.0 (2024-06-02)
610

711
### Changes

src/cider/nrepl/middleware/track_state.clj

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
[m]
3232
(and (:macro m)
3333
(:arglists m)
34-
(not (:style/indent m))
35-
(not (:indent m))
34+
(not (contains? m :style/indent))
35+
(not (contains? m :indent))
3636
(if-let [namespace-name (some-> (cond
3737
(instance? Namespace (:ns m)) ;; JVM clojure
3838
(-> m :ns ns-name)

test/clj/cider/nrepl/middleware/track_state_test.clj

+4-1
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@
208208
(defmacro macro-without-style-indent-1 [opts & body])
209209
(defmacro macro-without-style-indent-2 [opts body])
210210
(defmacro macro-without-style-indent-3 [opts baddy])
211+
(defmacro macro-with-explicitly-nil-style-indent {:style/indent nil} [opts & body])
211212

212213
(def mock-msg (reify nrepl.transport/Transport
213214
(recv [this])
@@ -226,7 +227,9 @@
226227
(is (= "1"
227228
(-> interns (get 'macro-without-style-indent-2) :style/indent)))
228229
(is (= nil
229-
(-> interns (get 'macro-without-style-indent-3) :style/indent))))))
230+
(-> interns (get 'macro-without-style-indent-3) :style/indent)))
231+
(is (= nil
232+
(-> interns (get 'macro-with-explicitly-nil-style-indent) :style/indent))))))
230233

231234
(deftest inferrable-indent?-test
232235
(testing "clojure.* macros are not inferrable"

0 commit comments

Comments
 (0)