emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to add pseudo vector types


From: Eli Zaretskii
Subject: Re: How to add pseudo vector types
Date: Tue, 03 Aug 2021 15:24:54 +0300

> From: Fu Yuan <casouri@gmail.com>
> Date: Tue, 3 Aug 2021 08:00:46 -0400
> Cc: stephen_leake@stephe-leake.org, cpitclaudel@gmail.com,
>  monnier@iro.umontreal.ca, emacs-devel@gnu.org
> 
> > Hmm... so a change that begins before the restriction and ends inside
> > the restriction will be sent as if it began at BEGV?  And the rest of
> > the change will be discarded?  Shouldn't you split such changes in
> > tow, send to TS the part inside the restriction, and store the rest
> > for the future, when/if the buffer is widened?
> 
> Tree-sitter doesn’t care about the content in a change, it will re-scan the 
> buffer content when it re-parses. We only need to inform it the range of the 
> change, so it knows where to re-scan when it re-parses. When the buffer is 
> widened, we will tell tree-sitter that range [BUF_BEG, BUF_BEGV] has changed, 
> and it will re-scan that part when re-parsing.

But that's sub-optimal, no?  Imagine a very large buffer which was
narrowed to a small portion near EOB, then a modification made very
close to EOB but partially before BEGV, then the buffer widened.  With
your method, TS will now have to re-parse almost the entire buffer,
whereas we know it needs to re-parse a very small portion of it.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]