@@ -522,6 +522,10 @@ with the markdown_inline grammar."
522522 " Return non-nil if NODE is a Clojure keyword."
523523 (string-equal " kwd_lit" (treesit-node-type node)))
524524
525+ (defun clojure-ts--meta-node-p (node )
526+ " Return non-nil if NODE is a Clojure metadata node."
527+ (string-equal " meta_lit" (treesit-node-type node) ))
528+
525529(defun clojure-ts--named-node-text (node )
526530 " Gets the name of a symbol or keyword NODE.
527531This does not include the NODE's namespace."
@@ -726,22 +730,26 @@ https://github.com/weavejester/cljfmt/blob/fb26b22f569724b05c93eb2502592dfc2de89
726730 (or (clojure-ts--symbol-node-p first-child)
727731 (clojure-ts--keyword-node-p first-child)))))
728732
729- (defun clojure-ts--match-expression-in-body (_node parent _bol )
733+ (defun clojure-ts--match-expression-in-body (node parent _bol )
730734 " Match NODE if it is an expression used in a body argument.
731735PARENT is expected to be a list literal.
732736See `treesit-simple-indent-rules' ."
733737 (and
734738 (clojure-ts--list-node-p parent)
735- (let ((first-child (treesit-node-child parent 0 t )))
739+ (let* ((first-child (treesit-node-child parent 0 t ))
740+ (non-meta-first-child (if (clojure-ts--meta-node-p first-child)
741+ (treesit-node-child parent 1 t )
742+ first-child)))
736743 (and
737744 (not
738745 (clojure-ts--symbol-matches-p
739746 ; ; Symbols starting with this are false positives
740747 (rx line-start (or " default" " deflate" " defer" ))
741- first-child))
748+ non-meta-first-child))
749+ (not (clojure-ts--match-with-meta node parent _bol))
742750 (clojure-ts--symbol-matches-p
743751 clojure-ts--symbols-with-body-expressions-regexp
744- first-child)))))
752+ non-meta- first-child)))))
745753
746754(defun clojure-ts--match-method-body (_node parent _bol )
747755 " Matches a `NODE' in the body of a `PARENT' method implementation.
0 commit comments