* lisp/progmodes/dockerfile-ts-mode.el (dockerfile-ts-mode--imenu):
Don't include empty categories.
(let* ((node (treesit-buffer-root-node))
(stage-tree (treesit-induce-sparse-tree
node "from_instruction"
- nil 1000)))
- `(("Stage" . ,(dockerfile-ts-mode--imenu-1 stage-tree)))))
+ nil 1000))
+ (stage-index (dockerfile-ts-mode--imenu-1 stage-tree)))
+ (when stage-index `(("Stage" . ,stage-index)))))
(defun dockerfile-ts-mode--imenu-1 (node)
"Helper for `dockerfile-ts-mode--imenu'.