Closed Deraen closed 8 years ago
Currently reader conditionals are indented like function calls, but instead I think they should be intended like vectors and maps:
;; Current (def DateTime #?(:clj org.joda.time.DateTime, :cljs goog.date.UtcDateTime)) ;; Correct (def DateTime #?(:clj org.joda.time.DateTime, :cljs goog.date.UtcDateTime)) ;; Current #?(:cljs (extend-protocol ToDateTime goog.date.Date (-to-date-time [x] (goog.date.UtcDateTime. (.getYear x) (.getMonth x) (.getDate x))))) ;; Correct #?(:cljs (extend-protocol ToDateTime goog.date.Date (-to-date-time [x] (goog.date.UtcDateTime. (.getYear x) (.getMonth x) (.getDate x)))))
Implemented by just looking at previous two chars before parentheses. This wont support cases where reader conditional is not on the same line as parentheses, but I don't think that is a problem.
+1
Great commit. Thanks for using the existing test setup!
Currently reader conditionals are indented like function calls, but instead I think they should be intended like vectors and maps:
Implemented by just looking at previous two chars before parentheses. This wont support cases where reader conditional is not on the same line as parentheses, but I don't think that is a problem.