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: Stephen Leake
Subject: Re: How to add pseudo vector types
Date: Sun, 25 Jul 2021 09:16:55 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (windows-nt)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Stephen Leake <stephen_leake@stephe-leake.org>
>> Cc: casouri@gmail.com,  monnier@iro.umontreal.ca,  emacs-devel@gnu.org
>> Date: Fri, 23 Jul 2021 19:00:12 -0700
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> >> > I fail to see the significance of the difference.  Surely, you could
>> >> > hand it a block of text with changes to mean that this block replaces
>> >> > the previous version of that block.  It might take the parser more
>> >> > work to update the parse tree in this case, but if it's fast enough,
>> >> > that won't be the problem.  Right?
>> >> 
>> >> tree-sitter doesn't store the previous text, so there's nothing to
>> >> compare it to.
>> >
>> > There was nothing about comparison in my text.  You tell TS that
>> > editing replaced a block of text between A and B with block between A
>> > and C, without revealing the fine-grained changes inside that block.
>> > This must work, because editing could indeed do just that.
>> 
>> I see; treat the whole block as one change. Yes, that would work, but it
>> would probably be less optimal than sending a list of smaller changes;
>> depends on the details.
>
> Since TS is very fast, I think this sub-optimality will not cause any
> tangible performance issues in Emacs.  And from our POV it is a good
> optimization because it will minimize (and to some extent optimize)
> the traffic between Emacs and TS.

"optimal" refers to more than speed; error recovery is also important.
The more of the previous tree you keep, the better the error recovery.

After we get some good metrics/benchmarks for actual Emacs use (ie, how
good is the indentation?), we can explore this.

-- 
-- Stephe



reply via email to

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