Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes

From: Eli Zaretskii <[email-masked]>
Date: Thu, 30 Mar 2023 19:04:30 +0300

> Date: Thu, 30 Mar 2023 15:50:31 +0000
> From: Gregory Heytings <[email-masked]>
> cc: Dmitry Gutov <[email-masked]>, [email-masked], [email-masked], 
>     [email-masked]
> 
> > No, the idea is to create the parser with these restrictions to begin 
> > with.
> 
> Could you perhaps explain, with some fictitious code, what kind of 
> solution you imagine?  I'm not sure I understand (euphemism for: I'm sure 
> I don't understand) the problem statement.

Something like

  (treesit-make-parser LANGUAGE BUFFER nil START END)

and

  (treesit-parser-set-included-ranges RANGES...)

(the latter already exists).

> In what way would the restrictions you have in mind be different from 
> those of a regular narrowing?

User-defined narrowing will never contradict parser restrictions.

> Also, would such a parser always/never/sometimes obey the user narrowing?

It will always obey narrowing (it must), but we can then widen the
buffer temporarily inside some functions without caring about the
semantics of the narrowing and its source/purpose.