emacs-devel
[Top][All Lists]
Advanced

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

Re: Using incremental parsing in Emacs


From: Dmitry Gutov
Subject: Re: Using incremental parsing in Emacs
Date: Sat, 4 Jan 2020 16:42:38 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

On 04.01.2020 15:30, arthur miller wrote:

Do it in a thread and display file originally without syntax coloring,
and then gradually display results as the tree-sitter thread work it's
way?

Syntax info is needed not only for coloring, and often on-demand. So a synchronous API will be needed.

Maybe start with displayed portion of the file only. Then since
tree-sitter accepts changes as fine-grained as on character level, send
new lines for syntax colouring as they are scrolled upp or down.

Like Eli said, see how JIT-lock works. If tree-sitter can support this usage, very good.

Or other strategy could be to have tree-sitter thread highlight the
visible portion of the file and to continue to work with non-visible
part of the buffer in background?

That seems kinda wasteful.



reply via email to

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