emacs-devel
[Top][All Lists]
Advanced

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

Re: Update on tree-sitter structure navigation


From: Dmitry Gutov
Subject: Re: Update on tree-sitter structure navigation
Date: Sat, 9 Sep 2023 00:05:22 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

On 08/09/2023 04:04, Yuan Fu wrote:
Something I mentioned previously, there is notion of scopes in tree-sitter 
docs, see the Local Variables section 
here:https://tree-sitter.github.io/tree-sitter/syntax-highlighting#local-variables

Basically to know which symbols are defined and for how long, the parser needs 
additional help from the major mode author.

Neovim's definition 
here:https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/ruby/locals.scm
Good call. I’ll add it to my TODO list, but it’ll have a lower priority, since 
I personally aren’t really interested in coloring variables different colors. 
If someone is interested, do please give it a try.

Sure, it's probably more valuable in some languages than others.

In case you have some ideas for the implementation strategy, though, perhaps mention them inside treesit.el's Commentary (it could also have a TODO block). Offhand, it doesn't quite fit to what we do with font-lock. OTOH, I suppose I could go take a look at NVim's implementation.



reply via email to

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