all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: dev@rjt.dev, casouri@gmail.com, 61205-done@debbugs.gnu.org,
	theo@thornhill.no
Subject: bug#61205: 'function' in 3rd element of treesit-font-lock-feature-list
Date: Sun, 5 Feb 2023 15:52:09 +0200	[thread overview]
Message-ID: <a7b4ab12-ad11-2743-9a25-1b1f45fc77b7@yandex.ru> (raw)
In-Reply-To: <83y1pcsl3d.fsf@gnu.org>

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.





  reply	other threads:[~2023-02-05 13:52 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-01  2:08 bug#61205: 'function' in 3rd element of treesit-font-lock-feature-list Dmitry Gutov
2023-02-01  5:18 ` Yuan Fu
2023-02-02  2:34   ` Dmitry Gutov
2023-02-02  3:18     ` Randy Taylor
2023-02-02 11:03       ` Dmitry Gutov
2023-02-02 20:25   ` Dmitry Gutov
2023-02-03  2:38     ` Yuan Fu
2023-02-03  2:51       ` Dmitry Gutov
2023-02-03  6:45         ` Eli Zaretskii
2023-02-03  6:46     ` Eli Zaretskii
2023-02-03 11:42       ` Dmitry Gutov
2023-02-03 12:19         ` Eli Zaretskii
2023-02-03 15:15           ` Dmitry Gutov
2023-02-03 15:54             ` Eli Zaretskii
2023-02-03 17:10               ` Dmitry Gutov
2023-02-04  3:36                 ` Dmitry Gutov
2023-02-04  6:53                   ` Eli Zaretskii
2023-02-04 23:44                     ` Dmitry Gutov
2023-02-05  6:05                       ` Eli Zaretskii
2023-02-05 13:52                         ` Dmitry Gutov [this message]
2023-02-02  2:34 ` Randy Taylor
2023-02-02  2:44   ` Dmitry Gutov
2023-02-02  3:29     ` Randy Taylor
2023-02-02 11:11       ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a7b4ab12-ad11-2743-9a25-1b1f45fc77b7@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=61205-done@debbugs.gnu.org \
    --cc=casouri@gmail.com \
    --cc=dev@rjt.dev \
    --cc=eliz@gnu.org \
    --cc=theo@thornhill.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.