]> git.eshelyaron.com Git - emacs.git/commit
Fix empty pairs in js tree-sitter imenu alist (bug#59945)
authorCharl P. Botha <cpbotha@vxlabs.com>
Sat, 10 Dec 2022 17:09:38 +0000 (19:09 +0200)
committerYuan Fu <casouri@gmail.com>
Wed, 21 Dec 2022 04:50:50 +0000 (20:50 -0800)
commit12b2b8864c295ce27594e8a907ebb3423e58a9d4
treea8c66b9a16ca2e840697cc588f93b6b17b71577e
parent6d9f367ead32c688bcfc6a0366073dff6740099c
Fix empty pairs in js tree-sitter imenu alist (bug#59945)

The current js--treesit-imenu, used by the JavaScript, TypeScript and
TSX tree-sitter modes, would return empty pairs in the imenu alist if
there were none of that type of symbol.

This would break both the built in imenu and also packages like
consult-imenu.

See https://github.com/minad/consult/issues/697 for the discussion
there.

* lisp/progmodes/js.el (js--treesit-imenu): Don't add nil indexes.

Copyright-paperwork-exempt: yes
lisp/progmodes/js.el