]> git.eshelyaron.com Git - emacs.git/commit
Improve tree-sitter imenu for c-mode and js-mode
authorYuan Fu <casouri@gmail.com>
Sat, 12 Nov 2022 23:57:02 +0000 (15:57 -0800)
committerYuan Fu <casouri@gmail.com>
Sat, 12 Nov 2022 23:57:02 +0000 (15:57 -0800)
commit908aab6144bf9f62dd5b2c2f1776ed177fa6d18f
tree11d57d02c4f87e5ddf7f4c6133c2f893c221e1f8
parentc78dc25a5351b1a4191028ba252c892ae1dd2438
Improve tree-sitter imenu for c-mode and js-mode

Instead of a flat list, now categorize imenu entries into categories
like "Function", "Variable", "Class", etc.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--imenu-1): Handle more edge
cases.
(c-ts-mode--imenu): Categorize menu entries.
* lisp/progmodes/js.el (js--treesit-imenu-type-alist): Remove variable.
(js--treesit-imenu-label): Remove function.
(js--treesit-imenu-1): Use the name alone for labels.
(js--treesit-imenu): Categorize menu entries.
lisp/progmodes/c-ts-mode.el
lisp/progmodes/js.el