GNU bug report logs - #70362
[PATCH] Add font-locking for Go built-in functions in go-ts-mode

Previous Next

Package: emacs;

Reported by: Noah Peart <noah.v.peart <at> gmail.com>

Date: Sat, 13 Apr 2024 05:49:03 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 70362 in the body.
You can then email your comments to 70362 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#70362; Package emacs. (Sat, 13 Apr 2024 05:49:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Noah Peart <noah.v.peart <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 13 Apr 2024 05:49:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Noah Peart <noah.v.peart <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Add font-locking for Go built-in functions in go-ts-mode
Date: Fri, 12 Apr 2024 22:47:37 -0700
[Message part 1 (text/plain, inline)]
Tags: patch

This patch adds a new `builtin` feature to
`treesit-font-lock-feature-list` in `go-ts-mode` and a corresponding
rule to `go-ts-mode--font-lock-settings` to highlight Go's built-in
functions.
[Message part 2 (text/html, inline)]
[0001-Add-font-locking-for-Go-built-in-functions-in-go-ts-.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70362; Package emacs. (Sat, 13 Apr 2024 07:24:02 GMT) Full text and rfc822 format available.

Message #8 received at 70362 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Noah Peart <noah.v.peart <at> gmail.com>
Cc: 70362 <at> debbugs.gnu.org
Subject: Re: bug#70362: [PATCH] Add font-locking for Go built-in functions in
 go-ts-mode
Date: Sat, 13 Apr 2024 10:23:31 +0300
> From: Noah Peart <noah.v.peart <at> gmail.com>
> Date: Fri, 12 Apr 2024 22:47:37 -0700
> 
> This patch adds a new `builtin` feature to
> `treesit-font-lock-feature-list` in `go-ts-mode` and a corresponding
> rule to `go-ts-mode--font-lock-settings` to highlight Go's built-in functions.

Thanks.

I will ask here as well: at what level of font-lock will this be
fontified?  I think it should be fontified only on level 4.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70362; Package emacs. (Sat, 13 Apr 2024 07:42:03 GMT) Full text and rfc822 format available.

Message #11 received at 70362 <at> debbugs.gnu.org (full text, mbox):

From: Noah Peart <noah.v.peart <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 70362 <at> debbugs.gnu.org
Subject: Re: bug#70362: [PATCH] Add font-locking for Go built-in functions in
 go-ts-mode
Date: Sat, 13 Apr 2024 00:40:38 -0700
[Message part 1 (text/plain, inline)]
I put it at level 3 following the conventions in other treesit modes
I checked: python-ts-mode, ruby-ts-mode, rust-ts-mode all put builtins at
level 3.
But, I haven't done a full census of the ts modes so there might be
variability.

On Sat, Apr 13, 2024 at 12:23 AM Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: Noah Peart <noah.v.peart <at> gmail.com>
> > Date: Fri, 12 Apr 2024 22:47:37 -0700
> >
> > This patch adds a new `builtin` feature to
> > `treesit-font-lock-feature-list` in `go-ts-mode` and a corresponding
> > rule to `go-ts-mode--font-lock-settings` to highlight Go's built-in
> functions.
>
> Thanks.
>
> I will ask here as well: at what level of font-lock will this be
> fontified?  I think it should be fontified only on level 4.
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70362; Package emacs. (Sat, 13 Apr 2024 12:18:02 GMT) Full text and rfc822 format available.

Message #14 received at 70362 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Noah Peart <noah.v.peart <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 70362 <at> debbugs.gnu.org
Subject: Re: bug#70362: [PATCH] Add font-locking for Go built-in functions in
 go-ts-mode
Date: Sat, 13 Apr 2024 15:16:45 +0300
On 13/04/2024 10:40, Noah Peart wrote:
> I put it at level 3 following the conventions in other treesit modes
> I checked: python-ts-mode, ruby-ts-mode, rust-ts-mode all put builtins 
> at level 3.
> But, I haven't done a full census of the ts modes so there might be 
> variability.

SGTM. If classic major modes highlight a thing (and they do that for 
built-ins), we usually put it in the default highlighting for ts modes 
as well (meaning level 3 or lower).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70362; Package emacs. (Sun, 14 Apr 2024 23:34:02 GMT) Full text and rfc822 format available.

Message #17 received at 70362 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: Noah Peart <noah.v.peart <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
 70362 <at> debbugs.gnu.org
Subject: Re: bug#70362: [PATCH] Add font-locking for Go built-in functions in
 go-ts-mode
Date: Sun, 14 Apr 2024 16:32:43 -0700
Dmitry Gutov <dmitry <at> gutov.dev> writes:

> On 13/04/2024 10:40, Noah Peart wrote:
>> I put it at level 3 following the conventions in other treesit modes
>> I checked: python-ts-mode, ruby-ts-mode, rust-ts-mode all put
>> builtins at level 3.
>> But, I haven't done a full census of the ts modes so there might be
>> variability.
>
> SGTM. If classic major modes highlight a thing (and they do that for
> built-ins), we usually put it in the default highlighting for ts modes
> as well (meaning level 3 or lower).

Right. And the patch looks good to me.

Yuan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70362; Package emacs. (Tue, 16 Apr 2024 00:45:02 GMT) Full text and rfc822 format available.

Message #20 received at 70362 <at> debbugs.gnu.org (full text, mbox):

From: Randy Taylor <dev <at> rjt.dev>
To: Noah Peart <noah.v.peart <at> gmail.com>
Cc: Dmitry Gutov <dmitry <at> gutov.dev>, Yuan Fu <casouri <at> gmail.com>,
 70362 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#70362: [PATCH] Add font-locking for Go built-in functions in
 go-ts-mode
Date: Tue, 16 Apr 2024 00:44:16 +0000
On Sunday, April 14th, 2024 at 19:32, Yuan Fu <casouri <at> gmail.com> wrote:
> 
> Dmitry Gutov dmitry <at> gutov.dev writes:
> 
> > On 13/04/2024 10:40, Noah Peart wrote:
> > 
> > > I put it at level 3 following the conventions in other treesit modes
> > > I checked: python-ts-mode, ruby-ts-mode, rust-ts-mode all put
> > > builtins at level 3.
> > > But, I haven't done a full census of the ts modes so there might be
> > > variability.
> > 
> > SGTM. If classic major modes highlight a thing (and they do that for
> > built-ins), we usually put it in the default highlighting for ts modes
> > as well (meaning level 3 or lower).
> 
> 
> Right. And the patch looks good to me.
> 
> Yuan
> 

Thanks for working on this Noah, it looks good to me as well.

Perhaps builtin could come before constant in treesit-font-lock-feature-list to keep things alphabetical?





Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Thu, 18 Apr 2024 10:33:13 GMT) Full text and rfc822 format available.

Notification sent to Noah Peart <noah.v.peart <at> gmail.com>:
bug acknowledged by developer. (Thu, 18 Apr 2024 10:33:14 GMT) Full text and rfc822 format available.

Message #25 received at 70362-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Yuan Fu <casouri <at> gmail.com>
Cc: dmitry <at> gutov.dev, 70362-done <at> debbugs.gnu.org, noah.v.peart <at> gmail.com
Subject: Re: bug#70362: [PATCH] Add font-locking for Go built-in functions in
 go-ts-mode
Date: Thu, 18 Apr 2024 13:31:25 +0300
> From: Yuan Fu <casouri <at> gmail.com>
> Date: Sun, 14 Apr 2024 16:32:43 -0700
> Cc: Noah Peart <noah.v.peart <at> gmail.com>,
>  Eli Zaretskii <eliz <at> gnu.org>,
>  70362 <at> debbugs.gnu.org
> 
> 
> Dmitry Gutov <dmitry <at> gutov.dev> writes:
> 
> > On 13/04/2024 10:40, Noah Peart wrote:
> >> I put it at level 3 following the conventions in other treesit modes
> >> I checked: python-ts-mode, ruby-ts-mode, rust-ts-mode all put
> >> builtins at level 3.
> >> But, I haven't done a full census of the ts modes so there might be
> >> variability.
> >
> > SGTM. If classic major modes highlight a thing (and they do that for
> > built-ins), we usually put it in the default highlighting for ts modes
> > as well (meaning level 3 or lower).
> 
> Right. And the patch looks good to me.

Thanks, installed on master, and closing the bug.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70362; Package emacs. (Thu, 18 Apr 2024 10:34:13 GMT) Full text and rfc822 format available.

Message #28 received at 70362 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Randy Taylor <dev <at> rjt.dev>
Cc: noah.v.peart <at> gmail.com, casouri <at> gmail.com, 70362 <at> debbugs.gnu.org,
 dmitry <at> gutov.dev
Subject: Re: bug#70362: [PATCH] Add font-locking for Go built-in functions in
 go-ts-mode
Date: Thu, 18 Apr 2024 13:32:04 +0300
> Date: Tue, 16 Apr 2024 00:44:16 +0000
> From: Randy Taylor <dev <at> rjt.dev>
> Cc: Yuan Fu <casouri <at> gmail.com>, Dmitry Gutov <dmitry <at> gutov.dev>, Eli Zaretskii <eliz <at> gnu.org>, 70362 <at> debbugs.gnu.org
> 
> Thanks for working on this Noah, it looks good to me as well.
> 
> Perhaps builtin could come before constant in treesit-font-lock-feature-list to keep things alphabetical?

I've rearranged them, thanks for noticing this.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70362; Package emacs. (Thu, 18 Apr 2024 13:46:04 GMT) Full text and rfc822 format available.

Message #31 received at 70362 <at> debbugs.gnu.org (full text, mbox):

From: Randy Taylor <dev <at> rjt.dev>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: noah.v.peart <at> gmail.com, casouri <at> gmail.com, 70362 <at> debbugs.gnu.org,
 dmitry <at> gutov.dev
Subject: Re: bug#70362: [PATCH] Add font-locking for Go built-in functions in
 go-ts-mode
Date: Thu, 18 Apr 2024 13:44:56 +0000
[Message part 1 (text/plain, inline)]
On Thursday, April 18th, 2024 at 06:32, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
> > Date: Tue, 16 Apr 2024 00:44:16 +0000
> 
> > From: Randy Taylor dev <at> rjt.dev
> > Cc: Yuan Fu casouri <at> gmail.com, Dmitry Gutov dmitry <at> gutov.dev, Eli Zaretskii eliz <at> gnu.org, 70362 <at> debbugs.gnu.org
> > 
> > Thanks for working on this Noah, it looks good to me as well.
> > 
> > Perhaps builtin could come before constant in treesit-font-lock-feature-list to keep things alphabetical?
> 
> 
> I've rearranged them, thanks for noticing this.

Thanks, but I was referring to the treesit-font-lock-feature-list variable (see attached patch), not go-ts-mode--font-lock-settings which is not alphabetized.
[0001-Alphabetize-go-ts-mode-s-treesit-font-lock-feature-l.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70362; Package emacs. (Thu, 18 Apr 2024 14:17:03 GMT) Full text and rfc822 format available.

Message #34 received at 70362 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Randy Taylor <dev <at> rjt.dev>
Cc: noah.v.peart <at> gmail.com, casouri <at> gmail.com, 70362 <at> debbugs.gnu.org,
 dmitry <at> gutov.dev
Subject: Re: bug#70362: [PATCH] Add font-locking for Go built-in functions in
 go-ts-mode
Date: Thu, 18 Apr 2024 17:15:22 +0300
> Date: Thu, 18 Apr 2024 13:44:56 +0000
> From: Randy Taylor <dev <at> rjt.dev>
> Cc: noah.v.peart <at> gmail.com, casouri <at> gmail.com, dmitry <at> gutov.dev, 70362 <at> debbugs.gnu.org
> 
> On Thursday, April 18th, 2024 at 06:32, Eli Zaretskii <eliz <at> gnu.org> wrote:
> > 
> > > Date: Tue, 16 Apr 2024 00:44:16 +0000
> > 
> > > From: Randy Taylor dev <at> rjt.dev
> > > Cc: Yuan Fu casouri <at> gmail.com, Dmitry Gutov dmitry <at> gutov.dev, Eli Zaretskii eliz <at> gnu.org, 70362 <at> debbugs.gnu.org
> > > 
> > > Thanks for working on this Noah, it looks good to me as well.
> > > 
> > > Perhaps builtin could come before constant in treesit-font-lock-feature-list to keep things alphabetical?
> > 
> > 
> > I've rearranged them, thanks for noticing this.
> 
> Thanks, but I was referring to the treesit-font-lock-feature-list variable (see attached patch), not go-ts-mode--font-lock-settings which is not alphabetized.

Thanks, installed.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 17 May 2024 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified today.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.