From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Noah Peart Newsgroups: gmane.emacs.bugs Subject: bug#71209: [PATCH] Add font-locking for variables in go-ts-mode range clauses Date: Thu, 30 May 2024 06:25:56 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000046e5730619abcf0b" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40398"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71209@debbugs.gnu.org To: Randy Taylor Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 30 15:28:23 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sCfpP-000AHr-EB for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 May 2024 15:28:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCfpB-0002Dp-B3; Thu, 30 May 2024 09:28:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCfov-00026L-Ci for bug-gnu-emacs@gnu.org; Thu, 30 May 2024 09:27:55 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sCfot-0001A7-LT for bug-gnu-emacs@gnu.org; Thu, 30 May 2024 09:27:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sCfp3-0000l3-Rl for bug-gnu-emacs@gnu.org; Thu, 30 May 2024 09:28:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noah Peart Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 May 2024 13:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71209 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 71209-submit@debbugs.gnu.org id=B71209.17170756512838 (code B ref 71209); Thu, 30 May 2024 13:28:01 +0000 Original-Received: (at 71209) by debbugs.gnu.org; 30 May 2024 13:27:31 +0000 Original-Received: from localhost ([127.0.0.1]:35651 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCfoY-0000ji-Ro for submit@debbugs.gnu.org; Thu, 30 May 2024 09:27:31 -0400 Original-Received: from mail-oi1-f175.google.com ([209.85.167.175]:55643) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCfoT-0000jI-Mz for 71209@debbugs.gnu.org; Thu, 30 May 2024 09:27:29 -0400 Original-Received: by mail-oi1-f175.google.com with SMTP id 5614622812f47-3c9b94951d5so383643b6e.3 for <71209@debbugs.gnu.org>; Thu, 30 May 2024 06:27:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717075569; x=1717680369; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=zLoJ695Dhyl9jOOzoLFTrePqRinS4WgFdU28Twg+fnA=; b=W3A5ETchCGr42XFZIcJUhF5GhzoptGDIttqB3/j3BbVNsPrHQeUIAqIHbJGd5YHHyc 3mr04OjpdIhgxeVtFeZeFGbV9h+Y6SlPmK0YnqXCIT6zsCq3rDqIu00U10sDf8cAmFIO +bqn0VmxiNqO+aTSnVLMnw82SxQqUkqvNOFW6jlWTfR87+TSmQ3KrrrnMKQ00+5rDGq9 cEu59SdvqvthyzBMfhbxYk/TezTZ4/NkDIRnsH/HZgrhev6hGLrzqi79nrqVNVd6Rmtx wBid5ebMINYRDOhlMfIHcbBTACExHNLcGdEkZy6+kffw39DTJ2dzQjm0+7++yuTnjw0Q Q91w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717075569; x=1717680369; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zLoJ695Dhyl9jOOzoLFTrePqRinS4WgFdU28Twg+fnA=; b=Fg/tUmCFqpz7W9RirL0Opn9zGVUTxigalZcdgClzouKwZw1VmwjvvpNvHUepqe9foB GQ3XgwDpg0cM1nD9FoMs+SEwbKMdMlS4g46e+NKXGnbx36OSi7Bq7AQDsuvx0exTw8qh lQKc4bQ7wKE8HRMXh5r+CkAbCsFi8glOvGWXdRvx7BtqaWVviM2zh8UU0+ORpFuDpgrU cI+mAs/4rJycqMNTDBQgNwZxqgv9IqhZB+brXNc+dztVYJmzbEic/iumxvCKzWtVlw79 zFPkaMmZzM8zg3AOhiYQGJHnqyhgaTF/fZDfxHJseqpuHFx7xQxrLYMwkAvKuQw3u3jK GLFw== X-Gm-Message-State: AOJu0Yyz2Sga5OSRXMaA2nsRg/D/P2FB/3G24R/cEuLE9jHUaqLlbD6k sFLU/ZhphQIKL1uZjQHHuZa5IfXlL+ukq6LAmqyNtduqBSfiGgh+XkO/hxRdBGCvgCnyH2AibfK xyd2ChjzD8l7t/1GDixNcxy7yrKPXe8oOEjBGkQ== X-Google-Smtp-Source: AGHT+IEiN7eynwJmNS0RAv2Srmki8hYbnWzLon3ZwbNarzGRIypYiTA+OTJEL4CGcsIvlv0GWu63WallyLdtTRdFYcw= X-Received: by 2002:a05:6808:1a:b0:3d1:be9f:c9a3 with SMTP id 5614622812f47-3d1dcbe9aaemr2101806b6e.0.1717075567894; Thu, 30 May 2024 06:26:07 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:286223 Archived-At: --00000000000046e5730619abcf0b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > it seems we already highlight this when at treesit-font-lock-level 4? They get highlighted with `font-lock-variable-use-face` at level 4, but shouldn't they be getting `font-lock-variable-name-face` in the 'definition feature? On Mon, May 27, 2024 at 7:46=E2=80=AFPM Randy Taylor wrote: > On Sunday, May 26th, 2024 at 08:41, Noah Peart > wrote: > > > Tags: patch > > > > Adds font-locking rule in go-ts-mode to give variables in range clauses > > font-lock-variable-name-face (in feature 'definition). > > > > For example, the following font-locking is added: > > > > for idx, val :=3D range arr {} > > // ^ font-lock-variable-name-face > > // ^ font-lock-variable-name-face > > > > The patch also adds a test case. > > > > > > In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version > > 3.24.33, cairo version 1.16.0) of 2024-05-21 built on noah-X580VD > > Repository revision: 63d914e377f7cc37056de2503bfbeea831875037 > > Repository branch: master > > Windowing system distributor 'The X.Org Foundation', version > 11.0.12101004 > > System Description: Ubuntu 22.04.4 LTS > > > > Configured using: > > 'configure --prefix=3D/usr/local --with-modules --with-tree-sitter > > --with-threads --with-x-toolkit=3Dgtk3 --with-xwidgets --with-gnutls > > --with-json --with-mailutils --with-jpeg --with-png --with-rsvg > > --with-tiff --with-xml2 --with-xpm --with-imagemagick CC=3Dgcc-12 > > CXX=3Dgcc-12' > > Thanks, but it seems we already highlight this when at > treesit-font-lock-level 4? > --00000000000046e5730619abcf0b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> it seems we already highlight this when at treesit-fo= nt-lock-level 4?

They get highlighted with `font-lock-va= riable-use-face` at level 4, but shouldn't
they be getting `f= ont-lock-variable-name-face` in the 'definition feature?
On Mon, M= ay 27, 2024 at 7:46=E2=80=AFPM Randy Taylor <dev@rjt.dev> wrote:
On Sunday, May 26th, 2024 at 08:41, Noah Peart <noah.v.peart@gmail.com= > wrote:

> Tags: patch
>
> Adds font-locking rule in go-ts-mode to give variables in range clause= s
> font-lock-variable-name-face (in feature 'definition).
>
> For example, the following font-locking is added:
>
> for idx, val :=3D range arr {}
> // ^ font-lock-variable-name-face
> // ^ font-lock-variable-name-face
>
> The patch also adds a test case.
>
>
> In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
> 3.24.33, cairo version 1.16.0) of 2024-05-21 built on noah-X580VD
> Repository revision: 63d914e377f7cc37056de2503bfbeea831875037
> Repository branch: master
> Windowing system distributor 'The X.Org Foundation', version 1= 1.0.12101004
> System Description: Ubuntu 22.04.4 LTS
>
> Configured using:
> 'configure --prefix=3D/usr/local --with-modules --with-tree-sitter=
> --with-threads --with-x-toolkit=3Dgtk3 --with-xwidgets --with-gnutls > --with-json --with-mailutils --with-jpeg --with-png --with-rsvg
> --with-tiff --with-xml2 --with-xpm --with-imagemagick CC=3Dgcc-12
> CXX=3Dgcc-12'

Thanks, but it seems we already highlight this when at treesit-font-lock-le= vel 4?
--00000000000046e5730619abcf0b--