@@ -522,6 +522,10 @@ with the markdown_inline grammar."
522
522
" Return non-nil if NODE is a Clojure keyword."
523
523
(string-equal " kwd_lit" (treesit-node-type node)))
524
524
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
+
525
529
(defun clojure-ts--named-node-text (node )
526
530
" Gets the name of a symbol or keyword NODE.
527
531
This does not include the NODE's namespace."
@@ -726,22 +730,26 @@ https://github.com/weavejester/cljfmt/blob/fb26b22f569724b05c93eb2502592dfc2de89
726
730
(or (clojure-ts--symbol-node-p first-child)
727
731
(clojure-ts--keyword-node-p first-child)))))
728
732
729
- (defun clojure-ts--match-expression-in-body (_node parent _bol )
733
+ (defun clojure-ts--match-expression-in-body (node parent _bol )
730
734
" Match NODE if it is an expression used in a body argument.
731
735
PARENT is expected to be a list literal.
732
736
See `treesit-simple-indent-rules' ."
733
737
(and
734
738
(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)))
736
743
(and
737
744
(not
738
745
(clojure-ts--symbol-matches-p
739
746
; ; Symbols starting with this are false positives
740
747
(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))
742
750
(clojure-ts--symbol-matches-p
743
751
clojure-ts--symbols-with-body-expressions-regexp
744
- first-child)))))
752
+ non-meta- first-child)))))
745
753
746
754
(defun clojure-ts--match-method-body (_node parent _bol )
747
755
" Matches a `NODE' in the body of a `PARENT' method implementation.
0 commit comments