emacs-devel
[Top][All Lists]
Advanced

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

Re: treesit indentation "blinking"


From: Daniel Martín
Subject: Re: treesit indentation "blinking"
Date: Fri, 07 Apr 2023 16:20:24 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin)

Daniel Colascione <dancol@dancol.org> writes:

>
> Silly question: can't we make a mode with c++-mode's indentation (and
> folding etc.) and c++-ts-mode's fontification? Such a thing would also
> preserve compatibility with the numerous ad hoc c++-mode styles out
> there.

Note that c++-ts-mode's fontification can also "blink":

i n t  m a i n ( ) { RET i n (now "main" is not fontified) t i ; (now
"main" is fontified again).

In general, I'd suggest taking a look at Neovim's Tree-sitter
implementation and perhaps reuse (part of) their .scm Tree-sitter syntax
highlight or indentation queries:
https://github.com/nvim-treesitter/nvim-treesitter/tree/master/queries/c
Neovim's implementation doesn't "blink" in the scenarios presented here,
but I'm not sure about how it performs in other tricky cases.

Now that text editors have access to the same programming language
grammars, I'm surprised the Tree-sitter community hasn't started any
cross-team effort to work on canonical queries (or slighter richer
abstractions) per programming language.  Text editor developers are
working and rediscovering complex language problems independently.


reply via email to

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