From unknown Tue Jun 17 22:27:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78130: [PATCH] 31.0.50; csharp-ts-mode does not highlight generic types correctly everywhere Resent-From: Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 Apr 2025 09:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 78130 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 78130@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.174592034410421 (code B ref -1); Tue, 29 Apr 2025 09:53:02 +0000 Received: (at submit) by debbugs.gnu.org; 29 Apr 2025 09:52:24 +0000 Received: from localhost ([127.0.0.1]:49764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u9hdY-0002i0-Ds for submit@debbugs.gnu.org; Tue, 29 Apr 2025 05:52:24 -0400 Received: from lists.gnu.org ([2001:470:142::17]:39468) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u9hdQ-0002gH-Of for submit@debbugs.gnu.org; Tue, 29 Apr 2025 05:52:20 -0400 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 1u9hdJ-0007tp-4a for bug-gnu-emacs@gnu.org; Tue, 29 Apr 2025 05:52:10 -0400 Received: from fout-b8-smtp.messagingengine.com ([202.12.124.151]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u9hdA-0001JN-ER for bug-gnu-emacs@gnu.org; Tue, 29 Apr 2025 05:52:07 -0400 Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id F3CC8114018D for ; Tue, 29 Apr 2025 05:51:58 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Tue, 29 Apr 2025 05:51:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= secure.kjonigsen.net; h=cc:content-type:content-type:date:date :from:from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to; s=fm2; t=1745920318; x=1746006718; bh=OOOUzdjkZM DNQV6YYNhUCo2RgUmOLCCombGGpVSptc8=; b=bxOTpba6lH01SG/kvV92/gKZSf SzjSkZBdwljwrRnKNRW5e1RM44SbNgncg2O+n7WsKlQhnKO6oAWdpXi9dvpfYqAd tYIgSOoJw17iv3lWHcWH5RaoL4reHgVa7CyZJ2icizHaATzsq1Z6ttAxWmiC2EzK PyPiwsQg5LIV3gl4ugCGwnRE6+63x+M5SsNVDOBjK8z59SXNMZBZSOwTF7lThDwZ mlGoZ7L9D4hAuNxR09ThcVtwEf9pHA7aeA0CQrQPKWcfbuJJeHyCIEMKdLDSHvXe NFjshmMbk/cnL8k/NuKXQGEsczgb/QyydmZy8jvO2q7NPfgPYmOonHXeZs8w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1745920318; x= 1746006718; bh=OOOUzdjkZMDNQV6YYNhUCo2RgUmOLCCombGGpVSptc8=; b=H 98uQijj0iktYXdi9tU44AQrGueqKJcniWcNr49PdmdNZukHrbNj85xxy1L8ZYBnN zPVAL9eIFJD4ltCyxxXLJjeG/7e6g4bXF0ZuEiao613JhrxhoFNw5OEuL4mC9w75 Wlz+uWTzm62nRbUjWAolQLvephQbHobrr4Kwz5oV1GN5LUtKqeOeHKwxhXMKY2BQ LKMxVziM1PTYq6XdA7Hc2rt9KL/rsajYpmC4BasrdU6ysyqMpB3YuyTeV7ROPNy9 JNTKeW3EOXj9gcL8fwX1yTkJqJ95ANYI35Fx/R+FOFEIYpIchqR/CEI/sE3EM/y5 XRiJw2ZcLlajjC0abc0Fw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvieefhedtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhtg gguffkfffvofesrgdtmherhhdtjeenucfhrhhomheplfhoshhtvghinhcumfhjpphnihhg shgvnhcuoehjohhsthgvihhnsehsvggtuhhrvgdrkhhjohhnihhgshgvnhdrnhgvtheqne cuggftrfgrthhtvghrnhepffdtieegteeggffhkefgtdelffdufffgffefvdefffeghedu vdejvdfhvdffveeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepjhhoshhtvghinhesshgvtghurhgvrdhkjhhonhhighhsvghnrdhnvghtpdhn sggprhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegsuhhgqd hgnhhuqdgvmhgrtghssehgnhhurdhorhhg X-ME-Proxy: Feedback-ID: ib2f84088:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 29 Apr 2025 05:51:58 -0400 (EDT) From: Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= Content-Type: multipart/alternative; boundary="Apple-Mail=_5317F78B-33B3-4712-934C-C9F497DE6AE2" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.500.181.1.5\)) Message-Id: Date: Tue, 29 Apr 2025 11:51:47 +0200 X-Mailer: Apple Mail (2.3826.500.181.1.5) Received-SPF: pass client-ip=202.12.124.151; envelope-from=jostein@secure.kjonigsen.net; helo=fout-b8-smtp.messagingengine.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) --Apple-Mail=_5317F78B-33B3-4712-934C-C9F497DE6AE2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hey everyone. When using charp-ts-mode to edit C# files, you often work with = generic-types (ie List, etc). csharp-ts-mode has treesitter = selectors for this type of syntax, but the current implementation = constraints it to only be used in specialized circumstances, when we = really want to apply it all over the place. As an example, generic return-types in function declarations are = currently not highlighted correctly. Attached is a patch which removes this unneeded narrowing of the = selector and makes generic types look correct everywhere. It also corrects a small semantic error (property-use vs variable-use) = in initializer-expressions, but I didn't feel like making a separate = bug-report for that :) =E2=80=94 Kind Regards Jostein Kj=C3=B8nigsen =EF=BF=BC= --Apple-Mail=_5317F78B-33B3-4712-934C-C9F497DE6AE2 Content-Type: multipart/mixed; boundary="Apple-Mail=_858B19BD-586E-4031-8FD6-4A336AEB020D" --Apple-Mail=_858B19BD-586E-4031-8FD6-4A336AEB020D Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hey = everyone.

When using charp-ts-mode to edit C# files, = you often work with generic-types (ie List<string>, etc). = csharp-ts-mode has treesitter selectors for this type of syntax, but the = current implementation constraints it to only be used in specialized = circumstances, when we really want to apply it all over the = place.

As an example, generic return-types in = function declarations are currently not highlighted = correctly.

Attached is a patch which removes = this unneeded narrowing of the selector and makes generic types look = correct everywhere.

It also corrects a small = semantic error (property-use vs variable-use) in = initializer-expressions, but I didn't feel like making a separate = bug-report for that :)

=E2=80=94
Kind Regards
Jostein = Kj=C3=B8nigsen


= --Apple-Mail=_858B19BD-586E-4031-8FD6-4A336AEB020D Content-Disposition: attachment; filename=0001-csharp-mode.el-Fix-fontification-of-generic-types.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-csharp-mode.el-Fix-fontification-of-generic-types.patch" Content-Transfer-Encoding: quoted-printable =46rom=2051cb14bc21268119df5c973db8b5e09518affce6=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Jostein=3D20Kj=3DC3=3DB8nigsen?=3D=20= =0ADate:=20Fri,=2025=20Apr=202025=2015:09:11=20= +0200=0ASubject:=20[PATCH]=20csharp-mode.el:=20Fix=20fontification=20of=20= generic=20types=0A=0Acsharp-ts-mode--font-lock-settings:=0A-=20= initialized=20properties=20should=20use=20property=20faces.=0A-=20wide=20= generic=20type=20highlighting=20expression.=20too=20restrictive!=0A---=0A= =20lisp/progmodes/csharp-mode.el=20|=2010=20+++-------=0A=201=20file=20= changed,=203=20insertions(+),=207=20deletions(-)=0A=0Adiff=20--git=20= a/lisp/progmodes/csharp-mode.el=20b/lisp/progmodes/csharp-mode.el=0A= index=20bba7cf681e9..12c6a169016=20100644=0A---=20= a/lisp/progmodes/csharp-mode.el=0A+++=20b/lisp/progmodes/csharp-mode.el=0A= @@=20-777,7=20+777,7=20@@=20csharp-ts-mode--font-lock-settings=0A=20=20=20= =20:feature=20'expression=0A=20=20=20=20'((conditional_expression=20= (identifier)=20@font-lock-variable-use-face)=0A=20=20=20=20=20=20= (postfix_unary_expression=20(identifier)*=20= @font-lock-variable-use-face)=0A-=20=20=20=20=20(initializer_expression=20= (assignment_expression=20left:=20(identifier)=20= @font-lock-variable-use-face))=0A+=20=20=20=20=20(initializer_expression=20= (assignment_expression=20left:=20(identifier)=20= @font-lock-property-use-face))=0A=20=20=20=20=20=20= (interpolated_string_expression=0A=20=20=20=20=20=20=20(interpolation=0A=20= =20=20=20=20=20=20=20(identifier)=20@font-lock-variable-use-face))=0A@@=20= -861,12=20+861,8=20@@=20csharp-ts-mode--font-lock-settings=0A=20=20=20=20= =20=20=20(identifier)=20@font-lock-type-face)=0A=20=20=20=20=20=20= (type_argument_list=0A=20=20=20=20=20=20=20(identifier)=20= @font-lock-type-face)=0A-=20=20=20=20=20(type_argument_list=0A-=20=20=20=20= =20=20(generic_name=0A-=20=20=20=20=20=20=20(identifier)=20= @font-lock-type-face))=0A-=20=20=20=20=20(base_list=0A-=20=20=20=20=20=20= (generic_name=0A-=20=20=20=20=20=20=20(identifier)=20= @font-lock-type-face))=0A+=20=20=20=20=20(generic_name=0A+=20=20=20=20=20= =20(identifier)=20@font-lock-type-face)=0A=20=20=20=20=20=20(array_type=0A= =20=20=20=20=20=20=20(identifier)=20@font-lock-type-face)=0A=20=20=20=20=20= =20(cast_expression=20(identifier)=20@font-lock-type-face)=0A--=20=0A= 2.49.0=0A=0A= --Apple-Mail=_858B19BD-586E-4031-8FD6-4A336AEB020D Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii
--Apple-Mail=_858B19BD-586E-4031-8FD6-4A336AEB020D-- --Apple-Mail=_5317F78B-33B3-4712-934C-C9F497DE6AE2-- From unknown Tue Jun 17 22:27:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78130: Acknowledgement ([PATCH] 31.0.50; csharp-ts-mode does not highlight generic types correctly everywhere) Resent-From: Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 Apr 2025 11:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78130 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 78130@debbugs.gnu.org Received: via spool by 78130-submit@debbugs.gnu.org id=B78130.174592522917155 (code B ref 78130); Tue, 29 Apr 2025 11:14:01 +0000 Received: (at 78130) by debbugs.gnu.org; 29 Apr 2025 11:13:49 +0000 Received: from localhost ([127.0.0.1]:51220 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u9iuK-0004Sd-Hq for submit@debbugs.gnu.org; Tue, 29 Apr 2025 07:13:49 -0400 Received: from fhigh-b8-smtp.messagingengine.com ([202.12.124.159]:49113) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u9iuH-0004Rd-8D for 78130@debbugs.gnu.org; Tue, 29 Apr 2025 07:13:46 -0400 Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfhigh.stl.internal (Postfix) with ESMTP id 489D32540205 for <78130@debbugs.gnu.org>; Tue, 29 Apr 2025 07:13:39 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Tue, 29 Apr 2025 07:13:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= secure.kjonigsen.net; h=cc:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1745925219; x=1746011619; bh=YbqjUepbtwZ2jEW8pDfDeIIuKFqXKYSsHy4VWVrxh4U=; b= iIgQTdPsI+BsFPubi2apHizSIf6nlLFCk5oBeEcGjdj06wyeikamu0N4TY2ursd0 sz4Mv+OyKp19WvnX5vu6JvH5cNGSyCs+Df7UUuovLlctj1HmzzPkKKB3eaDQ/N6Z 4v7ydMbpt7j6MzHPwfz21g0juI9i5uyehXxScX9PFmHKwKOmObZBbWpNP5s+Rnme 553GkXFy6QwRS6x3+Ssr09h+Z48BEUYh0JLVpIhK0iIy/mimGvFwOr87A6HSJon0 ELMX/TPtPIY2W1KtEO/BHX/TcKqqjL+nGG3q050y14wrlHRdkVY8Mkmq0kxTfGgi dHUeQXglutrHDqY/z86lDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1745925219; x=1746011619; bh=YbqjUepbtwZ2jEW8pDfDeIIuKFqXKYSsHy4 VWVrxh4U=; b=J1q2aY4j25jx7+3COhR4ZGF7ZVGVEbVQ0SlgMQJdMFh/F8eT6aR VbdcJE3VYAjY99g23hWLZ1L6IrLHJqiMhPNWYMQsXSdHEddy8DaQRjxj5Hhb7way 7mHi1eOsebYme9edKv3DPrxNC2kbNm36gwfX3Kuo9MBc1hhBmCNYRoJLAnMUDT+D 4mtwpCKlYVL37fUnh6XCF0B85C/0vO88AK7cAjnlytKqbz6rK5oPX84CFU+4ESB/ 1ERgQoc9LhekGAqmLvn/3RPQ68B/4Wrtlo87hDyYq0VyZrjThbb+Zx/C9MFQm3J0 imeF2Jdw7TBO6Xkp8TrJIvTXQtZkZYF2MjA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvieefieejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhtg gguffffhfvjgfkofesrgdtmherhhdtjeenucfhrhhomheplfhoshhtvghinhcumfhjpphn ihhgshgvnhcuoehjohhsthgvihhnsehsvggtuhhrvgdrkhhjohhnihhgshgvnhdrnhgvth eqnecuggftrfgrthhtvghrnhepieevjeekjefhgfevveegveeuvdeigfeluddufeekueff heduvdeiveehteduveefnecuffhomhgrihhnpehgnhhurdhorhhgnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhoshhtvghinhesshgvtghu rhgvrdhkjhhonhhighhsvghnrdhnvghtpdhnsggprhgtphhtthhopedupdhmohguvgepsh hmthhpohhuthdprhgtphhtthhopeejkedufedtseguvggssghughhsrdhgnhhurdhorhhg X-ME-Proxy: Feedback-ID: ib2f84088:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for <78130@debbugs.gnu.org>; Tue, 29 Apr 2025 07:13:38 -0400 (EDT) From: Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= Content-Type: multipart/alternative; boundary="Apple-Mail=_C8BE471D-8CB1-4372-BEB8-503EC95C1B0D" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.500.181.1.5\)) Date: Tue, 29 Apr 2025 13:13:27 +0200 References: In-Reply-To: Message-Id: <1B538D5F-CC27-4D6A-894B-1EB3745404AF@secure.kjonigsen.net> X-Mailer: Apple Mail (2.3826.500.181.1.5) X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Apple-Mail=_C8BE471D-8CB1-4372-BEB8-503EC95C1B0D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Just a FYI: I've uncovered some use-cases which my patch does not = address correctly: namely function invocations. The bug is still real, but I'll be restructuring my fix and submitting = when I think I have something which works better. =E2=80=94 Kind Regards Jostein Kj=C3=B8nigsen > On 29 Apr 2025, at 11:53, GNU bug Tracking System = wrote: >=20 > Thank you for filing a new bug report with debbugs.gnu.org. >=20 > This is an automatically generated reply to let you know your message > has been received. >=20 > Your message is being forwarded to the package maintainers and other > interested parties for their attention; they will reply in due course. >=20 > Your message has been sent to the package maintainer(s): > bug-gnu-emacs@gnu.org >=20 > If you wish to submit further information on this problem, please > send it to 78130@debbugs.gnu.org. >=20 > Please do not send mail to help-debbugs@gnu.org unless you wish > to report a problem with the Bug-tracking system. >=20 > --=20 > 78130: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D78130 > GNU Bug Tracking System > Contact help-debbugs@gnu.org with problems --Apple-Mail=_C8BE471D-8CB1-4372-BEB8-503EC95C1B0D Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Just a FYI: = I've uncovered some use-cases which my patch does not address correctly: = namely function invocations.

The bug is still = real, but I'll be restructuring my fix and submitting when I think I = have something which works better.

=E2=80=94
Kind Regards
Jostein = Kj=C3=B8nigsen

On 29 Apr 2025, at 11:53, GNU = bug Tracking System <help-debbugs@gnu.org> wrote:

Thank you for filing a new = bug report with debbugs.gnu.org.

This is an automatically = generated reply to let you know your message
has been = received.

Your message is being forwarded to the package = maintainers and other
interested parties for their attention; they = will reply in due course.

Your message has been sent to the = package maintainer(s):
bug-gnu-emacs@gnu.org

If you wish to = submit further information on this problem, please
send it to = 78130@debbugs.gnu.org.

Please do not send mail to = help-debbugs@gnu.org unless you wish
to report a problem with the = Bug-tracking system.

--
78130: = https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D78130
GNU Bug = Tracking System
Contact help-debbugs@gnu.org with = problems

= --Apple-Mail=_C8BE471D-8CB1-4372-BEB8-503EC95C1B0D-- From unknown Tue Jun 17 22:27:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78130: Acknowledgement ([PATCH] 31.0.50; csharp-ts-mode does not highlight generic types correctly everywhere) Resent-From: Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 Apr 2025 19:53:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78130 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 78130@debbugs.gnu.org Cc: Yuan Fu Received: via spool by 78130-submit@debbugs.gnu.org id=B78130.174595634112106 (code B ref 78130); Tue, 29 Apr 2025 19:53:06 +0000 Received: (at 78130) by debbugs.gnu.org; 29 Apr 2025 19:52:21 +0000 Received: from localhost ([127.0.0.1]:34322 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u9r08-00039C-Ut for submit@debbugs.gnu.org; Tue, 29 Apr 2025 15:52:21 -0400 Received: from fhigh-b5-smtp.messagingengine.com ([202.12.124.156]:53121) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u9r01-00037X-Up for 78130@debbugs.gnu.org; Tue, 29 Apr 2025 15:52:19 -0400 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.stl.internal (Postfix) with ESMTP id 62BBC25400B8; Tue, 29 Apr 2025 15:52:07 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Tue, 29 Apr 2025 15:52:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= secure.kjonigsen.net; h=cc:cc:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1745956327; x=1746042727; bh=G3wqk0KNI7+mUrw6tHz+6GY/IEVn4BwwH15oh0r4VsU=; b= j5FCw+uri5RS62koaZvuuY8m32mZMpTcB0GwolWvk33z9zVddjMiy8mnIoHsl57k 7xrBH3c1t0HyWXcrY7bC2gi5qQsusjwxcAKnQs+qAyJmEe45RtHzZvEMd6b09TbJ bX10Wr1tcCQF4c8YvscwEX4Ews91BH1f4Kpkqa9HMFMMWzBXdkjXrvpKgdN0gKqD wynn9Msk4t5wE2XyR2JqI4d2xlitO3oxSMcI0ZlQlf/d6TlF6GMv9U3DzlGitD/d o4niy2IeqD6eM974yUTI8PkK80l6mX7Oy9CxkEcTitfgXgoq8M+IsZxNI9AZppda aBmklB5i9pXXB+0Xww10ZA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1745956327; x=1746042727; bh=G3wqk0KNI7+mUrw6tHz+6GY/IEVn4BwwH15 oh0r4VsU=; b=lXjBEa58ee8MQcBTTHpNlQNk5/DlMfesS8ZdDfjhH8JYoGJNKF+ 1MXhEITs4u8YKE6aTnOMrd8ForWnFmUrgkWfTmpuHeXatEj0c0FDiBdFegvndBpE pF2okxEk4TuQmcVbpTEAQUurAXXNyhDMXudFERgh/OAspsU4z5OfZfSDupdCN9K6 Z6ojGkeKIs0JzwrS/auXkNzr4gMp+crMjvaeg5OV7lKJ1sQknp9aC4ipIrMqR4iX o8eK9pv76O061Q8BcTwgqkHXfTDvVUWLYdrusWzD/bSnGaiguXnqmqesUeF4KkWh 6GZfet7SxafiV+4tkWo9z6pucuIYVYiVevw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvieegjedtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhkf gtggfuffgjvefvfhfosegrtdhmrehhtddvnecuhfhrohhmpeflohhsthgvihhnucfmjhpp nhhighhsvghnuceojhhoshhtvghinhesshgvtghurhgvrdhkjhhonhhighhsvghnrdhnvg htqeenucggtffrrghtthgvrhhnpeetjeekuedvgeevgedtfffgheevtdffgeduueehvddt gfegfedtvedtjeduudetueenucffohhmrghinhepghhnuhdrohhrghenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjohhsthgvihhnsehsvggt uhhrvgdrkhhjohhnihhgshgvnhdrnhgvthdpnhgspghrtghpthhtohepvddpmhhouggvpe hsmhhtphhouhhtpdhrtghpthhtohepjeekudeftdesuggvsggsuhhgshdrghhnuhdrohhr ghdprhgtphhtthhopegtrghsohhurhhisehgmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: ib2f84088:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 29 Apr 2025 15:52:06 -0400 (EDT) From: Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= Message-Id: <17B68D1A-0AC9-4673-B497-3145A7D484E2@secure.kjonigsen.net> Content-Type: multipart/alternative; boundary="Apple-Mail=_99C16617-BA67-4D01-A36D-F506692E781E" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.500.181.1.5\)) Date: Tue, 29 Apr 2025 21:51:54 +0200 In-Reply-To: <1B538D5F-CC27-4D6A-894B-1EB3745404AF@secure.kjonigsen.net> References: <1B538D5F-CC27-4D6A-894B-1EB3745404AF@secure.kjonigsen.net> X-Mailer: Apple Mail (2.3826.500.181.1.5) X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Apple-Mail=_99C16617-BA67-4D01-A36D-F506692E781E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Attached is a better patch, which addresses a lot of different areas of = C# fontification. Overall I think these are pure improvements: - fontification of generic types with namespace-prefixes - function-call parameters - variable use in string interpolation - implicitly typed parameters in lambda-expressions - index-expressions - variables used in return-statements - variables used in binary expressions What might warrant some review is the use of the (:match) selector to = identify local variables (as opposed to properties or types) for a more = consistent fontification. This is the first time I'm using it, and I see = there's some repetition in the implementation... Could this be improved = somehow? Do we have a "emacsy" way or convention to do this which I could have = applied, or is it still a bit early wrt treesitter based modes? =EF=BF=BC =E2=80=94 Kind Regards Jostein Kj=C3=B8nigsen > On 29 Apr 2025, at 13:13, Jostein Kj=C3=B8nigsen = wrote: >=20 > Just a FYI: I've uncovered some use-cases which my patch does not = address correctly: namely function invocations. >=20 > The bug is still real, but I'll be restructuring my fix and submitting = when I think I have something which works better. >=20 > =E2=80=94 > Kind Regards > Jostein Kj=C3=B8nigsen >=20 >> On 29 Apr 2025, at 11:53, GNU bug Tracking System = wrote: >>=20 >> Thank you for filing a new bug report with debbugs.gnu.org. >>=20 >> This is an automatically generated reply to let you know your message >> has been received. >>=20 >> Your message is being forwarded to the package maintainers and other >> interested parties for their attention; they will reply in due = course. >>=20 >> Your message has been sent to the package maintainer(s): >> bug-gnu-emacs@gnu.org >>=20 >> If you wish to submit further information on this problem, please >> send it to 78130@debbugs.gnu.org. >>=20 >> Please do not send mail to help-debbugs@gnu.org unless you wish >> to report a problem with the Bug-tracking system. >>=20 >> --=20 >> 78130: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D78130 >> GNU Bug Tracking System >> Contact help-debbugs@gnu.org with problems >=20 --Apple-Mail=_99C16617-BA67-4D01-A36D-F506692E781E Content-Type: multipart/mixed; boundary="Apple-Mail=_D268A18F-F94A-4972-8DC3-3127FD5D1F92" --Apple-Mail=_D268A18F-F94A-4972-8DC3-3127FD5D1F92 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii Attached is a = better patch, which addresses a lot of different areas of C# = fontification.

Overall I think these are pure = improvements:

- fontification of generic = types with namespace-prefixes
- function-call = parameters
- variable use in string interpolation
- = implicitly typed parameters in lambda-expressions
- = index-expressions
- variables used in = return-statements
- variables used in binary = expressions

What might warrant some = review is the use of the (:match) selector to identify local variables = (as opposed to properties or types) for a more consistent fontification. = This is the first time I'm using it, and I see there's some repetition = in the implementation... Could this be improved = somehow?

Do we have a "emacsy" way or = convention to do this which I could have applied, or is it still a bit = early wrt treesitter based = modes?



= --Apple-Mail=_D268A18F-F94A-4972-8DC3-3127FD5D1F92 Content-Disposition: attachment; filename=0001-csharp-mode.el-Improve-csharp-ts-mode-fontification.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-csharp-mode.el-Improve-csharp-ts-mode-fontification.patch" Content-Transfer-Encoding: quoted-printable =46rom=20e7bc9451aa5731159c9a2418d53425514ae06fe1=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Jostein=3D20Kj=3DC3=3DB8nigsen?=3D=20= =0ADate:=20Tue,=2029=20Apr=202025=2014:23:56=20= +0200=0ASubject:=20[PATCH]=20csharp-mode.el:=20Improve=20csharp-ts-mode=20= fontification=0A=0Acsharp-ts-mode--font-lock-settings:=20Improvements=20= in=20lots=20of=20areas.=0A=0A-=20fontification=20of=20generic=20types=20= with=20namespace-prefixes=0A-=20function-call=20parameters=0A-=20= variable=20use=20in=20string=20interpolation=0A-=20implicitly=20typed=20= parameters=20in=20lambda-expressions=0A-=20index-expressions=0A-=20= variables=20used=20in=20return-statements=0A-=20variables=20used=20in=20= binary=20expressions=0A---=0A=20lisp/progmodes/csharp-mode.el=20|=2062=20= +++++++++++++++++++++++++++++++----=0A=201=20file=20changed,=2056=20= insertions(+),=206=20deletions(-)=0A=0Adiff=20--git=20= a/lisp/progmodes/csharp-mode.el=20b/lisp/progmodes/csharp-mode.el=0A= index=20bba7cf681e9..bec94eed35c=20100644=0A---=20= a/lisp/progmodes/csharp-mode.el=0A+++=20b/lisp/progmodes/csharp-mode.el=0A= @@=20-777,15=20+777,49=20@@=20csharp-ts-mode--font-lock-settings=0A=20=20= =20=20:feature=20'expression=0A=20=20=20=20'((conditional_expression=20= (identifier)=20@font-lock-variable-use-face)=0A=20=20=20=20=20=20= (postfix_unary_expression=20(identifier)*=20= @font-lock-variable-use-face)=0A-=20=20=20=20=20(initializer_expression=20= (assignment_expression=20left:=20(identifier)=20= @font-lock-variable-use-face))=0A+=20=20=20=20=20(initializer_expression=20= (assignment_expression=20left:=20(identifier)=20= @font-lock-property-use-face))=0A=20=20=20=20=20=20= (interpolated_string_expression=0A=20=20=20=20=20=20=20(interpolation=0A=20= =20=20=20=20=20=20=20(identifier)=20@font-lock-variable-use-face))=0A=20=20= =20=20=20=20(interpolated_string_expression=0A=20=20=20=20=20=20=20= (interpolation=0A=20=20=20=20=20=20=20=20(member_access_expression=0A-=20= =20=20=20=20=20=20=20expression:=20(identifier)=20= @font-lock-variable-use-face=0A-=20=20=20=20=20=20=20=20name:=20= (identifier)=20@font-lock-property-use-face))))=0A+=20=20=20=20=20=20=20=20= name:=20(identifier)=20@font-lock-property-use-face)))=0A+=20=20=20=20=20= ((interpolated_string_expression=0A+=20=20=20=20=20=20=20(interpolation=0A= +=20=20=20=20=20=20=20=20(member_access_expression=0A+=20=20=20=20=20=20=20= =20=20expression:=20(identifier)=20@font-lock-variable-use-face)))=0A+=20= =20=20=20=20=20(:match=20"^[a-z][A-Za-z0-9]+"=20= @font-lock-variable-use-face))=0A+=20=20=20=20=20= ((element_access_expression=20(identifier)=20= @font-lock-variable-use-face)=0A+=20=20=20=20=20=20(:match=20= "^[a-z][A-Za-z0-9]+"=20@font-lock-variable-use-face))=0A+=20=20=20=20=20= ((element_access_expression=20(identifier)=20= @font-lock-variable-use-face)=0A+=20=20=20=20=20=20(:match=20= "^[a-z][A-Za-z0-9]+"=20@font-lock-variable-use-face))=0A+=20=20=20=20=20= ((return_statement=20(identifier)=20@font-lock-variable-use-face)=0A+=20=20= =20=20=20=20(:match=20"^[a-z][A-Za-z0-9]+"=20= @font-lock-variable-use-face))=0A+=20=20=20=20=20((return_statement=20= (member_access_expression=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20expression:=20(identifier)=20= @font-lock-variable-use-face))=0A+=20=20=20=20=20=20(:match=20= "^[a-z][A-Za-z0-9]+"=20@font-lock-variable-use-face))=0A+=20=20=20=20=20= ((is_pattern_expression=0A+=20=20=20=20=20=20=20expression:=20= (identifier)=20@font-lock-variable-use-face)=0A+=20=20=20=20=20=20= (:match=20"^[a-z][A-Za-z0-9]+"=20@font-lock-variable-use-face))=0A+=20=20= =20=20=20((is_pattern_expression=0A+=20=20=20=20=20=20=20expression:=20= (member_access_expression=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20expression:=20(identifier)=20= @font-lock-variable-use-face))=0A+=20=20=20=20=20=20(:match=20= "^[a-z][A-Za-z0-9]+"=20@font-lock-variable-use-face))=0A+=20=20=20=20=20= (is_pattern_expression=0A+=20=20=20=20=20=20expression:=20= (member_access_expression=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20name:=20(identifier)=20@font-lock-property-use-face))=0A+=20=20= =20=20=20(is_pattern_expression=0A+=20=20=20=20=20=20pattern:=20= (constant_pattern=20(identifier)=20@font-lock-type-face))=0A+=20=20=20=20= =20(is_pattern_expression=0A+=20=20=20=20=20=20pattern:=20= (constant_pattern=20(member_access_expression=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20name:=20(identifier)=20@font-lock-type-face)))=0A+=20=20=20=20=20= ((binary_expression=0A+=20=20=20=20=20=20=20left:=20(identifier)=20= @font-lock-variable-use-face)=0A+=20=20=20=20=20=20(:match=20= "^[a-z][A-Za-z0-9]+"=20@font-lock-variable-use-face))=0A+=20=20=20=20=20= ((binary_expression=0A+=20=20=20=20=20=20=20right:=20(identifier)=20= @font-lock-variable-use-face)=0A+=20=20=20=20=20=20(:match=20= "^[a-z][A-Za-z0-9]+"=20@font-lock-variable-use-face)))=0A=20=0A=20=20=20=20= :language=20'c-sharp=0A=20=20=20=20:feature=20'bracket=0A@@=20-869,6=20= +903,8=20@@=20csharp-ts-mode--font-lock-settings=0A=20=20=20=20=20=20=20=20= (identifier)=20@font-lock-type-face))=0A=20=20=20=20=20=20(array_type=0A=20= =20=20=20=20=20=20(identifier)=20@font-lock-type-face)=0A+=20=20=20=20=20= (qualified_name=0A+=20=20=20=20=20=20name:=20(generic_name=20= (identifier)=20@font-lock-type-face))=0A=20=20=20=20=20=20= (cast_expression=20(identifier)=20@font-lock-type-face)=0A=20=20=20=20=20= =20(cast_expression=20(generic_name=20(identifier)=20= @font-lock-type-face))=0A=20=20=20=20=20=20["operator"]=20= @font-lock-type-face=0A@@=20-941,6=20+977,8=20@@=20= csharp-ts-mode--font-lock-settings=0A=20=20=20=20=20=20=20=20= (identifier)=20@font-lock-variable-name-face))=0A=20=0A=20=20=20=20=20=20= (variable_declaration=20(identifier)=20@font-lock-type-face)=0A+=20=20=20= =20=20(variable_declaration=20(qualified_name=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20name:=20= (generic_name=20(identifier)=20@font-lock-type-face)))=0A=20=20=20=20=20=20= (variable_declaration=20(generic_name=20(identifier)=20= @font-lock-type-face))=0A=20=20=20=20=20=20(variable_declarator=20= (identifier)=20@font-lock-variable-name-face)=0A=20=0A@@=20-949,6=20= +987,8=20@@=20csharp-ts-mode--font-lock-settings=0A=20=20=20=20=20=20= (parameter=20name:=20(identifier)=20@font-lock-variable-name-face)=0A=20=0A= =20=20=20=20=20=20(lambda_expression=20(identifier)=20= @font-lock-variable-name-face)=0A+=20=20=20=20=20(lambda_expression=0A+=20= =20=20=20=20=20parameters:=20(implicit_parameter)=20= @font-lock-variable-name-face)=0A=20=0A=20=20=20=20=20=20= (declaration_expression=20type:=20(identifier)=20@font-lock-type-face)=0A= =20=20=20=20=20=20(declaration_expression=20name:=20(identifier)=20= @font-lock-variable-name-face))=0A@@=20-956,15=20+996,25=20@@=20= csharp-ts-mode--font-lock-settings=0A=20=20=20=20:language=20'c-sharp=0A=20= =20=20=20:feature=20'function=0A=20=20=20=20'((invocation_expression=0A+=20= =20=20=20=20=20function:=20(identifier)=20@font-lock-function-call-face)=0A= +=20=20=20=20=20(invocation_expression=0A=20=20=20=20=20=20=20function:=20= (member_access_expression=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20name:=20(identifier)=20@font-lock-function-call-face))=0A-=20=20= =20=20=20(invocation_expression=0A-=20=20=20=20=20=20function:=20= (identifier)=20@font-lock-function-call-face)=0A=20=20=20=20=20=20= (invocation_expression=0A=20=20=20=20=20=20=20function:=20= (member_access_expression=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20name:=20(generic_name=20(identifier)=20= @font-lock-function-call-face)))=0A=20=20=20=20=20=20= (invocation_expression=0A-=20=20=20=20=20=20function:=20(generic_name=20= (identifier)=20@font-lock-function-call-face)))=0A+=20=20=20=20=20=20= function:=20(generic_name=20(identifier)=20= @font-lock-function-call-face))=0A+=20=20=20=20=20= ((invocation_expression=0A+=20=20=20=20=20=20=20function:=20= (member_access_expression=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20expression:=20(identifier)=20@font-lock-variable-use-face))=0A+=20= =20=20=20=20=20(:match=20"^[a-z][A-Za-z0-9]+"=20= @font-lock-variable-use-face))=0A+=20=20=20=20=20(argument=20= (identifier)=20@font-lock-variable-use-face)=0A+=20=20=20=20=20= ((argument=20(member_access_expression=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20expression:=20(identifier)=20= @font-lock-variable-use-face))=0A+=20=20=20=20=20=20(:match=20= "^[a-z][A-Za-z0-9]+"=20@font-lock-variable-use-face))=0A+=20=20=20=20=20= (argument=20(member_access_expression=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20name:=20(identifier)=20@font-lock-property-use-face)))=0A=20= =0A=20=20=20=20:language=20'c-sharp=0A=20=20=20=20:feature=20= 'escape-sequence=0A--=20=0A2.49.0=0A=0A= --Apple-Mail=_D268A18F-F94A-4972-8DC3-3127FD5D1F92 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

=E2=80=94
Kind Regards
Jostein = Kj=C3=B8nigsen

On 29 Apr 2025, at 13:13, = Jostein Kj=C3=B8nigsen <jostein@secure.kjonigsen.net> = wrote:

Just a FYI: I've uncovered some = use-cases which my patch does not address correctly: namely function = invocations.

The bug is still real, but I'll be = restructuring my fix and submitting when I think I have something which = works better.

=E2=80=94
Kind Regards
Jostein = Kj=C3=B8nigsen

On 29 Apr 2025, at 11:53, GNU = bug Tracking System <help-debbugs@gnu.org> wrote:

Thank you for filing a new = bug report with debbugs.gnu.org.

This is an automatically = generated reply to let you know your message
has been = received.

Your message is being forwarded to the package = maintainers and other
interested parties for their attention; they = will reply in due course.

Your message has been sent to the = package maintainer(s):
bug-gnu-emacs@gnu.org

If you wish to = submit further information on this problem, please
send it to = 78130@debbugs.gnu.org.

Please do not send mail to = help-debbugs@gnu.org unless you wish
to report a problem with the = Bug-tracking system.

--
78130: = https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D78130
GNU Bug = Tracking System
Contact help-debbugs@gnu.org with = problems


= --Apple-Mail=_D268A18F-F94A-4972-8DC3-3127FD5D1F92-- --Apple-Mail=_99C16617-BA67-4D01-A36D-F506692E781E-- From unknown Tue Jun 17 22:27:28 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= Subject: bug#78130: closed (Re: bug#78130: Acknowledgement ([PATCH] 31.0.50; csharp-ts-mode does not highlight generic types correctly everywhere)) Message-ID: References: X-Gnu-PR-Message: they-closed 78130 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 78130@debbugs.gnu.org Date: Thu, 01 May 2025 07:55:04 +0000 Content-Type: multipart/mixed; boundary="----------=_1746086104-15556-1" This is a multi-part message in MIME format... ------------=_1746086104-15556-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #78130: [PATCH] 31.0.50; csharp-ts-mode does not highlight generic types co= rrectly everywhere which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 78130@debbugs.gnu.org. --=20 78130: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D78130 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1746086104-15556-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 78130-done) by debbugs.gnu.org; 1 May 2025 07:54:40 +0000 Received: from localhost ([127.0.0.1]:48235 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uAOkh-00041Q-KR for submit@debbugs.gnu.org; Thu, 01 May 2025 03:54:40 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]:42419) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uAOke-00040y-8Z for 78130-done@debbugs.gnu.org; Thu, 01 May 2025 03:54:36 -0400 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-223f4c06e9fso6402645ad.1 for <78130-done@debbugs.gnu.org>; Thu, 01 May 2025 00:54:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746086070; x=1746690870; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=eU/EWXkOfTNmfUt+4HndxBdtxvThDaoRNNP9rsxxJxM=; b=UT3yU1lot5rsnKIMBEwkrYCB6EFm9SddlK3BXRI9wACcaEWQYc/K2RZRWjHEIl6Z+/ FZvzis3ViKcCDnfURVbrss1qeyN1GCefRV4mmmCtImD8wi5ppbxzHrUHgxewiSB4Wqdo 6slrrRLhaaBmROaadojvrarNNMhc4znBHBEZtsivGvVwd6nnP0pZFjHej6/VWTo6ycwK ++OC92ATSo8WL7B/+o/qbqZ+L0JAhDCE2E1LI/egLZyoNu4BG9+oF7VriCuID2HWhPqF +GDluasuXW4xTbcTQqVvp/2PwlkpdQfv7fInAa4lHS37istlZmPkIevmJr0ydL2KysXr 8XMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746086070; x=1746690870; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eU/EWXkOfTNmfUt+4HndxBdtxvThDaoRNNP9rsxxJxM=; b=MIrd1V/1um6gG1KdpcrCMu+o1Rm4UftQ12mHN2UTB6Cueb9ORwwevgS9iadk7tRKSP M5z36G2EIZJ5qrdiJjIhyANPGa+6+gK9fTUuZbsRYkipYtjdO95tQjICHFgoFFcKDhXt LB+s/GbD321m7LC/DlziPyBQHElnl+uTOhBgTkMd6lFkqXDaYuDE+Cn8MbbWqhgkWNTt 5oChpIb9eVLRyb3b3pYS5F8Tma3pucmZeX5j5gZe9MwfZld29sdEdNC0AGMVkywWBhLJ OcvFZL4JN6lBabwm14zwQwJrquSMzZVXBrDV3WytbHyDytowutq9AgynS3Ym936l0wid Ee+A== X-Gm-Message-State: AOJu0Yy8oKKafZWFQTWvYtObJW04DMTBDhqwbLGsA4fdHPghr4DmdP3m Sn4+epZlqxVACBveXnf57PVMvWf8okXu8jC5uS4N2kf3JRpkSk5CNzR5fQ== X-Gm-Gg: ASbGncvJYjZtq/gr2udc1p9eMa0N9bRAZV01A9Pk2cggsJkXPdjlJnEl5s31Kajd4t+ mxPDTvhBMh1KldQcwKY78cFF6Xcv77y9xU5LgfJoTklTyTUv2BoaqtZVckzdEXfSgVJZL01BQLk Q9E/ODWoNVvITlAC3YsogQ7wgq6OyHQLqNuoiX2HQZV1fDejIwvmb3twxuIwUkS+6FS7UEghETG KYUmfwKABctplwcEVY2qMfRtw5C+2cLbAQDKbHMm63Ik6+pfZx4wFq4jMIDNMDPn1RsGRrSnYKU vU1s9cAEs7jEaGcW2yAO1QiZCKwl/qmmbDbSguV341Hh8wHtYe/2Ik0sLs5epadhHIXWWduJSOk = X-Google-Smtp-Source: AGHT+IEYCriVHITjuUcAnWMZZDef7NRJn67p2Cxb5UknHF/DFsysKfPyyBAsoA0pmuj+XT9YCgFlfA== X-Received: by 2002:a17:902:ce06:b0:215:58be:3349 with SMTP id d9443c01a7336-22e087f00b6mr22311695ad.14.1746086070135; Thu, 01 May 2025 00:54:30 -0700 (PDT) Received: from smtpclient.apple ([2601:646:8f81:6120:18f0:f917:9183:850d]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22e0bc7b0aasm1442065ad.169.2025.05.01.00.54.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 May 2025 00:54:29 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.500.181.1.5\)) Subject: Re: bug#78130: Acknowledgement ([PATCH] 31.0.50; csharp-ts-mode does not highlight generic types correctly everywhere) From: Yuan Fu In-Reply-To: <17B68D1A-0AC9-4673-B497-3145A7D484E2@secure.kjonigsen.net> Date: Thu, 1 May 2025 00:54:19 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <1B538D5F-CC27-4D6A-894B-1EB3745404AF@secure.kjonigsen.net> <17B68D1A-0AC9-4673-B497-3145A7D484E2@secure.kjonigsen.net> To: =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= X-Mailer: Apple Mail (2.3826.500.181.1.5) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 78130-done Cc: 78130-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Apr 29, 2025, at 12:51=E2=80=AFPM, Jostein Kj=C3=B8nigsen = wrote: >=20 > Attached is a better patch, which addresses a lot of different areas = of C# fontification. >=20 > Overall I think these are pure improvements: >=20 > - fontification of generic types with namespace-prefixes > - function-call parameters > - variable use in string interpolation > - implicitly typed parameters in lambda-expressions > - index-expressions > - variables used in return-statements > - variables used in binary expressions >=20 > What might warrant some review is the use of the (:match) selector to = identify local variables (as opposed to properties or types) for a more = consistent fontification. This is the first time I'm using it, and I see = there's some repetition in the implementation... Could this be improved = somehow? >=20 > Do we have a "emacsy" way or convention to do this which I could have = applied, or is it still a bit early wrt treesitter based modes? >=20 Great work! The use of :match seems legit to me. Rust-ts-mode has = something similar for fortifying variable vs type, it doesn=E2=80=99t = use it as many as here though. A bit strange for the grammar to put = properties on identifier too. I don=E2=80=99t have any good idea for = reducing the duplication.=20 I applied the patch to master. Thanks! Yuan= ------------=_1746086104-15556-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 29 Apr 2025 09:52:24 +0000 Received: from localhost ([127.0.0.1]:49764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u9hdY-0002i0-Ds for submit@debbugs.gnu.org; Tue, 29 Apr 2025 05:52:24 -0400 Received: from lists.gnu.org ([2001:470:142::17]:39468) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u9hdQ-0002gH-Of for submit@debbugs.gnu.org; Tue, 29 Apr 2025 05:52:20 -0400 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 1u9hdJ-0007tp-4a for bug-gnu-emacs@gnu.org; Tue, 29 Apr 2025 05:52:10 -0400 Received: from fout-b8-smtp.messagingengine.com ([202.12.124.151]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u9hdA-0001JN-ER for bug-gnu-emacs@gnu.org; Tue, 29 Apr 2025 05:52:07 -0400 Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id F3CC8114018D for ; Tue, 29 Apr 2025 05:51:58 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Tue, 29 Apr 2025 05:51:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= secure.kjonigsen.net; h=cc:content-type:content-type:date:date :from:from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to; s=fm2; t=1745920318; x=1746006718; bh=OOOUzdjkZM DNQV6YYNhUCo2RgUmOLCCombGGpVSptc8=; b=bxOTpba6lH01SG/kvV92/gKZSf SzjSkZBdwljwrRnKNRW5e1RM44SbNgncg2O+n7WsKlQhnKO6oAWdpXi9dvpfYqAd tYIgSOoJw17iv3lWHcWH5RaoL4reHgVa7CyZJ2icizHaATzsq1Z6ttAxWmiC2EzK PyPiwsQg5LIV3gl4ugCGwnRE6+63x+M5SsNVDOBjK8z59SXNMZBZSOwTF7lThDwZ mlGoZ7L9D4hAuNxR09ThcVtwEf9pHA7aeA0CQrQPKWcfbuJJeHyCIEMKdLDSHvXe NFjshmMbk/cnL8k/NuKXQGEsczgb/QyydmZy8jvO2q7NPfgPYmOonHXeZs8w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1745920318; x= 1746006718; bh=OOOUzdjkZMDNQV6YYNhUCo2RgUmOLCCombGGpVSptc8=; b=H 98uQijj0iktYXdi9tU44AQrGueqKJcniWcNr49PdmdNZukHrbNj85xxy1L8ZYBnN zPVAL9eIFJD4ltCyxxXLJjeG/7e6g4bXF0ZuEiao613JhrxhoFNw5OEuL4mC9w75 Wlz+uWTzm62nRbUjWAolQLvephQbHobrr4Kwz5oV1GN5LUtKqeOeHKwxhXMKY2BQ LKMxVziM1PTYq6XdA7Hc2rt9KL/rsajYpmC4BasrdU6ysyqMpB3YuyTeV7ROPNy9 JNTKeW3EOXj9gcL8fwX1yTkJqJ95ANYI35Fx/R+FOFEIYpIchqR/CEI/sE3EM/y5 XRiJw2ZcLlajjC0abc0Fw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvieefhedtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhtg gguffkfffvofesrgdtmherhhdtjeenucfhrhhomheplfhoshhtvghinhcumfhjpphnihhg shgvnhcuoehjohhsthgvihhnsehsvggtuhhrvgdrkhhjohhnihhgshgvnhdrnhgvtheqne cuggftrfgrthhtvghrnhepffdtieegteeggffhkefgtdelffdufffgffefvdefffeghedu vdejvdfhvdffveeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepjhhoshhtvghinhesshgvtghurhgvrdhkjhhonhhighhsvghnrdhnvghtpdhn sggprhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegsuhhgqd hgnhhuqdgvmhgrtghssehgnhhurdhorhhg X-ME-Proxy: Feedback-ID: ib2f84088:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 29 Apr 2025 05:51:58 -0400 (EDT) From: =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= Content-Type: multipart/alternative; boundary="Apple-Mail=_5317F78B-33B3-4712-934C-C9F497DE6AE2" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.500.181.1.5\)) Subject: [PATCH] 31.0.50; csharp-ts-mode does not highlight generic types correctly everywhere Message-Id: Date: Tue, 29 Apr 2025 11:51:47 +0200 To: bug-gnu-emacs@gnu.org X-Mailer: Apple Mail (2.3826.500.181.1.5) Received-SPF: pass client-ip=202.12.124.151; envelope-from=jostein@secure.kjonigsen.net; helo=fout-b8-smtp.messagingengine.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) --Apple-Mail=_5317F78B-33B3-4712-934C-C9F497DE6AE2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hey everyone. When using charp-ts-mode to edit C# files, you often work with = generic-types (ie List, etc). csharp-ts-mode has treesitter = selectors for this type of syntax, but the current implementation = constraints it to only be used in specialized circumstances, when we = really want to apply it all over the place. As an example, generic return-types in function declarations are = currently not highlighted correctly. Attached is a patch which removes this unneeded narrowing of the = selector and makes generic types look correct everywhere. It also corrects a small semantic error (property-use vs variable-use) = in initializer-expressions, but I didn't feel like making a separate = bug-report for that :) =E2=80=94 Kind Regards Jostein Kj=C3=B8nigsen =EF=BF=BC= --Apple-Mail=_5317F78B-33B3-4712-934C-C9F497DE6AE2 Content-Type: multipart/mixed; boundary="Apple-Mail=_858B19BD-586E-4031-8FD6-4A336AEB020D" --Apple-Mail=_858B19BD-586E-4031-8FD6-4A336AEB020D Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hey = everyone.

When using charp-ts-mode to edit C# files, = you often work with generic-types (ie List<string>, etc). = csharp-ts-mode has treesitter selectors for this type of syntax, but the = current implementation constraints it to only be used in specialized = circumstances, when we really want to apply it all over the = place.

As an example, generic return-types in = function declarations are currently not highlighted = correctly.

Attached is a patch which removes = this unneeded narrowing of the selector and makes generic types look = correct everywhere.

It also corrects a small = semantic error (property-use vs variable-use) in = initializer-expressions, but I didn't feel like making a separate = bug-report for that :)

=E2=80=94
Kind Regards
Jostein = Kj=C3=B8nigsen


= --Apple-Mail=_858B19BD-586E-4031-8FD6-4A336AEB020D Content-Disposition: attachment; filename=0001-csharp-mode.el-Fix-fontification-of-generic-types.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-csharp-mode.el-Fix-fontification-of-generic-types.patch" Content-Transfer-Encoding: quoted-printable =46rom=2051cb14bc21268119df5c973db8b5e09518affce6=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Jostein=3D20Kj=3DC3=3DB8nigsen?=3D=20= =0ADate:=20Fri,=2025=20Apr=202025=2015:09:11=20= +0200=0ASubject:=20[PATCH]=20csharp-mode.el:=20Fix=20fontification=20of=20= generic=20types=0A=0Acsharp-ts-mode--font-lock-settings:=0A-=20= initialized=20properties=20should=20use=20property=20faces.=0A-=20wide=20= generic=20type=20highlighting=20expression.=20too=20restrictive!=0A---=0A= =20lisp/progmodes/csharp-mode.el=20|=2010=20+++-------=0A=201=20file=20= changed,=203=20insertions(+),=207=20deletions(-)=0A=0Adiff=20--git=20= a/lisp/progmodes/csharp-mode.el=20b/lisp/progmodes/csharp-mode.el=0A= index=20bba7cf681e9..12c6a169016=20100644=0A---=20= a/lisp/progmodes/csharp-mode.el=0A+++=20b/lisp/progmodes/csharp-mode.el=0A= @@=20-777,7=20+777,7=20@@=20csharp-ts-mode--font-lock-settings=0A=20=20=20= =20:feature=20'expression=0A=20=20=20=20'((conditional_expression=20= (identifier)=20@font-lock-variable-use-face)=0A=20=20=20=20=20=20= (postfix_unary_expression=20(identifier)*=20= @font-lock-variable-use-face)=0A-=20=20=20=20=20(initializer_expression=20= (assignment_expression=20left:=20(identifier)=20= @font-lock-variable-use-face))=0A+=20=20=20=20=20(initializer_expression=20= (assignment_expression=20left:=20(identifier)=20= @font-lock-property-use-face))=0A=20=20=20=20=20=20= (interpolated_string_expression=0A=20=20=20=20=20=20=20(interpolation=0A=20= =20=20=20=20=20=20=20(identifier)=20@font-lock-variable-use-face))=0A@@=20= -861,12=20+861,8=20@@=20csharp-ts-mode--font-lock-settings=0A=20=20=20=20= =20=20=20(identifier)=20@font-lock-type-face)=0A=20=20=20=20=20=20= (type_argument_list=0A=20=20=20=20=20=20=20(identifier)=20= @font-lock-type-face)=0A-=20=20=20=20=20(type_argument_list=0A-=20=20=20=20= =20=20(generic_name=0A-=20=20=20=20=20=20=20(identifier)=20= @font-lock-type-face))=0A-=20=20=20=20=20(base_list=0A-=20=20=20=20=20=20= (generic_name=0A-=20=20=20=20=20=20=20(identifier)=20= @font-lock-type-face))=0A+=20=20=20=20=20(generic_name=0A+=20=20=20=20=20= =20(identifier)=20@font-lock-type-face)=0A=20=20=20=20=20=20(array_type=0A= =20=20=20=20=20=20=20(identifier)=20@font-lock-type-face)=0A=20=20=20=20=20= =20(cast_expression=20(identifier)=20@font-lock-type-face)=0A--=20=0A= 2.49.0=0A=0A= --Apple-Mail=_858B19BD-586E-4031-8FD6-4A336AEB020D Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii
--Apple-Mail=_858B19BD-586E-4031-8FD6-4A336AEB020D-- --Apple-Mail=_5317F78B-33B3-4712-934C-C9F497DE6AE2-- ------------=_1746086104-15556-1--