-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Labels
help wantedExtra attention is neededExtra attention is needed
Description
A simplistic imenu-create-index-function
can look like this:
(defun tree-sitter-rust-imenu-index-function ()
(thread-last (tree-sitter-query [(function_item (identifier) @function)])
(seq-map (lambda (capture)
(pcase-let ((`(_ . ,node) capture))
(cons (ts-node-text node)
(ts-node-start-position node)))))))
A more substantial implementation can use ts-query-matches
to capture nested structures.
ashlineldridge
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed