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

From: Juri Linkov <[email-masked]>
Date: Tue, 01 Apr 2025 20:43:34 +0300

> 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?