@@ -810,12 +810,11 @@ forms like deftype, defrecord, reify, proxy, etc."
810
810
(clojure-ts--match-fn-docstring parent)
811
811
(clojure-ts--match-method-docstring parent))))
812
812
813
- (defun clojure-ts--match-toplevel-with-meta (_node parent _bol )
814
- " Match NODE when it is toplevel form and it has metadata"
815
- (let* ((grandparent (treesit-node-parent parent)))
816
- (and (string-equal " source" (treesit-node-type grandparent))
817
- (clojure-ts--list-node-p parent)
818
- (treesit-node-child-by-field-name parent " meta" ))))
813
+ (defun clojure-ts--match-with-meta (node _parent _bol )
814
+ " Match NODE when it has metadata"
815
+ (let ((prev-sibling (treesit-node-prev-sibling node)))
816
+ (and prev-sibling
817
+ (string-equal (treesit-node-type prev-sibling) " meta_lit" ))))
819
818
820
819
(defun clojure-ts--semantic-indent-rules ()
821
820
" Return a list of indentation rules for `treesit-simple-indent-rules' ."
@@ -829,7 +828,7 @@ forms like deftype, defrecord, reify, proxy, etc."
829
828
(clojure-ts--match-threading-macro-arg prev-sibling 0 )
830
829
; ; https://guide.clojure.style/#vertically-align-fn-args
831
830
(clojure-ts--match-function-call-arg (nth-sibling 2 nil ) 0 )
832
- (clojure-ts--match-toplevel- with-meta parent 0 )
831
+ (clojure-ts--match-with-meta parent 0 )
833
832
; ; Literal Sequences
834
833
((parent-is " list_lit" ) parent 1 ) ; ; https://guide.clojure.style/#one-space-indent
835
834
((parent-is " vec_lit" ) parent 1 ) ; ; https://guide.clojure.style/#bindings-alignment
0 commit comments