emacs-devel
[Top][All Lists]
Advanced

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

Re: treesit indentation "blinking"


From: Dmitry Gutov
Subject: Re: treesit indentation "blinking"
Date: Sat, 8 Apr 2023 04:32:13 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0

On 07/04/2023 17:20, Daniel Martín wrote:
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.

Looking at that file, it does contain queries that look for ERROR nodes, e.g.

(
  ERROR
    "for" "(" @indent.begin ";" ";" ")" @indent.end)

So perhaps we should revisit that approach too.

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.

We could do an indent implementation that just uses these indents.scm files. Not exactly sure why we didn't start out this way, but note that our Lisp based solution is a lot more flexible.

E.g. there doesn't seem to be an obvious way to support "indentation styles" with these.



reply via email to

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