emacs-bug-tracker
[Top][All Lists]
Advanced

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

bug#61205: closed ('function' in 3rd element of treesit-font-lock-featur


From: GNU bug Tracking System
Subject: bug#61205: closed ('function' in 3rd element of treesit-font-lock-feature-list)
Date: Sun, 05 Feb 2023 13:53:01 +0000

Your message dated Sun, 5 Feb 2023 15:52:09 +0200
with message-id <a7b4ab12-ad11-2743-9a25-1b1f45fc77b7@yandex.ru>
and subject line Re: bug#61205: 'function' in 3rd element of 
treesit-font-lock-feature-list
has caused the debbugs.gnu.org bug report #61205,
regarding 'function' in 3rd element of treesit-font-lock-feature-list
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
61205: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61205
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 'function' in 3rd element of treesit-font-lock-feature-list Date: Wed, 1 Feb 2023 04:08:38 +0200 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2
X-Debbugs-Cc: Yuan Fu <casouri@gmail.com>, Randy Taylor <dev@rjt.dev>

Some new built-in modes has 'function' feature highlighting thus enabled by default.

rust-ts-mode, go-ts-mode, cmake-mode

Should we move it to 4 for consistency with the rest?

Previously, we talked about that and concluded that function calls are usually everywhere and are easy to notice without additional highlighting.



--- End Message ---
--- Begin Message --- Subject: Re: bug#61205: 'function' in 3rd element of treesit-font-lock-feature-list Date: Sun, 5 Feb 2023 15:52:09 +0200 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2
On 05/02/2023 08:05, Eli Zaretskii wrote:
Date: Sun, 5 Feb 2023 01:44:40 +0200
Cc: 61205@debbugs.gnu.org, casouri@gmail.com, theo@thornhill.no, dev@rjt.dev
From: Dmitry Gutov <dgutov@yandex.ru>

On 04/02/2023 08:53, Eli Zaretskii wrote:
Date: Sat, 4 Feb 2023 05:36:15 +0200
From: Dmitry Gutov<dgutov@yandex.ru>
Cc:61205@debbugs.gnu.org,casouri@gmail.com,theo@thornhill.no,dev@rjt.dev

Here's the updated patch in the meantime.
Thanks, but please also update the doc string of
treesit-font-lock-level.

Done.

Thanks, LGTM.

Not sure what to do with 'type' highlighting in rust-ts-mode yet.
What is the problem with that?

The nodes structure of a 'use' instruction has a lot of nesting, and at
least a couple of variations, which would lead to a combinatoric
increase in the number of queries.

If this proves to be a problem in practice, maybe we'll need some
customization specific to Rust.

Taking another look at the declarations, though, I wasn't sure I could
understand the specific logic for choosing between font-lock-type-face
and font-lock-constant-face.

It seemed heavily inspired by
https://github.com/tree-sitter/tree-sitter-rust/blob/master/queries/highlights.scm,
though. So what I did is reverted to those rules (in that area): the
path segments that start with an uppercase char get highlighted with
font-lock-type-face. The rest don't get highlighted at all. That's how
Rust code looks at Github, so a fair number of developers must be okay
with it.

And this solves the potential combinatoric explosion?

Yes, simply because function names don't start with a capital letter by convention. So we don't highlight them as types.

See the attached patch. I suggest we install it in emacs-29, but then
people are free to tweak the rules further.

Yes, please install.

Thank you, done, and closing.


--- End Message ---

reply via email to

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