Subject: Re: bug#77255: Treesit font-lock override for embed ranges

From: Yuan Fu <[email-masked]>
Date: Tue, 1 Apr 2025 16:41:13 -0700

> On Apr 1, 2025, at 10:43 AM, Juri Linkov <[email-masked]> wrote:
> 
>> Everything works nicely in the attached example of the liquid major mode
>> where liquid is the primary parser.  Currently it copies settings
>> from mhtml-ts-mode.  But later I'll try to inherit from mhtml-ts-mode.
> 
> However, with inheritance that causes several changes of the
> primary parser and several calls to treesit-major-mode-setup
> during the ts-mode initialization, sometimes I get such backtraces
> only after the first edit:
> 
> Debugger entered--Lisp error: (treesit-node-outdated #<treesit-node-outdated>)
>  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_78>(beg #<treesit-node-outdated>)
>  treesit-navigate-thing(35 1 beg html-ts-mode--outline-predicate)
> 
> Could you suggest where to look?

Could it be that you passed a lambda/closure to treesit-navigate-thing which contains a tree-sitter node?

Yuan