emacs-devel
[Top][All Lists]
Advanced

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

Re: parser error recovery algorithm vs treesit indentation "blinking"


From: Stephen Leake
Subject: Re: parser error recovery algorithm vs treesit indentation "blinking"
Date: Tue, 04 Apr 2023 06:50:30 -0700
User-agent: Gnus/5.13 (Gnus v5.13)

John Yates <john@yates-sheets.org> writes:

> On Mon, Apr 3, 2023 at 5:49 PM Stephen Leake
> <stephen_leake@stephe-leake.org> wrote:
>>
>> That's because the tree-sitter
>> algorithm does not insert symbols, it only skips them.
>
> Is this a fundamental architectural limitation of tree-sitter's parsing
> scheme?  

Possibly. In the wisitoken parser, allowing insertions during error
correction significantly complicates the edit step of incremental
parsing - so much so that there are still bugs in the wisitoken parser
that I'm having a very hard time squashing.

> Was it a design decision that trying insertions would be too costly?

I don't know. There are some references on error correction on the
tree-sitter website, but they don't discuss the possibility of
insertion, and they don't discuss implications for incremental parsing.

> Or is it an improvement that should be explored?

Yes.

> Has this been discussed in the wider tree-sitter community?  I would
> be surprised if emacs is the first to encounter this weakness.

I raised it a couple times; the only response I got was "tree-sitter has
excellent error correction".

Perhaps other users of tree-sitter don't use it for indenting complex
languages.

-- 
-- Stephe



reply via email to

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