]> git.eshelyaron.com Git - emacs.git/commit
ruby-ts-mode: Fix/simplify Imenu index generation
authorDmitry Gutov <dgutov@yandex.ru>
Mon, 27 Mar 2023 00:49:13 +0000 (03:49 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Mon, 27 Mar 2023 00:49:13 +0000 (03:49 +0300)
commitcbef1422fe3ba5d3327835f3952a0f42f7881716
treecd8131652e2ae3657ddd93f630b7e6891fd28fdc
parenta0d5fba74a638aa320aefa0a6583d233bbcee99f
ruby-ts-mode: Fix/simplify Imenu index generation

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--full-name): Drop '#'
from the end of resulting string when the node is not a method.
Support 'singleton_method' nodes.
(ruby-ts--imenu-helper): Simplify, to create a "flat" list of
entries, rather than a nested one.  The previous implementation
had problems (like producing a nested structure of full-qualified
names, thus creating a lot of textual repetition), seems easier to
just follow ruby-mode's example here, at least for Emacs 29's
release.

* test/lisp/progmodes/ruby-ts-mode-tests.el (ruby-ts-imenu-index):
New test.
lisp/progmodes/ruby-ts-mode.el
test/lisp/progmodes/ruby-ts-mode-tests.el