Subject: bug#76398: treesit-aggregated-outline-predicate

From: Juri Linkov <[email-masked]>
Date: Wed, 19 Feb 2025 09:46:23 +0200

> So this patch helps 'treesit-outline-search' to get out of the local parser
> to the primary parser to continue search for the next outline predicate.
>
> 'treesit-outline-level' should do the same, but currently I can't find
> a suitable function to break out of embedded confinement
> and get the host node that contains the guest ranges.
> I mean that e.g. (treesit-parser-root-node (treesit-node-parser node))
> can get the root node of the local parser, but how to get its parent node
> in the primary parser?  It's understandable that treesit-node-parent
> doesn't go out of its parser.  But maybe there is another function?
> If such function doesn't exist, this is fine, then could find that
> node manually by calculating from treesit-parser-included-ranges.

Maybe we need two new primitives:

  (treesit-next-parser-boundary POS)
  (treesit-prev-parser-boundary POS)

and

  (treesit-upper-parser-node POS)