File tree Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 1111- Add documentation and bug reporting commands from ` clojure-mode ` .
1212- [ #118 ] ( https://github.com/clojure-emacs/clojure-ts-mode/pull/118 ) : Add some ns manipulation functions from ` clojure-mode ` .
1313- Fix a bug in ` clojure-ts-add-arity ` when body has more than one expression.
14+ - [ #120 ] ( https://github.com/clojure-emacs/clojure-ts-mode/issues/120 ) : Fix a bug when symbols with metadata were not listed in imenu.
1415
1516## 0.5.1 (2025-06-17)
1617
Original file line number Diff line number Diff line change @@ -1003,13 +1003,10 @@ If there is no namespace, returns nil."
10031003(defun clojure-ts--node-child-skip-metadata (node n )
10041004 " Return the Nth child of NODE like `treesit-node-child' , sans metadata.
10051005Skip the optional metadata node at pos 0 if present."
1006- (let ((first-child (treesit-node-child node 0 t )))
1007- (treesit-node-child
1008- node
1009- (if (clojure-ts--metadata-node-p first-child)
1010- (1+ n)
1011- n)
1012- t )))
1006+ (let ((value-nodes (thread-last (treesit-node-children node t )
1007+ (seq-filter (lambda (child )
1008+ (string= (treesit-node-field-name child) " value" ))))))
1009+ (seq-elt value-nodes n)))
10131010
10141011(defun clojure-ts--first-value-child (node )
10151012 " Return the first value child of the given NODE.
Original file line number Diff line number Diff line change 3333 (expect (imenu-find-default " a" flatten-index)
3434 :to-equal " Variable:a" ))))
3535
36+ (it " should index def with meta data before symbol"
37+ (with-clojure-ts-buffer " (def ^:private a 1)"
38+ (let ((flatten-index (imenu--flatten-index-alist (imenu--make-index-alist ) t )))
39+ (expect (imenu-find-default " a" flatten-index)
40+ :to-equal " Variable:a" ))))
41+
3642 (it " should index defn with meta data"
3743 (with-clojure-ts-buffer " ^{:foo 1}(defn a [])"
3844 (let ((flatten-index (imenu--flatten-index-alist (imenu--make-index-alist ) t )))
You can’t perform that action at this time.
0 commit comments