From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 08 04:35:44 2025 Received: (at submit) by debbugs.gnu.org; 8 Sep 2025 08:35:45 +0000 Received: from localhost ([127.0.0.1]:49296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uvXLk-0008AC-Ek for submit@debbugs.gnu.org; Mon, 08 Sep 2025 04:35:44 -0400 Received: from lists.gnu.org ([2001:470:142::17]:48276) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uvXLf-00089W-J7 for submit@debbugs.gnu.org; Mon, 08 Sep 2025 04:35:40 -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 1uvXLY-0002qj-47 for bug-gnu-emacs@gnu.org; Mon, 08 Sep 2025 04:35:32 -0400 Received: from fout-b5-smtp.messagingengine.com ([202.12.124.148]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uvXLG-00042g-AY for bug-gnu-emacs@gnu.org; Mon, 08 Sep 2025 04:35:30 -0400 Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfout.stl.internal (Postfix) with ESMTP id 0F51A1D000C4; Mon, 8 Sep 2025 04:35:04 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Mon, 08 Sep 2025 04:35:04 -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:message-id:mime-version:reply-to :subject:subject:to:to; s=fm3; t=1757320503; x=1757406903; bh=CS /s+JymyPb2vsPel097g/5Cltu/rbtDjteKoli2pKc=; b=cU6vtfHXh9cRIcZhF/ 5C/1lPRN/231hFGvvKw67zHv5Funipjsy91fLGr552z2pOabZZObisSEJ7JTU6r1 JSLYE//cpJSb3S0rpz+VCpNQoTZmtS0exTdwqVydQ9g5kFGPRgeQuDaGqSQaL3xF 5OhUlqpydvncF2c0B6+hP5qP/WYNukxBun0/yXaP5bVPC3HTF3AZ7R62YFDTD6op CW5pUpZp0V4M4KPxXLaJa8t7XzaAZrGMDPP0SvfaGyvpEfFOP6RHZAqrub+gLlOj /qHdLub0uLmwqBdb8po1E7P5ckyZGQXeoyN6NIofO2gzrvQlYfK+CeN9lAAT8q1V 6pgw== 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:message-id :mime-version:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1757320503; x= 1757406903; bh=CS/s+JymyPb2vsPel097g/5Cltu/rbtDjteKoli2pKc=; b=g lFtGxSbLqcQd9RqNzydGDWqaJij6lskw7peIP8CF0fVDJeOXGYG00NwpMlqpcQXz j3h8Dmiznhg+b9GzUWKoGVuKBzgmLHh/keQzuCfFPWvutNWMzwJK64CKtZFFp43t OrI9FVXW6t/cLbrwR430ZjIKp0LA1v2zJY1m9VMnSXRzscrS6FQ247CftgddSWZV lG+58iS4lFda6PjhKSMhUexm/1TD0fihL/A50e/nzWRTUDAVcKMRSnuG0VL0XtcC HaGeF72bc5Ckz9QsUQZVul3kJk/JmsmcJll0MEG+Vs3mJd6VhFkGAR3MVVyRrNAS MiC7Uga0UM5Wk+4ECWezQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddujedtjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecunecujfgurhephfgtggfukfffvefvofesmhdtmherhhdtje enucfhrhhomheplfhoshhtvghinhcumfhjpphnihhgshgvnhcuoehjohhsthgvihhnsehs vggtuhhrvgdrkhhjohhnihhgshgvnhdrnhgvtheqnecuggftrfgrthhtvghrnhepjedtte ehheevheeuvdefgfevuefgieetfeejjefgledvudeljeffgfetfedugfetnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhoshhtvghinhessh gvtghurhgvrdhkjhhonhhighhsvghnrdhnvghtpdhnsggprhgtphhtthhopedvpdhmohgu vgepshhmthhpohhuthdprhgtphhtthhopegsuhhgqdhgnhhuqdgvmhgrtghssehgnhhurd horhhgpdhrtghpthhtoheptggrshhouhhrihesghhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: ib2f84088:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 8 Sep 2025 04:35:02 -0400 (EDT) From: =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= Content-Type: multipart/mixed; boundary="Apple-Mail=_08957806-A000-41FF-9848-3D401AE7728C" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: [PATCH] 31.0.50; csharp-ts-mode does not fontify variable-use consistently Message-Id: <0CD73DB1-6D03-41F0-8760-92A892BB8786@secure.kjonigsen.net> Date: Mon, 8 Sep 2025 10:34:50 +0200 To: bug-gnu-emacs@gnu.org X-Mailer: Apple Mail (2.3826.700.81) Received-SPF: pass client-ip=202.12.124.148; envelope-from=jostein@secure.kjonigsen.net; helo=fout-b5-smtp.messagingengine.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit Cc: Yuan Fu 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=_08957806-A000-41FF-9848-3D401AE7728C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hey everyone. As I'm getting more and more accustomed to font-lock level = differentiation between variable-declaration and variable-use, I spot = more cases which I think should be fixed in csharp-ts-mode. I've also = found some areas of fontification which has been omitted entirely. This looks inconsistent, and I'm willing to call that a bug :) Attached is a patch which addresses the following areas of = csharp-ts-mode fontification: - hightlight reserved keywords agressively, dont allow misuse as variables etc (the compiler will fail!) - highlight lambda-valued variables as funtions - improve semantics of function/class annotations using attributes (maps closer to using-something than declaring it). also: rename to "attribute". "property" has a different, defined meaning in C#. - better highlight variable-use in different scenarios (function-calls, if-statements, assignment-expressions, property-use, anonymous object initializers) - better hight property-use (anonymous object initializers) =E2=80=94 Kind Regards Jostein Kj=C3=B8nigsen --Apple-Mail=_08957806-A000-41FF-9848-3D401AE7728C Content-Disposition: attachment; filename=0001-csharp-ts-mode-fontification-fixes.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-csharp-ts-mode-fontification-fixes.patch" Content-Transfer-Encoding: quoted-printable =46rom=20f48564f763cdbaf95e4d676c63f5591ccedf7c9c=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Jostein=3D20Kj=3DC3=3DB8nigsen?=3D=20= =0ADate:=20Wed,=2027=20Aug=202025=2011:05:28=20= +0200=0ASubject:=20[PATCH]=20csharp-ts-mode:=20fontification=20fixes=0A=0A= *=20csharp-ts-mode--font-lock-settings:=20tweak/add=20rules=0A=0A-=20= hightlight=20reserved=20keywords=20agressively,=20dont=20allow=20misuse=20= as=0A=20=20variables=20etc=20(the=20compiler=20will=20fail!)=0A-=20= highlight=20lambda-valued=20variables=20as=20funtions=0A-=20improve=20= semantics=20of=20function/class=20annotations=20using=20attributes=0A=20=20= (maps=20closer=20to=20using-something=20than=20declaring=20it).=20also:=20= rename=20to=0A=20=20"attribute".=20"property"=20has=20a=20different,=20= defined=20meaning=20in=20C#.=0A-=20better=20highlight=20variable-use=20= in=20different=20scenarios=20(function-calls,=0A=20=20if-statements,=20= assignment-expressions,=20property-use,=20anonymous=20object=0A=20=20= initializers)=0A-=20better=20hight=20property-use=20(anonymous=20object=20= initializers)=0A=0ARemove=20extensive=20use=20of=20"override"=20making=20= evalutation=20hard-to-reason=20about.=0A---=0A=20= lisp/progmodes/csharp-mode.el=20|=2077=20= +++++++++++++++++++++++++++--------=0A=201=20file=20changed,=2060=20= insertions(+),=2017=20deletions(-)=0A=0Adiff=20--git=20= a/lisp/progmodes/csharp-mode.el=20b/lisp/progmodes/csharp-mode.el=0A= index=20abd14d2aa1c..f75922b3b38=20100644=0A---=20= a/lisp/progmodes/csharp-mode.el=0A+++=20b/lisp/progmodes/csharp-mode.el=0A= @@=20-788,6=20+788,18=20@@=20csharp-ts-mode--font-lock-settings=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=20= (initializer_expression=20(assignment_expression=20left:=20(identifier)=20= @font-lock-property-use-face))=0A+=20=20=20=20=20= (anonymous_object_creation_expression=0A+=20=20=20=20=20=20(identifier)=20= @font-lock-property-use-face=0A+=20=20=20=20=20=20(identifier)=20= @font-lock-variable-use-face)=0A+=20=20=20=20=20= (anonymous_object_creation_expression=0A+=20=20=20=20=20=20(identifier)=20= @font-lock-property-use-face=0A+=20=20=20=20=20=20= [(object_creation_expression)=0A+=20=20=20=20=20=20=20(integer_literal)=0A= +=20=20=20=20=20=20=20(string_literal)=0A+=20=20=20=20=20=20=20= (binary_expression)=0A+=20=20=20=20=20=20=20(invocation_expression)=0A+=20= =20=20=20=20=20=20(member_access_expression)=0A+=20=20=20=20=20=20=20= (conditional_expression)])=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= -829,7=20+841,26=20@@=20csharp-ts-mode--font-lock-settings=0A=20=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=20((binary_expression=0A=20=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=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(assignment_expression=0A= +=20=20=20=20=20=20right:=20(identifier)=20@font-lock-variable-use-face)=0A= +=20=20=20=20=20(expression_statement=20;;=20capture=20parent=20node=20= to=20NOT=20shadow=20variable_declaration=0A+=20=20=20=20=20=20= (assignment_expression=0A+=20=20=20=20=20=20=20left:=20(identifier)=20= @font-lock-variable-use-face))=0A+=0A+=20=20=20=20=20;;=20handle=20more=20= specific=20matchers=20before=20generalized=0A+=20=20=20=20=20;;=20= variable-use=20fallback=0A+=20=20=20=20=20(invocation_expression=0A+=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=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(member_access_expression=0A+=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+=0A+=20=20=20=20=20= (member_access_expression=0A+=20=20=20=20=20=20expression:=20= (identifier)=20@font-lock-variable-use-face=0A+=20=20=20=20=20=20name:=20= (identifier)=20@font-lock-property-use-face)=0A+=20=20=20=20=20= (if_statement=20condition:=20(identifier)=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-855,13=20+886,19=20@@=20= csharp-ts-mode--font-lock-settings=0A=20=20=20=20=20=20(modifier)=20= @font-lock-keyword-face=0A=20=20=20=20=20=20,@(if=20= (csharp-ts-mode--test-this-expression)=0A=20=20=20=20=20=20=20=20=20=20=20= =20'((this_expression)=20@font-lock-keyword-face)=0A-=20=20=20=20=20=20=20= =20=20'("this"=20@font-lock-keyword-face)))=0A+=20=20=20=20=20=20=20=20=20= '("this"=20@font-lock-keyword-face))=0A+=0A+=20=20=20=20=20;;=20avoid=20= fontifying=20indentifiers=20with=20a=20keyword-values=20as=20identifiers=0A= +=20=20=20=20=20((identifier)=20@font-lock-keyword-face=0A+=20=20=20=20=20= =20(:match=20,(concat=20"\\`"=20(regexp-opt=20csharp-ts-mode--keywords=20= t)=20"\\'")=20@font-lock-keyword-face)))=0A=20=0A=20=20=20=20:language=20= 'c-sharp=0A=20=20=20=20:override=20t=0A-=20=20=20:feature=20'property=0A= -=20=20=20`((attribute=20(identifier)=20@font-lock-property-use-face=20= (attribute_argument_list))=0A-=20=20=20=20=20(attribute=20(identifier)=20= @font-lock-property-use-face))=0A+=20=20=20:feature=20'attribute=0A+=20=20= =20`((attribute_list=0A+=20=20=20=20=20=20"["=20= @font-lock-variable-use-face=0A+=20=20=20=20=20=20(attribute=20name:=20= (identifier)=20@font-lock-variable-use-face)=0A+=20=20=20=20=20=20"]"=20= @font-lock-variable-use-face))=0A=20=0A=20=20=20=20:language=20'c-sharp=0A= =20=20=20=20:override=20t=0A@@=20-896,7=20+933,6=20@@=20= csharp-ts-mode--font-lock-settings=0A=20=20=20=20=20=20= @font-lock-string-face)=0A=20=0A=20=20=20=20:language=20'c-sharp=0A-=20=20= =20:override=20t=0A=20=20=20=20:feature=20'type=0A=20=20=20=20= `((predefined_type)=20@font-lock-type-face=0A=20=20=20=20=20=20= (implicit_type)=20@font-lock-type-face=0A@@=20-941,7=20+977,6=20@@=20= csharp-ts-mode--font-lock-settings=0A=20=0A=20=20=20=20:language=20= 'c-sharp=0A=20=20=20=20:feature=20'definition=0A-=20=20=20:override=20t=0A= =20=20=20=20`((qualified_name=20(identifier)=20@font-lock-type-face)=0A=20= =20=20=20=20=20(using_directive=20(identifier)=20@font-lock-type-face)=0A= =20=20=20=20=20=20,@(when=20(csharp-ts-mode--test-name-equals)=0A@@=20= -980,6=20+1015,23=20@@=20csharp-ts-mode--font-lock-settings=0A=20=20=20=20= =20=20(method_declaration=20,csharp-ts-mode--type-field=20(generic_name=20= (identifier)=20@font-lock-type-face))=0A=20=20=20=20=20=20= (method_declaration=20name:=20(_)=20@font-lock-function-name-face)=0A=20=0A= +=20=20=20=20=20;;=20only=20highlight=20as=20function=20if=20variable=20= contains=20lambda=20expression=0A+=20=20=20=20=20(variable_declarator=0A= +=20=20=20=20=20=20name:=20(identifier)=20@font-lock-function-name-face=0A= +=20=20=20=20=20=20(lambda_expression))=0A+=0A+=20=20=20=20=20;;=20only=20= fontify=20known=20expressions,=20to=20avoid=20the=20need=20for=20a=20= override=0A+=20=20=20=20=20;;=20for=20lambda-variables=0A+=20=20=20=20=20= (variable_declarator=0A+=20=20=20=20=20=20name:=20(identifier)=20= @font-lock-variable-name-face=0A+=20=20=20=20=20=20= [(object_creation_expression)=0A+=20=20=20=20=20=20=20(integer_literal)=0A= +=20=20=20=20=20=20=20(string_literal)=0A+=20=20=20=20=20=20=20= (binary_expression)=0A+=20=20=20=20=20=20=20(invocation_expression)=0A+=20= =20=20=20=20=20=20(member_access_expression)=0A+=20=20=20=20=20=20=20= (conditional_expression)])=0A+=0A=20=20=20=20=20=20(catch_declaration=0A=20= =20=20=20=20=20=20((identifier)=20@font-lock-type-face))=0A=20=20=20=20=20= =20(catch_declaration=0A@@=20-990,7=20+1042,6=20@@=20= csharp-ts-mode--font-lock-settings=0A=20=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=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(variable_declarator=20= (identifier)=20@font-lock-variable-name-face)=0A=20=0A=20=20=20=20=20=20= (parameter=20type:=20(identifier)=20@font-lock-type-face)=0A=20=20=20=20=20= =20(parameter=20type:=20(generic_name=20(identifier)=20= @font-lock-type-face))=0A@@=20-1007,14=20+1058,6=20@@=20= csharp-ts-mode--font-lock-settings=0A=20=20=20=20:feature=20'function=0A=20= =20=20=20'((invocation_expression=0A=20=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=20function:=20= (member_access_expression=0A-=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= (member_access_expression=0A-=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= (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= ((invocation_expression=0A=20=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=20=20expression:=20(identifier)=20@font-lock-variable-use-face))=0A= @@=20-1204,7=20+1247,7=20@@=20csharp-ts-mode=0A=20=20=20(setq-local=20= treesit-font-lock-feature-list=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20'((=20comment=20definition)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(=20keyword=20string=20type=20directives)=0A-=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(=20constant=20escape-sequence=20expression=20= literal=20property)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(=20= constant=20escape-sequence=20expression=20literal=20attribute)=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(=20function=20bracket=20= delimiter=20error)))=0A=20=0A=20=20=20;;=20Imenu.=0A--=20=0A2.51.0=0A=0A= --Apple-Mail=_08957806-A000-41FF-9848-3D401AE7728C-- From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 08 07:15:56 2025 Received: (at 79406) by debbugs.gnu.org; 8 Sep 2025 11:15:56 +0000 Received: from localhost ([127.0.0.1]:49969 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uvZql-00009G-Jx for submit@debbugs.gnu.org; Mon, 08 Sep 2025 07:15:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38624) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uvZqg-00008v-Jp for 79406@debbugs.gnu.org; Mon, 08 Sep 2025 07:15:51 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uvZq7-0001mI-Tf; Mon, 08 Sep 2025 07:15:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=0njDFXIiuo3F5vzqbDSHqgIywrgUhatRYWCRPOOO8H0=; b=n1O0O38LAxFk+fkmaC3e XemqAsjMPMEdTFlBcNgTvemh8gEwm17pDAxlWCnTicxXzeNVc0gCs+TtACguvp/Cr1LXwsfMA3MI3 J5E+EXMJt7JsUBezmFVZemZS0GfDD54kTyGsPTKwMR1399AUhK+pzz7aDWawzDh9P1xH55EPSoJK9 HgtvchB0v6MCjLNTU57NMvceurOKP35iU3Qpkn7J5USPGZHijWl8Opu/EZ/LEm6+0BIZigHanRF9n To7OkqX06VDh0/gkjma+VeZNgfBKvqWX/GVSnzrkF3t/pvDcQBnG7zQK8xKCSw30zIloAfF4nobLM bZL9TUPidt6/Gw==; Date: Mon, 08 Sep 2025 14:14:32 +0300 Message-Id: <86tt1dci1z.fsf@gnu.org> From: Eli Zaretskii To: Jostein =?utf-8?Q?Kj=C3=B8nigsen?= In-Reply-To: <0CD73DB1-6D03-41F0-8760-92A892BB8786@secure.kjonigsen.net> (message from Jostein =?utf-8?Q?Kj=C3=B8nigsen?= on Mon, 8 Sep 2025 10:34:50 +0200) Subject: Re: bug#79406: [PATCH] 31.0.50; csharp-ts-mode does not fontify variable-use consistently References: <0CD73DB1-6D03-41F0-8760-92A892BB8786@secure.kjonigsen.net> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79406 Cc: 79406@debbugs.gnu.org, casouri@gmail.com 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: -3.3 (---) > Cc: Yuan Fu > From: Jostein Kjønigsen > Date: Mon, 8 Sep 2025 10:34:50 +0200 > > As I'm getting more and more accustomed to font-lock level differentiation between variable-declaration and variable-use, I spot more cases which I think should be fixed in csharp-ts-mode. I've also found some areas of fontification which has been omitted entirely. > > This looks inconsistent, and I'm willing to call that a bug :) > > Attached is a patch which addresses the following areas of csharp-ts-mode fontification: > > - hightlight reserved keywords agressively, dont allow misuse as > variables etc (the compiler will fail!) > - highlight lambda-valued variables as funtions > - improve semantics of function/class annotations using attributes > (maps closer to using-something than declaring it). also: rename to > "attribute". "property" has a different, defined meaning in C#. > - better highlight variable-use in different scenarios (function-calls, > if-statements, assignment-expressions, property-use, anonymous object > initializers) > - better hight property-use (anonymous object initializers) Are all of these appropriate for the default value of treesit-font-lock-level? I see that csharp-ts-mode--font-lock-settings doesn't use the level at all -- is that on purpose? From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 08 08:50:50 2025 Received: (at 79406) by debbugs.gnu.org; 8 Sep 2025 12:50:50 +0000 Received: from localhost ([127.0.0.1]:50392 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uvbKb-0000j9-Gb for submit@debbugs.gnu.org; Mon, 08 Sep 2025 08:50:50 -0400 Received: from fout-b7-smtp.messagingengine.com ([202.12.124.150]:49759) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uvbKU-0000im-Kq for 79406@debbugs.gnu.org; Mon, 08 Sep 2025 08:50:46 -0400 Received: from phl-compute-09.internal (phl-compute-09.internal [10.202.2.49]) by mailfout.stl.internal (Postfix) with ESMTP id 629361D00126; Mon, 8 Sep 2025 08:50:36 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Mon, 08 Sep 2025 08:50:36 -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=fm3; t=1757335836; x=1757422236; bh=KcUwrnl72cV65PYQBMfkc9wPIzxVV/QJEiIgMEDejZ4=; b= Of7alQ1RpVnpgKZeG5hqT5w6K46x5Q6cxOIIENfggO+bhsdyP2lFpLLuNPStughX BRDcjB8FQBhfTuVTQ+TLEGEGj3YGJWYamf3x7LEiGz1gv9MTfow6qsXj49TJ9QEw H2SV/6U5dH4ML//i1TfcQIWCooAOI1kPATJK2RNAG4blDV/Au6Oa2w4Z7Y5jCyjI /tlBlQIChpalxUqebibGrfGXW09VFq0QDN1WXqIhoRcqz2XsqnPQjWMfHC6E94po inGmnfAgKz0YnGb/Uj5f2BP1OGtzHwlbQV4MIQ5ZNfkvaNSYkcBc1MTNj19InlcM D0zfIsNznVan5DUVcOyjDw== 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=fm1; t= 1757335836; x=1757422236; bh=KcUwrnl72cV65PYQBMfkc9wPIzxVV/QJEiI gMEDejZ4=; b=Y+YxPxxnyvul5+JeKKLh8cq4a0ghqgwZj7AKvf5p2aZESFDp6yF q1EHC7MGD1wY1VyqDk6KmT+TiPVkQf2+5WM1SBPlSfXcN9ckQMrxWWHbdpMPPbfT +6wFaOORyV0//XeW8GVjHvbIv7zCbgBo0EJFPsInSEGjaIrLUFxd0cqx4obNA+bO 74oqw5LXGICb1/MX1eQU7re00Gu4Xsua4isKP36DrVMawYVArUfSKP+Y6EHctYz6 h1MUCfS4UiFbTImvJT25/V4JIb7zpVOLFPmh6VJAPeIov+C4RK1MuEacpZu80awL MhCcdVaFvZadwp1kMlYIoO4uif8wfrsvCMg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddujeehkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhkfgtggfuffgjvefvfhfosegrtdhmrehhtdejnecuhfhrohhmpeflohhsthgvihhn ucfmjhppnhhighhsvghnuceojhhoshhtvghinhesshgvtghurhgvrdhkjhhonhhighhsvg hnrdhnvghtqeenucggtffrrghtthgvrhhnpedviedtueehleeffeetjefggedvveeludev kefffefhgfejkeetjeehteffgeeugeenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpehjohhsthgvihhnsehsvggtuhhrvgdrkhhjohhnihhgshgv nhdrnhgvthdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpth htohepvghlihiisehgnhhurdhorhhgpdhrtghpthhtohepjeelgedtieesuggvsggsuhhg shdrghhnuhdrohhrghdprhgtphhtthhopegtrghsohhurhhisehgmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: ib2f84088:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 8 Sep 2025 08:50:35 -0400 (EDT) From: =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_A362B0AE-03D7-419A-B0EA-7CDDD5F41177" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: bug#79406: [PATCH] 31.0.50; csharp-ts-mode does not fontify variable-use consistently Date: Mon, 8 Sep 2025 14:50:23 +0200 In-Reply-To: <86tt1dci1z.fsf@gnu.org> To: Eli Zaretskii References: <0CD73DB1-6D03-41F0-8760-92A892BB8786@secure.kjonigsen.net> <86tt1dci1z.fsf@gnu.org> X-Mailer: Apple Mail (2.3826.700.81) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79406 Cc: 79406@debbugs.gnu.org, Yuan Fu 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=_A362B0AE-03D7-419A-B0EA-7CDDD5F41177 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 8 Sep 2025, at 13:14, Eli Zaretskii wrote: >=20 > Are all of these appropriate for the default value of > treesit-font-lock-level? =20 I'll have to be honest and admit I haven't tested any major-mode in = "default" fontification level in probably a decade. My settings is = maximum detail, and I've based my findings on that. It may previously have been difficult to compartementalize some of these = fontifications into different features and levels (due to extensive use = of override:t and rules being heavily order-dependent). With the changes in this patch however, I can probably move some rules = about if that's wanted. Anything in particular you are thinking about? > I see that > csharp-ts-mode--font-lock-settings doesn't use the level at all -- is > that on purpose? I'm not sure I'm following. We have the following LISP to configure = tree-sitter for the different feature-levels? (setq-local treesit-font-lock-feature-list '(( comment definition) ( keyword string type directives) ( constant escape-sequence expression literal attribute) ( function bracket delimiter error))) Can you provide a more concrete example of what you think is missing or = inappropriate and I can try to address that. =E2=80=94 Kind Regards Jostein Kj=C3=B8nigsen --Apple-Mail=_A362B0AE-03D7-419A-B0EA-7CDDD5F41177 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
On 8 Sep = 2025, at 13:14, Eli Zaretskii <eliz@gnu.org> wrote:

Are all of these = appropriate for the default value of
treesit-font-lock-level? =  

I'll have to be honest and = admit I haven't tested any major-mode in "default" fontification level = in probably a decade. My settings is maximum detail, and I've based my = findings on that.

It may previously have been = difficult to compartementalize some of these fontifications into = different features and levels (due to extensive use of override:t and = rules being heavily order-dependent).

With the = changes in this patch however, I can probably move some rules about if = that's wanted. Anything in particular you are thinking = about?

I see = that
csharp-ts-mode--font-lock-settings doesn't use the level at all = -- is
that on = purpose?

I'm not = sure I'm following. We have the following LISP to configure tree-sitter = for the different feature-levels?

  = (setq-local treesit-font-lock-feature-list
    =           '(( comment = definition)
              =   ( keyword string type directives)
      =           ( constant escape-sequence expression = literal attribute)
            =     ( function bracket delimiter = error)))

Can you provide a more concrete = example of what you think is missing or inappropriate and I can try to = address that.

=E2=80=94
Ki= nd Regards
Jostein = Kj=C3=B8nigsen

= --Apple-Mail=_A362B0AE-03D7-419A-B0EA-7CDDD5F41177-- From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 08 08:59:34 2025 Received: (at 79406) by debbugs.gnu.org; 8 Sep 2025 12:59:34 +0000 Received: from localhost ([127.0.0.1]:50404 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uvbT4-000140-1z for submit@debbugs.gnu.org; Mon, 08 Sep 2025 08:59:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56926) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uvbSx-00013f-EW for 79406@debbugs.gnu.org; Mon, 08 Sep 2025 08:59:29 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uvbSm-0006M6-QT; Mon, 08 Sep 2025 08:59:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=qUGfwq44UqhaBpEJrLvlxevI7pK5i+HmDOVFx0xAHiM=; b=b/pzSUxpNmOnJoXJh6JN S3fhpqLw7VLVCevTvDr0GfW1oRE9EU5B2x3jrPvqOxdLEJ/v5EgjLIavqAMwsZfi4AMrVGdn4unjL x7kqU3egI+cQAvm5Rjx5RIZnZDFpx+EcCaw/zyX6Uqe4nv+tmWG5UDfFJSv19IZvryjUNoz3fqiK8 zkXzmRNBTVPlp4EXEN0pfAT9E5SBtYdWK9GUG6w4swjhEIROTvxYy3oLcW5XQI3Q6xd3+6wU7xnN0 6wbNVmrbpJcXEfOMODsf1dFcFc+5prxMjqXO1TN9EKWtZ79r0bpfT1nMa3NiLv2iiEBp1WM6Cnezs qAOEEExikweIMA==; Date: Mon, 08 Sep 2025 15:59:12 +0300 Message-Id: <86plc1cd7j.fsf@gnu.org> From: Eli Zaretskii To: Jostein =?utf-8?Q?Kj=C3=B8nigsen?= In-Reply-To: (message from Jostein =?utf-8?Q?Kj=C3=B8nigsen?= on Mon, 8 Sep 2025 14:50:23 +0200) Subject: Re: bug#79406: [PATCH] 31.0.50; csharp-ts-mode does not fontify variable-use consistently References: <0CD73DB1-6D03-41F0-8760-92A892BB8786@secure.kjonigsen.net> <86tt1dci1z.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 79406 Cc: 79406@debbugs.gnu.org, casouri@gmail.com 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: -3.3 (---) > From: Jostein Kjønigsen > Date: Mon, 8 Sep 2025 14:50:23 +0200 > Cc: 79406@debbugs.gnu.org, > Yuan Fu > > On 8 Sep 2025, at 13:14, Eli Zaretskii wrote: > > Are all of these appropriate for the default value of > treesit-font-lock-level? > > I'll have to be honest and admit I haven't tested any major-mode in "default" fontification level in probably a > decade. My settings is maximum detail, and I've based my findings on that. > > It may previously have been difficult to compartementalize some of these fontifications into different features > and levels (due to extensive use of override:t and rules being heavily order-dependent). > > With the changes in this patch however, I can probably move some rules about if that's wanted. Anything in > particular you are thinking about? Can you correlate the syntactic elements with the guidelines in the doc string of treesit-font-lock-level? > I see that > csharp-ts-mode--font-lock-settings doesn't use the level at all -- is > that on purpose? > > I'm not sure I'm following. We have the following LISP to configure tree-sitter for the different feature-levels? > > (setq-local treesit-font-lock-feature-list > '(( comment definition) > ( keyword string type directives) > ( constant escape-sequence expression literal attribute) > ( function bracket delimiter error))) > > Can you provide a more concrete example of what you think is missing or inappropriate and I can try to > address that. Hmm... maybe nothing. Yuan, could you please see if anything is missing here? From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 09 03:06:54 2025 Received: (at 79406) by debbugs.gnu.org; 9 Sep 2025 07:06:54 +0000 Received: from localhost ([127.0.0.1]:56409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uvsRJ-0003LJ-Li for submit@debbugs.gnu.org; Tue, 09 Sep 2025 03:06:54 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]:49244) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uvsRF-0003KX-EF for 79406@debbugs.gnu.org; Tue, 09 Sep 2025 03:06:51 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-7723f0924a3so6974128b3a.2 for <79406@debbugs.gnu.org>; Tue, 09 Sep 2025 00:06:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757401602; x=1758006402; 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=AveV77mjLPpw93wop7NAeXTASptf7rAcDS/jgI8l1rw=; b=YOF5BoENvEwDsBcO8OlsFJcW524aWlukvWNllCTjPvoKQ2y5fV0IzQ6/3iJo44BfUL WHmor6aT+LLoTQOI9GDI3VTgH0vw8JQLz6NfCZS8Sl5HhTcfX76oMbjJbO8vrLla4cmt m5yxxfWRXpuS0wXxKtRaAwLzq++fN9kKKKTX0iVXynFjUfHH6Bw314pZMyoEpE9ae53K KucJBxkW/ZwsZk7YfpkjZiYRTJcwERI2AVTmSKfE7ZvcW/bxYD3LI0TKC7Zw67vQdk3e ONKYGy7bpklHcbdM1hnikV1FVD8lpN7HI4oCmfZ2c9X7bsOV84M+vDUK2YRJ671ZOhEQ QFoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757401602; x=1758006402; 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=AveV77mjLPpw93wop7NAeXTASptf7rAcDS/jgI8l1rw=; b=WVcEyMhduMGeiExN/bBkJ/sySOSdN5TcNTvGMbwH6n1lvVInGfKCTLNL8wztwcH1gr aI5HiL91mEzAHDCdY6ianedt3LSjIXgCnepkab0rprLWYaBLcQMRMKwtWV27i1FS49pS 4KShjRjGD+Box3pqQWGNBoAj4O6/i7rBPLEPSasofwtZMRceHgmYMQppRBxW4c/FRLIi di4UVWgJNrIdwEobeotmjn1rbW5Bien7ZTsD7OD7ifV9pgHGxT4sGq9rRds20OFCtJlA tmdPi7maC7FLTkF7Df+J1ncC7iBDYc1jkygMStTCqNxg+TR3ocOu8q8R8Q9Vmz42t6X+ 7FPQ== X-Forwarded-Encrypted: i=1; AJvYcCXTjNCuU0pqLG1nsGTraDUwpbbYN2SYD8u/ZRf4dcZPzX2ymSkezzFU0bkTjs5HPcU5G3ffjQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yy1+criNMhqQBasBn2ZPxTwPHZ4/EnmmRAnb7j7IUq5CJ8nqfFb MA3apMItwu25Ay6eYnBGwAYXSpXMzfhGRsPiphNsKKh+bLwCPkJLU4s9 X-Gm-Gg: ASbGncvWVetq5KhbVHqiM6z0yVZeO7ZgbnmVaJZ3Zrh6yAG3+vds4dII/yidrQWERcQ GAKWMe0bAjuqPkEJjB6Tgy4Eql/YFJU/TcERmrHFYOm6pzHq2iutERMFs9U8u6z6xPZZwIRXEOm /+Gsn+T3AKUPnGXZ3FqHXMnycdt1h0+XIZc3bxL974dMsHJDa8ufTYSOX++dTQ7FlvxHNnw/WKz GznYLFu3J9bdgxLm3OCqy6N9s7PTzszuJ0S9nbMiPOuT4Tu2sT5cLsR39ZvXI+WyYkrYmqRPp+m FsK/SjvxRReilIpz5/D9qr9dNB3jAnPL2OOlq1WPUM5g4YySYzlVx+Kbrzmxa9uIOoE3rReiNBM dXNB34G+wWHkwbARo+9IR8zYD4ojartf6HQyVVaE97l+AoIs8vgVfBWCl2a5xoR2HzFeBmjU= X-Google-Smtp-Source: AGHT+IHSOmG06r+X3n6Vyovmu/FRHM/KW3h2xEyWwOq/Gs14FoLskxVC17Dx0wK9sYq1ePOuPVYNWA== X-Received: by 2002:a05:6a20:a108:b0:24e:2cee:9589 with SMTP id adf61e73a8af0-2533e573184mr13211613637.9.1757401602379; Tue, 09 Sep 2025 00:06:42 -0700 (PDT) Received: from smtpclient.apple (c-24-4-247-194.hsd1.ca.comcast.net. [24.4.247.194]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-32d5d6214f9sm7488981a91.26.2025.09.09.00.06.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Sep 2025 00:06:41 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: bug#79406: [PATCH] 31.0.50; csharp-ts-mode does not fontify variable-use consistently From: Yuan Fu In-Reply-To: <86plc1cd7j.fsf@gnu.org> Date: Tue, 9 Sep 2025 00:06:30 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <6C4581D0-F8F5-4598-B539-85610CCDFC07@gmail.com> References: <0CD73DB1-6D03-41F0-8760-92A892BB8786@secure.kjonigsen.net> <86tt1dci1z.fsf@gnu.org> <86plc1cd7j.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3826.700.81) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79406 Cc: 79406@debbugs.gnu.org, =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= 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 Sep 8, 2025, at 5:59=E2=80=AFAM, Eli Zaretskii = wrote: >=20 >> From: Jostein Kj=C3=B8nigsen >> Date: Mon, 8 Sep 2025 14:50:23 +0200 >> Cc: 79406@debbugs.gnu.org, >> Yuan Fu >>=20 >> On 8 Sep 2025, at 13:14, Eli Zaretskii wrote: >>=20 >> Are all of these appropriate for the default value of >> treesit-font-lock-level? =20 >>=20 >> I'll have to be honest and admit I haven't tested any major-mode in = "default" fontification level in probably a >> decade. My settings is maximum detail, and I've based my findings on = that. >>=20 >> It may previously have been difficult to compartementalize some of = these fontifications into different features >> and levels (due to extensive use of override:t and rules being = heavily order-dependent). >>=20 >> With the changes in this patch however, I can probably move some = rules about if that's wanted. Anything in >> particular you are thinking about? >=20 > Can you correlate the syntactic elements with the guidelines in the > doc string of treesit-font-lock-level? >=20 >> I see that >> csharp-ts-mode--font-lock-settings doesn't use the level at all -- is >> that on purpose? >>=20 >> I'm not sure I'm following. We have the following LISP to configure = tree-sitter for the different feature-levels? >>=20 >> (setq-local treesit-font-lock-feature-list >> '(( comment definition) >> ( keyword string type directives) >> ( constant escape-sequence expression literal = attribute) >> ( function bracket delimiter error))) >>=20 >> Can you provide a more concrete example of what you think is missing = or inappropriate and I can try to >> address that. >=20 > Hmm... maybe nothing. Yuan, could you please see if anything is > missing here? Csharp-ts-mode is doing the right thing. Major modes don=E2=80=99t = interact with treesit-font-lock-level directly. They just define = font-lock rules categorized into features. And provide a feature list = that=E2=80=99s split into levels. Emacs picks the features to enable = based treesit-font-lock-level. Most of the changes are good, I didn=E2=80=99t look into the rules = themselves since I know Jostein is much more familiar to the grammar and = C# than I do. I also like that we=E2=80=99re using less :override. The only thing I=E2=80=99m not too sure about is the change from = property to attribute. It=E2=80=99s technically a breaking change, I = don=E2=80=99t think it=E2=80=99s =E2=80=9Cwait for 10 years to change = it=E2=80=9D level, but at least we should mention it in the NEWS. Also = it seems you=E2=80=99re highlighting the brackets as well? Is there a = particular reason to do that? And IMHO since attribute is metadata, = property face is more suitable than variable-use face. But that=E2=80=99s = subjective so it=E2=80=99s your call. And there=E2=80=99s the small things like using full sentence for = comments (period at the end) and the commit message format, those I can = fix when applying the patch. Yuan= From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 09 03:46:54 2025 Received: (at 79406) by debbugs.gnu.org; 9 Sep 2025 07:46:54 +0000 Received: from localhost ([127.0.0.1]:56783 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uvt41-0006yn-NG for submit@debbugs.gnu.org; Tue, 09 Sep 2025 03:46:54 -0400 Received: from fout-b3-smtp.messagingengine.com ([202.12.124.146]:36813) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uvt3v-0006yH-KB for 79406@debbugs.gnu.org; Tue, 09 Sep 2025 03:46:50 -0400 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.stl.internal (Postfix) with ESMTP id CCDBE1D0003F; Tue, 9 Sep 2025 03:46:41 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Tue, 09 Sep 2025 03:46:41 -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=fm3; t=1757404001; x=1757490401; bh=YqR5s7iM/tdr9mlj3nXNPmquG5MNozZTRJoCzKeINRo=; b= TLYWvSEV1f8Q2cPRooDkB5GQxLTMm+Kw9UkvO4nvZqF79j+5AEUV11DxtCV2z7so QAfUoA9OxOqrdkQi639S7og08JWVnhUaC1tY8DR9NZTF8Asz4X3WfLbkwE0E1q5M 1wH7xsN7iEdw7AMIwalVVHkUhdp/SujvIZf5gvDS8VnVOxs0yIs18ozhKOPe1pyF AHY2+49kJizc+ASmSZsARSa2ee31dDoSzRJrRgTED7KDERTuY1Ph+HaIDpoWR1vx yVsq2utFG88WJDjEXr0vYtDcDolCNQAP/Xe85yY1QDeqCOX9yY+YBAAkW0qWdVy4 qiaX1OT/VrXG4CEmF1+i6w== 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=fm1; t= 1757404001; x=1757490401; bh=YqR5s7iM/tdr9mlj3nXNPmquG5MNozZTRJo CzKeINRo=; b=J6s1uhzHghXXOTBJ3BdcL2Ka2VUsmsbnCZOKGptTt8+FfoW4tjW jlSQpMsQjn9pLw2o/CGPDrz0/c1iIANYRKTkhwBDnA7Zq9KXOc2ZEggusAtDlt0J 1E+sisYcarEPWrFb3g7ZQDH08TiUU6iE/SiIqtDGfIySc4NsGjR7MNnFnvxnwvbq J7pqrDRgaPNxHtT8WZ1zEHBbJKdVfWt5BJ1duwnQZ+EWr9u5ZG8eyUIsJLr84Eoi db5B4VVsMzHyrkdSBgft6BOQ+WvMt0Xij1WC1FR7FhcJvLspNACuo82qRQ4DasBR en70sT7CWtAfU5cHFmom4dAT5cvOdMydwbg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdduleekhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhkfgtggfuffgjvefvfhfosegrtdhmrehhtdejnecuhfhrohhmpeflohhsthgvihhn ucfmjhppnhhighhsvghnuceojhhoshhtvghinhesshgvtghurhgvrdhkjhhonhhighhsvg hnrdhnvghtqeenucggtffrrghtthgvrhhnpedviedtueehleeffeetjefggedvveeludev kefffefhgfejkeetjeehteffgeeugeenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpehjohhsthgvihhnsehsvggtuhhrvgdrkhhjohhnihhgshgv nhdrnhgvthdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpth htoheptggrshhouhhrihesghhmrghilhdrtghomhdprhgtphhtthhopegvlhhiiiesghhn uhdrohhrghdprhgtphhtthhopeejleegtdeiseguvggssghughhsrdhgnhhurdhorhhg X-ME-Proxy: Feedback-ID: ib2f84088:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 9 Sep 2025 03:46:40 -0400 (EDT) From: =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_9641AE2F-B4A8-49CC-8A12-4984A5D04221" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: bug#79406: [PATCH] 31.0.50; csharp-ts-mode does not fontify variable-use consistently Date: Tue, 9 Sep 2025 09:46:28 +0200 In-Reply-To: <6C4581D0-F8F5-4598-B539-85610CCDFC07@gmail.com> To: Yuan Fu References: <0CD73DB1-6D03-41F0-8760-92A892BB8786@secure.kjonigsen.net> <86tt1dci1z.fsf@gnu.org> <86plc1cd7j.fsf@gnu.org> <6C4581D0-F8F5-4598-B539-85610CCDFC07@gmail.com> X-Mailer: Apple Mail (2.3826.700.81) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79406 Cc: 79406@debbugs.gnu.org, Eli Zaretskii 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=_9641AE2F-B4A8-49CC-8A12-4984A5D04221 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 9 Sep 2025, at 09:06, Yuan Fu wrote: >=20 >=20 >=20 >> On Sep 8, 2025, at 5:59=E2=80=AFAM, Eli Zaretskii = wrote: >>=20 >>> From: Jostein Kj=C3=B8nigsen >>> Date: Mon, 8 Sep 2025 14:50:23 +0200 >>> Cc: 79406@debbugs.gnu.org, >>> Yuan Fu >>>=20 >>> On 8 Sep 2025, at 13:14, Eli Zaretskii wrote: >>>=20 >>> Are all of these appropriate for the default value of >>> treesit-font-lock-level? =20 >>>=20 >>> I'll have to be honest and admit I haven't tested any major-mode in = "default" fontification level in probably a >>> decade. My settings is maximum detail, and I've based my findings on = that. >>>=20 >>> It may previously have been difficult to compartementalize some of = these fontifications into different features >>> and levels (due to extensive use of override:t and rules being = heavily order-dependent). >>>=20 >>> With the changes in this patch however, I can probably move some = rules about if that's wanted. Anything in >>> particular you are thinking about? >>=20 >> Can you correlate the syntactic elements with the guidelines in the >> doc string of treesit-font-lock-level? I'll get back to this once, we're me and Yuan has reached an agreement = on the things below. >>=20 >>=20 >> Hmm... maybe nothing. Yuan, could you please see if anything is >> missing here? >=20 > Csharp-ts-mode is doing the right thing. Major modes don=E2=80=99t = interact with treesit-font-lock-level directly. They just define = font-lock rules categorized into features. And provide a feature list = that=E2=80=99s split into levels. Emacs picks the features to enable = based treesit-font-lock-level. >=20 > Most of the changes are good, I didn=E2=80=99t look into the rules = themselves since I know Jostein is much more familiar to the grammar and = C# than I do. I also like that we=E2=80=99re using less :override. Yeah override makes lots of things needlessly confusing. >=20 > The only thing I=E2=80=99m not too sure about is the change from = property to attribute. It=E2=80=99s technically a breaking change, I = don=E2=80=99t think it=E2=80=99s =E2=80=9Cwait for 10 years to change = it=E2=80=9D level, but at least we should mention it in the NEWS. My bad. I honestly didn't think about that. I can revert that, if it's a = big deal. > Also it seems you=E2=80=99re highlighting the brackets as well? Is = there a particular reason to do that? It was mostly for visual-reasons. Attributes/annotations are in many = IDEs and editors "shaded out" in a mono-colour kind of way, to not = distract away from the main method/class being annotated. I think this works well and was trying to emulate the same behaviour in = Emacs by making the brackets blend in with the rest of the annotation. I = realize this technically speaking violates expectations some might have = wrt to use of font-lock-bracket-face, but in overall I think it looks = much nicer. > And IMHO since attribute is metadata, property face is more suitable = than variable-use face. But that=E2=80=99s subjective so it=E2=80=99s = your call. I agree it kinda subjective. And for me (again subjective) with my = current theme I think it looks good (font-lock-variable-use is a shaded = version of font-lock-varibable-name). Now I'll be perfectly open to the fact that other people may not agree, = and with other themes it might look less optimal than it does on my = setup. Maybe a way to resolve *both* these issues would be to introduce some = new, csharp-ts-mode (and possible csharp-mode) specific faces? - csharp-ts-mode-attribute-face - csharp-ts-mode-attribute-bracket-face The default could be font-lock-property-use-face and = font-lock-bracket-face respectively, and people like me could customize = them iif we want to. Would that be a less controversial approach? >=20 > And there=E2=80=99s the small things like using full sentence for = comments (period at the end) and the commit message format, those I can = fix when applying the patch. >=20 If I'm making a new revision anyway, I can try to clean up the comments. = As for the commit-message format... I thought I managed to follow that = this time :-D Oh well. Let me know what you think, and I'll come up with a new patch. =E2=80=94 Jostein= --Apple-Mail=_9641AE2F-B4A8-49CC-8A12-4984A5D04221 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8


On 9 Sep 2025, at 09:06, Yuan Fu = <casouri@gmail.com> wrote:



On Sep 8, 2025, at 5:59=E2=80=AFAM, Eli Zaretskii = <eliz@gnu.org> wrote:

From: = Jostein Kj=C3=B8nigsen <jostein@secure.kjonigsen.net>
Date: = Mon, 8 Sep 2025 14:50:23 +0200
Cc: 79406@debbugs.gnu.org,
Yuan Fu = <casouri@gmail.com>

On 8 Sep 2025, at 13:14, Eli Zaretskii = <eliz@gnu.org> wrote:

Are all of these appropriate for the = default value of
treesit-font-lock-level?  

I'll have to = be honest and admit I haven't tested any major-mode in "default" = fontification level in probably a
decade. My settings is maximum = detail, and I've based my findings on that.

It may previously = have been difficult to compartementalize some of these fontifications = into different features
and levels (due to extensive use of = override:t and rules being heavily order-dependent).

With the = changes in this patch however, I can probably move some rules about if = that's wanted. Anything in
particular you are thinking = about?

Can you correlate the syntactic elements with = the guidelines in the
doc string of = treesit-font-lock-level?
I'll get back to this once, we're me and Yuan has reached an = agreement on the things below.



Hmm... maybe = nothing.  Yuan, could you please see if anything is
missing = here?

Csharp-ts-mode is doing the right thing. Major = modes don=E2=80=99t interact with treesit-font-lock-level directly. They = just define font-lock rules categorized into features. And provide a = feature list that=E2=80=99s split into levels. Emacs picks the features = to enable based treesit-font-lock-level.

Most of the changes are = good, I didn=E2=80=99t look into the rules themselves since I know = Jostein is much more familiar to the grammar and C# than I do. I also = like that we=E2=80=99re using less = :override.

Yeah override = makes lots of things needlessly confusing.


The only thing I=E2=80=99m not too sure = about is the change from property to attribute. It=E2=80=99s technically = a breaking change, I don=E2=80=99t think it=E2=80=99s =E2=80=9Cwait for = 10 years to change it=E2=80=9D level, but at least we should mention it = in the NEWS.

My bad. I = honestly didn't think about that. I can revert that, if it's a big = deal.

Also it seems = you=E2=80=99re highlighting the brackets as well? Is there a particular = reason to do that?

It was = mostly for visual-reasons. Attributes/annotations are in many IDEs and = editors "shaded out" in a mono-colour kind of way, to not distract away = from the main method/class being annotated.

I = think this works well and was trying to emulate the same behaviour in = Emacs by making the brackets blend in with the rest of the annotation. I = realize this technically speaking violates expectations some might have = wrt to use of font-lock-bracket-face, but in overall I think it looks = much nicer.

And IMHO since = attribute is metadata, property face is more suitable than variable-use = face. But that=E2=80=99s subjective so it=E2=80=99s your = call.

I agree it kinda = subjective. And for me (again subjective) with my current theme I think = it looks good (font-lock-variable-use is a shaded version of = font-lock-varibable-name).

Now I'll be = perfectly open to the fact that other people may not agree, and with = other themes it might look less optimal than it does on my = setup.

Maybe a way to resolve *both* these = issues would be to introduce some new, csharp-ts-mode (and possible = csharp-mode) specific faces?

- = csharp-ts-mode-attribute-face
- = csharp-ts-mode-attribute-bracket-face

The = default could be font-lock-property-use-face and font-lock-bracket-face = respectively, and people like me could customize them iif we want = to.

Would that be a less controversial = approach?


And = there=E2=80=99s the small things like using full sentence for comments = (period at the end) and the commit message format, those I can fix when = applying the = patch.


If I'm making = a new revision anyway, I can try to clean up the comments. As for the = commit-message format... I thought I managed to follow that this time = :-D

Oh well.

Let me = know what you think, and I'll come up with a new = patch.


=E2=80=94
Jostein<= /div>= --Apple-Mail=_9641AE2F-B4A8-49CC-8A12-4984A5D04221-- From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 10 03:07:23 2025 Received: (at 79406) by debbugs.gnu.org; 10 Sep 2025 07:07:24 +0000 Received: from localhost ([127.0.0.1]:35604 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uwEvL-0003tQ-Cg for submit@debbugs.gnu.org; Wed, 10 Sep 2025 03:07:23 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:48374) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uwEvI-0003t5-0M for 79406@debbugs.gnu.org; Wed, 10 Sep 2025 03:07:20 -0400 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-32da88701c7so1708378a91.0 for <79406@debbugs.gnu.org>; Wed, 10 Sep 2025 00:07:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757488033; x=1758092833; 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=1VbSLi8mlOtYZq8HYMnbnZ0dooych0CZu/HiVh1pL9Q=; b=imGLPIHJugLHBz24TJ4xW+WOqfG7C+U9gJn8BUofB9FVexQcH0ft8SMSAb3+hdGyAZ VOyK35ui/MZ1DXNIcfFMU4RnBxGkI8jtT0qG6K/CdOqiDKodhg9OUPjXf7e6eTV/chqK 8kNLLaTf5gHSb6g/188DwkgI/U5AmqikiFFxXgGZndoxnmyn0e7iED2LRV900g4adg5u X2fnJMY3nb+d+LH8ePZURASMXApKWrhTzUAMHYjkISqBnU/cOs/5eaGl6xdUn8fWqpYe Aw7vri5tmV+cQ62ozbW12p9H+HtcBvwx/k3YiBAa8kEuxkV8bJLV9l+qy7J3l4TkYPGP hebg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757488033; x=1758092833; 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=1VbSLi8mlOtYZq8HYMnbnZ0dooych0CZu/HiVh1pL9Q=; b=QQNfMhhfCep9V25XFnWWaQ+O45T94fWJyHZtYBtSXbQW8cBXvSqOknGWxr35wzchjH urFFYNTJp/JpJRCNfTKwJna7K52XE1hmrCkXqHFpRz9MWYiA4SrcXHySFXXfHxUDlAwa lFGfJMxWaPZifnESM/3iZBGz8fsfilXtBd+16sxOFIbpUo5KeagUCXFJmynPW/7LZB8A GyhVAvLqompIR7J5peyu5TALqaku+7xnVII3VlRZTuAvoxa2s5VgZ4/B71FgY2sf9eJD TPBYJB9Jf8+nt1jLuuSD5u++/MZsmYgdHB8AcTgefeZIPCBkPfKmiyVnmK9e21j3TksC bQ7A== X-Forwarded-Encrypted: i=1; AJvYcCXouux79tgFiBhIgKaMiJ2WZWlmogqClYc9Tw59hmMAFVBCAjR5ihC/PIc65y4VAW5dhstXbA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwW+a451psiW6yveNMruRMZf5ucZjwIHwAAZfdvNzlVlGcnN/Ls Z2ogyETy7+aTfGbrNX/OQZsZJ7uWPgdiUUUVf3N9aOMMB1l0nApbiAmd X-Gm-Gg: ASbGncs4VDltX7PdA++r7WC7YJXnR8chBfKalLA01H9hnOIk5BnvMsCDbC2Ap+4+ejR Bk08HkT88n1jXRq9+GR/3X/dHY9yXnmkPptX1qlWARMXm/oNu/eXay2zAdJ5utrPL+6Sy+2KISO 2YQN3HXNJWyYd5dOddcXAEmb/bzEkV7pgBorpz0C2gvf9cr+FVzKUB6+8ZedLkr6Tz7kBUhQWSP NcYCp7WLM5ZOcjmkN3/+TuHyHm24MWdcic3xYdHL6sR7o1fRuzGDxQ6lORpTKP13c0+qWyBQgWf g+NE+3pT2hPdTM6mkZCMy76p7yfqRjXJ48lL0Bl0FFPyQ3TbJpNQDEcCMx0LWSO/wJmhCWCK/vo O1/7nytxiqnxVT4BSj3dDVWpFMUulpJdKVMP+fBSVA+zg5sqgyxTixHsata8iDQoFp/jnv7Y= X-Google-Smtp-Source: AGHT+IG+SfSJ88m8I7ZlvWK7U2ABtPd0pMSdAQ87zhwwuaqpXNTyPdfb0TL0nsbcL75XBLQnjWSOUA== X-Received: by 2002:a17:90b:1b11:b0:327:e9f4:4de5 with SMTP id 98e67ed59e1d1-32d43fb6efemr20805003a91.23.1757488033201; Wed, 10 Sep 2025 00:07:13 -0700 (PDT) Received: from smtpclient.apple (c-24-4-247-194.hsd1.ca.comcast.net. [24.4.247.194]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-32dbb498d20sm1365003a91.27.2025.09.10.00.07.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Sep 2025 00:07:12 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: bug#79406: [PATCH] 31.0.50; csharp-ts-mode does not fontify variable-use consistently From: Yuan Fu In-Reply-To: Date: Wed, 10 Sep 2025 00:07:01 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <7C431B45-DAC4-4E85-86C8-6C1A215C9813@gmail.com> References: <0CD73DB1-6D03-41F0-8760-92A892BB8786@secure.kjonigsen.net> <86tt1dci1z.fsf@gnu.org> <86plc1cd7j.fsf@gnu.org> <6C4581D0-F8F5-4598-B539-85610CCDFC07@gmail.com> To: =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= X-Mailer: Apple Mail (2.3826.700.81) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79406 Cc: 79406@debbugs.gnu.org, Eli Zaretskii 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 Sep 9, 2025, at 12:46=E2=80=AFAM, Jostein Kj=C3=B8nigsen = wrote: >=20 >=20 >=20 >> On 9 Sep 2025, at 09:06, Yuan Fu wrote: >>=20 >>=20 >>=20 >>> On Sep 8, 2025, at 5:59=E2=80=AFAM, Eli Zaretskii = wrote: >>>=20 >>>> From: Jostein Kj=C3=B8nigsen >>>> Date: Mon, 8 Sep 2025 14:50:23 +0200 >>>> Cc: 79406@debbugs.gnu.org, >>>> Yuan Fu >>>>=20 >>>> On 8 Sep 2025, at 13:14, Eli Zaretskii wrote: >>>>=20 >>>> Are all of these appropriate for the default value of >>>> treesit-font-lock-level? =20 >>>>=20 >>>> I'll have to be honest and admit I haven't tested any major-mode in = "default" fontification level in probably a >>>> decade. My settings is maximum detail, and I've based my findings = on that. >>>>=20 >>>> It may previously have been difficult to compartementalize some of = these fontifications into different features >>>> and levels (due to extensive use of override:t and rules being = heavily order-dependent). >>>>=20 >>>> With the changes in this patch however, I can probably move some = rules about if that's wanted. Anything in >>>> particular you are thinking about? >>>=20 >>> Can you correlate the syntactic elements with the guidelines in the >>> doc string of treesit-font-lock-level? >=20 > I'll get back to this once, we're me and Yuan has reached an agreement = on the things below. >=20 >>>=20 >>>=20 >>> Hmm... maybe nothing. Yuan, could you please see if anything is >>> missing here? >>=20 >> Csharp-ts-mode is doing the right thing. Major modes don=E2=80=99t = interact with treesit-font-lock-level directly. They just define = font-lock rules categorized into features. And provide a feature list = that=E2=80=99s split into levels. Emacs picks the features to enable = based treesit-font-lock-level. >>=20 >> Most of the changes are good, I didn=E2=80=99t look into the rules = themselves since I know Jostein is much more familiar to the grammar and = C# than I do. I also like that we=E2=80=99re using less :override. >=20 > Yeah override makes lots of things needlessly confusing. >=20 >>=20 >> The only thing I=E2=80=99m not too sure about is the change from = property to attribute. It=E2=80=99s technically a breaking change, I = don=E2=80=99t think it=E2=80=99s =E2=80=9Cwait for 10 years to change = it=E2=80=9D level, but at least we should mention it in the NEWS. >=20 > My bad. I honestly didn't think about that. I can revert that, if it's = a big deal. If you mention it in NEWS I think we=E2=80=99re good. >=20 >> Also it seems you=E2=80=99re highlighting the brackets as well? Is = there a particular reason to do that?=20 >=20 > It was mostly for visual-reasons. Attributes/annotations are in many = IDEs and editors "shaded out" in a mono-colour kind of way, to not = distract away from the main method/class being annotated. >=20 > I think this works well and was trying to emulate the same behaviour = in Emacs by making the brackets blend in with the rest of the = annotation. I realize this technically speaking violates expectations = some might have wrt to use of font-lock-bracket-face, but in overall I = think it looks much nicer. If that=E2=80=99s a common practice and you think it looks good, let=E2=80= =99s do it. >=20 >> And IMHO since attribute is metadata, property face is more suitable = than variable-use face. But that=E2=80=99s subjective so it=E2=80=99s = your call. >=20 > I agree it kinda subjective. And for me (again subjective) with my = current theme I think it looks good (font-lock-variable-use is a shaded = version of font-lock-varibable-name). >=20 > Now I'll be perfectly open to the fact that other people may not = agree, and with other themes it might look less optimal than it does on = my setup. >=20 > Maybe a way to resolve *both* these issues would be to introduce some = new, csharp-ts-mode (and possible csharp-mode) specific faces? >=20 > - csharp-ts-mode-attribute-face > - csharp-ts-mode-attribute-bracket-face >=20 > The default could be font-lock-property-use-face and = font-lock-bracket-face respectively, and people like me could customize = them iif we want to. >=20 > Would that be a less controversial approach? Yeah adding a csharp-ts-mode-attribute-face (with inherits = variable-use-face) would be good. We don=E2=80=99t need to bother with = csharp-ts-mode-attribute-bracket-face, that feels too much customization = to me ;-) Yuan= From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 11 03:54:19 2025 Received: (at 79406) by debbugs.gnu.org; 11 Sep 2025 07:54:19 +0000 Received: from localhost ([127.0.0.1]:42161 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uwc8I-0006Xs-Nc for submit@debbugs.gnu.org; Thu, 11 Sep 2025 03:54:19 -0400 Received: from fout-b1-smtp.messagingengine.com ([202.12.124.144]:56917) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uwc8D-0006XX-Ud for 79406@debbugs.gnu.org; Thu, 11 Sep 2025 03:54:15 -0400 Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfout.stl.internal (Postfix) with ESMTP id DF7661D000F4; Thu, 11 Sep 2025 03:54:07 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Thu, 11 Sep 2025 03:54: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=fm3; t=1757577247; x=1757663647; bh=HrxZgLIdYOwLS+uEwlJut3FsVbyqw5p1Rgx+kM9MT3s=; b= R08YnpqezIi7CGvQYoohzopUJX03BCr1M08GO8KanRSJHePRddyyQGQyhOrONlsn COu/2UHCsKE38JNruIvEFMQlpdVaiUN6wklGG+6vUUzPxpD05GNEpWECQkr3ylQP UB3PlYOSK4BJ2iRrKSIFAuMeMARUdYaI2+rZUR2tLQ8dBjChFbgHm0LCJZUgnGfN Pb8O+d2GVi47yLRjWO+g9gvrmA6atTzWCme/X83AAjMN6kEFO3BH2JTkR2ySY5H2 8pBvr3K4iFe4F6MvfW2vu2maW8V1NC5rnLcxTkYLaFcnCpmuJEnKbcVWVYw2Qdk8 Nvplft4Mpsza4hV/+iRUaA== 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=fm1; t= 1757577247; x=1757663647; bh=HrxZgLIdYOwLS+uEwlJut3FsVbyqw5p1Rgx +kM9MT3s=; b=QoKJ56k6DU4tJfE29wQpQR0hP3HFAMw047JPCwCQkoLzkHrK9mB 3AzsoG4qlxIqKJ42ZV0a0MQJKmOJrfKl05gKRTLG1OExN9eCrAyMsulOz+MUqQ4J ZphLkJVlRLIz/ekezx5WS5o4YoVU1g376hZZ8GdcGJetuKxmpzyr8Vt+TD5uGV6p fFj5AA8668aHvF4LMTgnhTUYNsqisnjeBWRGAAcd1EePZZrj+xW6UvvcBIKlXcBU /DvfAPkSkEk5/k0pxD+T+nFSbfbdkKsCkhjrdVUxbchYvMW0T1Oabr9LZ4pW1Zaj JnV4aFi57jvAalSZZi9vWjhdA/oL+9wZHtg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvheeivdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhkfgtggfuffgjvefvfhfosegrtdhmrehhtdejnecuhfhrohhmpeflohhsthgvihhn ucfmjhppnhhighhsvghnuceojhhoshhtvghinhesshgvtghurhgvrdhkjhhonhhighhsvg hnrdhnvghtqeenucggtffrrghtthgvrhhnpedviedtueehleeffeetjefggedvveeludev kefffefhgfejkeetjeehteffgeeugeenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpehjohhsthgvihhnsehsvggtuhhrvgdrkhhjohhnihhgshgv nhdrnhgvthdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpth htoheptggrshhouhhrihesghhmrghilhdrtghomhdprhgtphhtthhopegvlhhiiiesghhn uhdrohhrghdprhgtphhtthhopeejleegtdeiseguvggssghughhsrdhgnhhurdhorhhg X-ME-Proxy: Feedback-ID: ib2f84088:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 11 Sep 2025 03:54:06 -0400 (EDT) From: =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= Message-Id: <21D615BB-14F1-4E51-978F-CC9C57BD8A6C@secure.kjonigsen.net> Content-Type: multipart/alternative; boundary="Apple-Mail=_F105FCE7-C76B-44AE-B242-18A798E0DE23" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: bug#79406: [PATCH] 31.0.50; csharp-ts-mode does not fontify variable-use consistently Date: Thu, 11 Sep 2025 09:53:55 +0200 In-Reply-To: <7C431B45-DAC4-4E85-86C8-6C1A215C9813@gmail.com> To: Yuan Fu References: <0CD73DB1-6D03-41F0-8760-92A892BB8786@secure.kjonigsen.net> <86tt1dci1z.fsf@gnu.org> <86plc1cd7j.fsf@gnu.org> <6C4581D0-F8F5-4598-B539-85610CCDFC07@gmail.com> <7C431B45-DAC4-4E85-86C8-6C1A215C9813@gmail.com> X-Mailer: Apple Mail (2.3826.700.81) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79406 Cc: 79406@debbugs.gnu.org, Eli Zaretskii 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=_F105FCE7-C76B-44AE-B242-18A798E0DE23 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 10 Sep 2025, at 09:07, Yuan Fu wrote: >=20 >=20 >>>>=20 >>>> Can you correlate the syntactic elements with the guidelines in the >>>> doc string of treesit-font-lock-level? >>=20 >> I'll get back to this once, we're me and Yuan has reached an = agreement on the things below. >>=20 I think this should be good now. I've moved the lambda-declaration down = into the "function" section, making features semantically contained.=20 You OK with this, Eli? >=20 > If you mention it in NEWS I think we=E2=80=99re good. Done >=20 > If that=E2=80=99s a common practice and you think it looks good, = let=E2=80=99s do it. Done > Yeah adding a csharp-ts-mode-attribute-face (with inherits = variable-use-face) would be good. We don=E2=80=99t need to bother with = csharp-ts-mode-attribute-bracket-face, that feels too much customization = to me ;-) >=20 > Yuan Done. Attached is a patch which I think should address all of the above = concerns. Let me know what you think! =EF=BF=BC =E2=80=94 Kind Regards Jostein Kj=C3=B8nigsen --Apple-Mail=_F105FCE7-C76B-44AE-B242-18A798E0DE23 Content-Type: multipart/mixed; boundary="Apple-Mail=_5FAFB9DE-2C09-44DC-8950-B624EFBAD3EC" --Apple-Mail=_5FAFB9DE-2C09-44DC-8950-B624EFBAD3EC Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
On 10 Sep = 2025, at 09:07, Yuan Fu <casouri@gmail.com> wrote:



Can you = correlate the syntactic elements with the guidelines in the
doc = string of treesit-font-lock-level?

I'll = get back to this once, we're me and Yuan has reached an agreement on the = things = below.


I = think this should be good now. I've moved the lambda-declaration down = into the "function" section, making features semantically = contained. 

You OK with this, = Eli?


If you = mention it in NEWS I think we=E2=80=99re good.

Done


If that=E2=80=99s a = common practice and you think it looks good, let=E2=80=99s do = it.

Done

Yeah adding a csharp-ts-mode-attribute-face (with = inherits variable-use-face) would be good. We don=E2=80=99t need to = bother with csharp-ts-mode-attribute-bracket-face, that feels too much = customization to me ;-)

Yuan

Done.
=
Attached is a patch which I think should address all of = the above concerns. Let me know what you = think!

= --Apple-Mail=_5FAFB9DE-2C09-44DC-8950-B624EFBAD3EC Content-Disposition: attachment; filename=0001-csharp-ts-mode-fontification-fixes.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-csharp-ts-mode-fontification-fixes.patch" Content-Transfer-Encoding: quoted-printable =46rom=2042b18214449fb67a4f4fb431a8ee0423ded23402=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Jostein=3D20Kj=3DC3=3DB8nigsen?=3D=20= =0ADate:=20Wed,=2027=20Aug=202025=2011:05:28=20= +0200=0ASubject:=20[PATCH]=20csharp-ts-mode:=20fontification=20fixes=0A=0A= *=20csharp-ts-mode--font-lock-settings:=20tweak/add=20rules=0A=0A-=20= hightlight=20reserved=20keywords=20agressively,=20dont=20allow=20misuse=20= as=0A=20=20variables=20etc=20(the=20compiler=20will=20fail!)=0A-=20= highlight=20lambda-valued=20variables=20as=20funtions.=0A-=20improve=20= semantics=20of=20function/class=20annotations=20using=20attributes=0A=20=20= (maps=20closer=20to=20using-something=20than=20declaring=20it).=20also:=20= rename=20to=0A=20=20"attribute".=20"property"=20has=20a=20different,=20= defined=20meaning=20in=20C#.=0A-=20better=20highlight=20variable-use=20= in=20different=20scenarios=20(function-calls,=0A=20=20if-statements,=20= assignment-expressions,=20property-use,=20anonymous=20object=0A=20=20= initializers).=0A-=20better=20hight=20property-use=20(anonymous=20object=20= initializers).=0A-=20highlight=20field-declaration=20using=20= font-lock-variable-face.=0A-=20fontify=20attributes=20using=20new=20face=20= csharp-ts-mode-attribute-face=0A=20=20(defaults=20to=20= font-lock-property-use-face).=0A=0ARemove=20extensive=20use=20of=20= "override"=20making=20evalutation=20hard-to-reason=20about.=0A---=0A=20= etc/NEWS=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= |=20=206=20+++=0A=20lisp/progmodes/csharp-mode.el=20|=2089=20= +++++++++++++++++++++++++++--------=0A=202=20files=20changed,=2076=20= insertions(+),=2019=20deletions(-)=0A=0Adiff=20--git=20a/etc/NEWS=20= b/etc/NEWS=0Aindex=20e0c4f3cb871..da7e81db2be=20100644=0A---=20= a/etc/NEWS=0A+++=20b/etc/NEWS=0A@@=20-956,6=20+956,12=20@@=20are=20= highlighted=20like=20other=20comments.=20=20When=20non-nil,=20Doxygen=20= comment=0A=20blocks=20are=20syntax-highlighted=20if=20the=20Doxygen=20= grammar=20library=20is=0A=20available.=0A=20=0A+**=20Csharp-ts-mode=0A+=0A= +***=20Renamed=20feature=20in=20'treesit-font-lock-feature-list'=0A+The=20= feature=20'property'=20has=20been=20renamed=20to=20'attribute',=20since=20= this=20is=0A+what=20it=20is=20called=20in=20the=20general=20C#=20= community.=0A+=0A=20**=20Go-ts=20mode=0A=20=0A=20+++=0Adiff=20--git=20= a/lisp/progmodes/csharp-mode.el=20b/lisp/progmodes/csharp-mode.el=0A= index=20abd14d2aa1c..de857b6512f=20100644=0A---=20= a/lisp/progmodes/csharp-mode.el=0A+++=20b/lisp/progmodes/csharp-mode.el=0A= @@=20-679,7=20+679,7=20@@=20csharp-ts-mode--indent-rules=0A=20=20=20=20=20= =20((parent-is=20"namespace_declaration")=20parent-bol=200)=0A=20=20=20=20= =20=20((parent-is=20"class_declaration")=20parent-bol=200)=0A=20=20=20=20= =20=20((parent-is=20"constructor_declaration")=20parent-bol=200)=0A-=20=20= =20=20=20((parent-is=20"array_creation_expression")=20parent-bol=200)=20= ;;=20actual=20initialization=20is=20in=20contained=20= initializer_expression=0A+=20=20=20=20=20((parent-is=20= "array_creation_expression")=20parent-bol=200)=20;;=20actual=20= initialization=20is=20in=20contained=20initializer_expression.=0A=20=20=20= =20=20=20((match=20"{"=20"initializer_expression"=20)=20parent-bol=200)=0A= =20=20=20=20=20=20((parent-is=20"initializer_expression")=20parent-bol=20= csharp-ts-mode-indent-offset)=0A=20=20=20=20=20=20((match=20"{"=20= "anonymous_object_creation_expression")=20parent-bol=200)=0A@@=20-741,6=20= +741,15=20@@=20csharp-ts-mode--keywords=0A=20=20=20=20=20"readonly"=20= "unmanaged")=0A=20=20=20"C#=20keywords=20for=20tree-sitter=20= font-locking.")=0A=20=0A+(defgroup=20csharp-ts-mode-faces=20nil=0A+=20=20= "Font=20faces."=0A+=20=20:group=20'cshap)=0A+=0A+(defface=20= csharp-ts-mode-attribute-face=0A+=20=20'((t=20.=20(:inherit=20= font-lock-property-use-face)))=0A+=20=20"Font=20face=20used=20for=20= fontification=20of=20attributes."=0A+=20=20:group=20= 'csharp-ts-mode-faces)=0A+=0A=20(defun=20= csharp-ts-mode--test-this-expression=20()=0A=20=20=20"Return=20non-nil=20= if=20(this_expression)=20is=20named=20in=20csharp=20grammar."=0A=20=20=20= (treesit-query-valid-p=20'c-sharp=20"(this_expression)"))=0A@@=20-788,6=20= +797,18=20@@=20csharp-ts-mode--font-lock-settings=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=20= (initializer_expression=20(assignment_expression=20left:=20(identifier)=20= @font-lock-property-use-face))=0A+=20=20=20=20=20= (anonymous_object_creation_expression=0A+=20=20=20=20=20=20(identifier)=20= @font-lock-property-use-face=0A+=20=20=20=20=20=20(identifier)=20= @font-lock-variable-use-face)=0A+=20=20=20=20=20= (anonymous_object_creation_expression=0A+=20=20=20=20=20=20(identifier)=20= @font-lock-property-use-face=0A+=20=20=20=20=20=20= [(object_creation_expression)=0A+=20=20=20=20=20=20=20(integer_literal)=0A= +=20=20=20=20=20=20=20(string_literal)=0A+=20=20=20=20=20=20=20= (binary_expression)=0A+=20=20=20=20=20=20=20(invocation_expression)=0A+=20= =20=20=20=20=20=20(member_access_expression)=0A+=20=20=20=20=20=20=20= (conditional_expression)])=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= -829,7=20+850,24=20@@=20csharp-ts-mode--font-lock-settings=0A=20=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=20((binary_expression=0A=20=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=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(assignment_expression=0A= +=20=20=20=20=20=20right:=20(identifier)=20@font-lock-variable-use-face)=0A= +=20=20=20=20=20(expression_statement=20;;=20capture=20parent=20node=20= to=20NOT=20shadow=20variable_declaration.=0A+=20=20=20=20=20=20= (assignment_expression=0A+=20=20=20=20=20=20=20left:=20(identifier)=20= @font-lock-variable-use-face))=0A+=20=20=20=20=20(if_statement=20= condition:=20(identifier)=20@font-lock-variable-use-face)=0A+=0A+=20=20=20= =20=20;;=20handle=20more=20specific=20matchers=20before=20generalized=20= variable-use=20fallback.=0A+=20=20=20=20=20(invocation_expression=0A+=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=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(member_access_expression=0A+=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= (member_access_expression=0A+=20=20=20=20=20=20expression:=20= (identifier)=20@font-lock-variable-use-face=0A+=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'bracket=0A@@=20-855,13=20= +893,19=20@@=20csharp-ts-mode--font-lock-settings=0A=20=20=20=20=20=20= (modifier)=20@font-lock-keyword-face=0A=20=20=20=20=20=20,@(if=20= (csharp-ts-mode--test-this-expression)=0A=20=20=20=20=20=20=20=20=20=20=20= =20'((this_expression)=20@font-lock-keyword-face)=0A-=20=20=20=20=20=20=20= =20=20'("this"=20@font-lock-keyword-face)))=0A+=20=20=20=20=20=20=20=20=20= '("this"=20@font-lock-keyword-face))=0A+=0A+=20=20=20=20=20;;=20avoid=20= fontifying=20indentifiers=20with=20a=20keyword-values=20as=20= identifiers.=0A+=20=20=20=20=20((identifier)=20@font-lock-keyword-face=0A= +=20=20=20=20=20=20(:match=20,(concat=20"\\`"=20(regexp-opt=20= csharp-ts-mode--keywords=20t)=20"\\'")=20@font-lock-keyword-face)))=0A=20= =0A=20=20=20=20:language=20'c-sharp=0A=20=20=20=20:override=20t=0A-=20=20= =20:feature=20'property=0A-=20=20=20`((attribute=20(identifier)=20= @font-lock-property-use-face=20(attribute_argument_list))=0A-=20=20=20=20= =20(attribute=20(identifier)=20@font-lock-property-use-face))=0A+=20=20=20= :feature=20'attribute=0A+=20=20=20`((attribute_list=0A+=20=20=20=20=20=20= "["=20@csharp-ts-mode-attribute-face=0A+=20=20=20=20=20=20(attribute=20= name:=20(identifier)=20@csharp-ts-mode-attribute-face)=0A+=20=20=20=20=20= =20"]"=20@csharp-ts-mode-attribute-face))=0A=20=0A=20=20=20=20:language=20= 'c-sharp=0A=20=20=20=20:override=20t=0A@@=20-896,7=20+940,6=20@@=20= csharp-ts-mode--font-lock-settings=0A=20=20=20=20=20=20= @font-lock-string-face)=0A=20=0A=20=20=20=20:language=20'c-sharp=0A-=20=20= =20:override=20t=0A=20=20=20=20:feature=20'type=0A=20=20=20=20= `((predefined_type)=20@font-lock-type-face=0A=20=20=20=20=20=20= (implicit_type)=20@font-lock-type-face=0A@@=20-941,7=20+984,6=20@@=20= csharp-ts-mode--font-lock-settings=0A=20=0A=20=20=20=20:language=20= 'c-sharp=0A=20=20=20=20:feature=20'definition=0A-=20=20=20:override=20t=0A= =20=20=20=20`((qualified_name=20(identifier)=20@font-lock-type-face)=0A=20= =20=20=20=20=20(using_directive=20(identifier)=20@font-lock-type-face)=0A= =20=20=20=20=20=20,@(when=20(csharp-ts-mode--test-name-equals)=0A@@=20= -950,6=20+992,8=20@@=20csharp-ts-mode--font-lock-settings=0A=20=0A=20=20=20= =20=20=20(enum_declaration=20(identifier)=20@font-lock-type-face)=0A=20=20= =20=20=20=20(enum_member_declaration=20(identifier)=20= @font-lock-variable-name-face)=0A+=20=20=20=20=20(field_declaration=20= (variable_declaration=20(variable_declarator=0A+=20=20=20=20=20=20=20=20= name:=20(identifier)=20@font-lock-variable-name-face)))=0A=20=0A=20=20=20= =20=20=20(interface_declaration=20(identifier)=20@font-lock-type-face)=0A= =20=0A@@=20-980,6=20+1024,18=20@@=20csharp-ts-mode--font-lock-settings=0A= =20=20=20=20=20=20(method_declaration=20,csharp-ts-mode--type-field=20= (generic_name=20(identifier)=20@font-lock-type-face))=0A=20=20=20=20=20=20= (method_declaration=20name:=20(_)=20@font-lock-function-name-face)=0A=20=0A= +=20=20=20=20=20;;=20only=20fontify=20known=20expression-types,=20to=20= avoid=20the=20need=20to=20use=20:override=0A+=20=20=20=20=20;;=20for=20= lambda-expressions=20in=20'function=20below.=0A+=20=20=20=20=20= (variable_declarator=0A+=20=20=20=20=20=20name:=20(identifier)=20= @font-lock-variable-name-face=0A+=20=20=20=20=20=20= [(object_creation_expression)=0A+=20=20=20=20=20=20=20(integer_literal)=0A= +=20=20=20=20=20=20=20(string_literal)=0A+=20=20=20=20=20=20=20= (binary_expression)=0A+=20=20=20=20=20=20=20(invocation_expression)=0A+=20= =20=20=20=20=20=20(member_access_expression)=0A+=20=20=20=20=20=20=20= (conditional_expression)])=0A+=0A=20=20=20=20=20=20(catch_declaration=0A=20= =20=20=20=20=20=20((identifier)=20@font-lock-type-face))=0A=20=20=20=20=20= =20(catch_declaration=0A@@=20-990,7=20+1046,6=20@@=20= csharp-ts-mode--font-lock-settings=0A=20=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=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(variable_declarator=20= (identifier)=20@font-lock-variable-name-face)=0A=20=0A=20=20=20=20=20=20= (parameter=20type:=20(identifier)=20@font-lock-type-face)=0A=20=20=20=20=20= =20(parameter=20type:=20(generic_name=20(identifier)=20= @font-lock-type-face))=0A@@=20-1007,14=20+1062,6=20@@=20= csharp-ts-mode--font-lock-settings=0A=20=20=20=20:feature=20'function=0A=20= =20=20=20'((invocation_expression=0A=20=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=20function:=20= (member_access_expression=0A-=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= (member_access_expression=0A-=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= (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= ((invocation_expression=0A=20=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=20=20expression:=20(identifier)=20@font-lock-variable-use-face))=0A= @@=20-1024,7=20+1071,11=20@@=20csharp-ts-mode--font-lock-settings=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=20= (:match=20"^[a-z][A-Za-z0-9]+"=20@font-lock-variable-use-face))=0A=20=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=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;;=20only=20highlight=20as=20function=20if=20variable=20contains=20= lambda=20expression=0A+=20=20=20=20=20(variable_declarator=0A+=20=20=20=20= =20=20name:=20(identifier)=20@font-lock-function-name-face=0A+=20=20=20=20= =20=20(lambda_expression)))=0A=20=0A=20=20=20=20:language=20'c-sharp=0A=20= =20=20=20:feature=20'escape-sequence=0A@@=20-1204,7=20+1255,7=20@@=20= csharp-ts-mode=0A=20=20=20(setq-local=20treesit-font-lock-feature-list=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20'((=20comment=20definition)=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(=20keyword=20string=20= type=20directives)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(=20= constant=20escape-sequence=20expression=20literal=20property)=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(=20constant=20escape-sequence=20= expression=20literal=20attribute)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(=20function=20bracket=20delimiter=20error)))=0A=20=0A=20=20=20= ;;=20Imenu.=0A--=20=0A2.51.0=0A=0A= --Apple-Mail=_5FAFB9DE-2C09-44DC-8950-B624EFBAD3EC Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

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


= --Apple-Mail=_5FAFB9DE-2C09-44DC-8950-B624EFBAD3EC-- --Apple-Mail=_F105FCE7-C76B-44AE-B242-18A798E0DE23--