Function: ruby-ts--imenu
ruby-ts--imenu is a byte-compiled function defined in
ruby-ts-mode.el.gz.
Signature
(ruby-ts--imenu)
Documentation
Return Imenu alist for the current buffer.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/ruby-ts-mode.el.gz
;; For now, this is going to work like ruby-mode and return a list of
;; class, modules, def (methods), and alias. It is likely that this
;; can be rigged to be easily extended.
(defun ruby-ts--imenu ()
"Return Imenu alist for the current buffer."
(let* ((root (treesit-buffer-root-node))
(tree (treesit-induce-sparse-tree root
(rx bol (or "singleton_method"
"method"
"alias"
"class"
"module")
eol))))
(ruby-ts--imenu-helper tree)))