GNU bug report logs -
#61205
'function' in 3rd element of treesit-font-lock-feature-list
Previous Next
Reported by: Dmitry Gutov <dgutov <at> yandex.ru>
Date: Wed, 1 Feb 2023 02:09:02 UTC
Severity: normal
Done: Dmitry Gutov <dgutov <at> yandex.ru>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
On 04/02/2023 08:53, Eli Zaretskii wrote:
>> Date: Sat, 4 Feb 2023 05:36:15 +0200
>> From: Dmitry Gutov<dgutov <at> yandex.ru>
>> Cc:61205 <at> debbugs.gnu.org,casouri <at> gmail.com,theo <at> thornhill.no,dev <at> rjt.dev
>>
>> Here's the updated patch in the meantime.
> Thanks, but please also update the doc string of
> treesit-font-lock-level.
Done.
>> 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.
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.
(Github also highlights function calls, though.)
I'm also adding function parameter highlighting to rust and go modes.
See the attached patch. I suggest we install it in emacs-29, but then
people are free to tweak the rules further.
[ts-modes-refine-features.diff (text/x-patch, attachment)]
This bug report was last modified 2 years and 107 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.