@@ -520,6 +520,10 @@ with the markdown_inline grammar."
520
520
" Return non-nil if NODE is a Clojure keyword."
521
521
(string-equal " kwd_lit" (treesit-node-type node)))
522
522
523
+ (defun clojure-ts--var-node-p (node )
524
+ " Return non-nil if NODE is a var (eg. #\\ 'foo)."
525
+ (string-equal " var_quoting_lit" (treesit-node-type node)))
526
+
523
527
(defun clojure-ts--named-node-text (node )
524
528
" Gets the name of a symbol or keyword NODE.
525
529
This does not include the NODE's namespace."
@@ -603,13 +607,13 @@ Includes a dispatch value when applicable (defmethods)."
603
607
" Return non-nil if NODE is a ns form."
604
608
(clojure-ts--definition-node-p " ns" node))
605
609
606
- (defvar clojure-ts--variable-type-regexp
610
+ (defvar clojure-ts--variable-definition- type-regexp
607
611
(rx string-start (or " def" " defonce" ) string-end)
608
612
" Regular expression for matching definition nodes that resemble variables." )
609
613
610
- (defun clojure-ts--variable-node-p (node )
614
+ (defun clojure-ts--variable-definition- node-p (node )
611
615
" Return non-nil if NODE is a def or defonce form."
612
- (clojure-ts--definition-node-match-p clojure-ts--variable-type-regexp node))
616
+ (clojure-ts--definition-node-match-p clojure-ts--variable-definition- type-regexp node))
613
617
614
618
(defvar clojure-ts--class-type-regexp
615
619
(rx string-start (or " deftype" " defrecord" " defstruct" ) string-end)
@@ -634,7 +638,7 @@ Includes a dispatch value when applicable (defmethods)."
634
638
; ; Used instead of treesit-defun-name-function.
635
639
clojure-ts--function-node-name)
636
640
(" Macro" " list_lit" clojure-ts--defmacro-node-p)
637
- (" Variable" " list_lit" clojure-ts--variable-node-p)
641
+ (" Variable" " list_lit" clojure-ts--variable-definition- node-p)
638
642
(" Interface" " list_lit" clojure-ts--interface-node-p)
639
643
(" Class" " list_lit" clojure-ts--class-node-p))
640
644
" The value for `treesit-simple-imenu-settings' .
@@ -722,7 +726,8 @@ https://github.com/weavejester/cljfmt/blob/fb26b22f569724b05c93eb2502592dfc2de89
722
726
(not (treesit-node-eq (treesit-node-child parent 1 t ) node))
723
727
(let ((first-child (treesit-node-child parent 0 t )))
724
728
(or (clojure-ts--symbol-node-p first-child)
725
- (clojure-ts--keyword-node-p first-child)))))
729
+ (clojure-ts--keyword-node-p first-child)
730
+ (clojure-ts--var-node-p first-child)))))
726
731
727
732
(defun clojure-ts--match-expression-in-body (_node parent _bol )
728
733
" Match NODE if it is an expression used in a body argument.
0 commit comments