emacs-devel
[Top][All Lists]
Advanced

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

Tree Sitter (was Re: cc-mode fontification feels random)


From: Perry E. Metzger
Subject: Tree Sitter (was Re: cc-mode fontification feels random)
Date: Thu, 15 Jul 2021 18:43:10 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:90.0) Gecko/20100101 Thunderbird/90.0

On 7/15/21 14:13, Perry E. Metzger wrote:
Using LSP for fontification is unfortunately not sufficiently high performance. LSP is really intended for things like providing type information or enabling refactorings.

I note that several other modern editors now make use of the "Tree Sitter" library (see https://github.com/tree-sitter/tree-sitter ) which was designed explicitly to provide a C library for incremental programming language parsing for text editors. It allows for very consistent fontification in other editors like Atom, and is available under the MIT license, which would permit it to be included in Emacs.

A very good presentation a few years ago by the author, including an explanation of how Tree Sitter enables high quality fontification in editors like Atom, can be viewed on youtube: https://www.youtube.com/watch?v=Jes3bD6P0To

Apologies for not having been present for, er, the extensive previous discussion on Tree Sitter. I discovered it looking at the archives. I still believe that it would be a great thing to integrate into the base of Emacs. The algorithms it employs are excellent, it's extremely fast, and it handles the issues of real editors (like dealing with partial code fragments and incrementally changing the parse on every keystroke) very efficiently.

Perry





reply via email to

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