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

From: Juri Linkov <[email-masked]>
Date: Fri, 21 Feb 2025 09:56:10 +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)

Now pushed as 'treesit-closest-parser-boundary'.

>   (treesit-upper-parser-node POS)

Addition of 'treesit-upper-parser-node' is underway that should
be used in 'treesit-up-list' as well.