From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 06 17:18:44 2025 Received: (at submit) by debbugs.gnu.org; 6 Sep 2025 21:18:44 +0000 Received: from localhost ([127.0.0.1]:39153 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uv0J1-0006ft-Iu for submit@debbugs.gnu.org; Sat, 06 Sep 2025 17:18:43 -0400 Received: from lists.gnu.org ([2001:470:142::17]:37778) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uv0Iw-0006f9-D8 for submit@debbugs.gnu.org; Sat, 06 Sep 2025 17:18:39 -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 1uv0Io-0008S5-MF for bug-gnu-emacs@gnu.org; Sat, 06 Sep 2025 17:18:30 -0400 Received: from fhigh-b2-smtp.messagingengine.com ([202.12.124.153]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uv0Ia-0008Cj-JB for bug-gnu-emacs@gnu.org; Sat, 06 Sep 2025 17:18:30 -0400 Received: from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52]) by mailfhigh.stl.internal (Postfix) with ESMTP id 5BF097A008D; Sat, 6 Sep 2025 17:18:02 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Sat, 06 Sep 2025 17:18:02 -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=1757193482; x=1757279882; bh=0F KQ90RBzvbbE2z+Gm7FhQ4e2G7QH1cCvrHhKaJ1Kc0=; b=S9NMMlDggefHddBvk4 5L7iKTo8jYy5XPWkj/LJPq6O+oYlgMGFpq1W4SI1MHLhQEGociTdgPO1CSkBkW+V /h40RQi+WgoWKMNyJwmh7q60+Fet1JJCKnagd1BB0a/JQUwqYAayWcduL/ZFM9Nw 1PNtJnBhWxdMwTuRD8pm/sJdAGka4fJqaFk1vn0co1na8jobFgU0OJlwq/55KwuP hHs/4xSYTsVUOoUXY68IroCRsmFw/JZLNhVmp1ualIU7a2KhLYB/UFaZS19ESu0Z 9u3VG3qrACkhWh4+cK0jARdhDmk0wmdrLFmo9ljS3dG2H79rRpqEZA8tUdbpUO+u Zq2Q== 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=1757193482; x= 1757279882; bh=0FKQ90RBzvbbE2z+Gm7FhQ4e2G7QH1cCvrHhKaJ1Kc0=; b=L BWyyVnUwwwre31Kh+/mp+gmWpNKTMTPlhz8+DxYN2KkBAFszohj0LLZSdPgSYbMa cqjGiEhsbkdARos9Zhg3BQon5l6JH0JantzB1bchXKt8arNSE+AvVEHjKRq7QbYQ kn7Fd18kE2zwwKGvkptCoa8cvMBeYQR8d7z/VK9yi2CQqmdNKjR8UC5E4sZARl97 erVlVavhodgtPZuNly+hk0whdSsEQ1soLHdrxf4RHXNqpZj+t/A2qmbZaBvGoTc8 DR9KVVrOoH7wCystWfnJR4tauKrZ5YfPca3BKGZR3hWhh//kf0gy4BLiDt6msgNE 5AAChaDzXu8WMJWcSzf1Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdduvdekfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecunecujfgurhephfgtggfukfffvefvofesrgdtmherhhdtje enucfhrhhomheplfhoshhtvghinhcumfhjpphnihhgshgvnhcuoehjohhsthgvihhnsehs vggtuhhrvgdrkhhjohhnihhgshgvnhdrnhgvtheqnecuggftrfgrthhtvghrnhepgfdvff elkeeiuedvudegffejfeegiedvtefhiefggfffjefhveduieehuedtieffnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhoshhtvghinhessh gvtghurhgvrdhkjhhonhhighhsvghnrdhnvghtpdhnsggprhgtphhtthhopedvpdhmohgu vgepshhmthhpohhuthdprhgtphhtthhopegsuhhgqdhgnhhuqdgvmhgrtghssehgnhhurd horhhgpdhrtghpthhtoheptggrshhouhhrihesghhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: ib2f84088:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 6 Sep 2025 17:18:01 -0400 (EDT) From: =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= Content-Type: multipart/alternative; boundary="Apple-Mail=_35674DAF-ED81-4BF6-B893-0155DE41002C" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: [PATCH] 31.0.50; csharp-ts-mode has various indentation bugs Message-Id: Date: Sat, 6 Sep 2025 23:17:49 +0200 To: bug-gnu-emacs@gnu.org X-Mailer: Apple Mail (2.3826.700.81) Received-SPF: pass client-ip=202.12.124.153; envelope-from=jostein@secure.kjonigsen.net; helo=fhigh-b2-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_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=_35674DAF-ED81-4BF6-B893-0155DE41002C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hey everyone. When writing new code with csharp-ts-mode, I've noticed there are a few = cases where indentation is not automatically correct according to what = is natural, nor what is convention. For some cases, the indentation falls back to 0-indentation, and you = have to manually add all the indentation back for things to look normal. Examples: - method call chains across several lines (indentation wrong on = new-line) - creating new objects (indentation wrong on first line after "new" - = being unindented) - array creation expressions (indentation wrong on second line, the one = containing { - being overly indented ) Attached is a patch which fixes these behaviours. =E2=80=94 Kind Regards Jostein Kj=C3=B8nigsen =EF=BF=BC= --Apple-Mail=_35674DAF-ED81-4BF6-B893-0155DE41002C Content-Type: multipart/mixed; boundary="Apple-Mail=_8F2A22CF-D148-44ED-9F98-2C8D848CEA4F" --Apple-Mail=_8F2A22CF-D148-44ED-9F98-2C8D848CEA4F Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
Hey = everyone.

When writing new code with = csharp-ts-mode, I've noticed there are a few cases where indentation is = not automatically correct according to what is natural, nor what is = convention.

For some cases, the indentation = falls back to 0-indentation, and you have to manually add all the = indentation back for things to look = normal.

Examples:

- = method call chains across several lines (indentation wrong on = new-line)
- creating new objects (indentation wrong on first = line after "new" - being unindented)
- array creation = expressions (indentation wrong on second line, the one containing { - = being overly indented )

Attached is a patch = which fixes these behaviours.

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


= --Apple-Mail=_8F2A22CF-D148-44ED-9F98-2C8D848CEA4F Content-Disposition: attachment; filename=0001-csharp-mode-indentation-fixes.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-csharp-mode-indentation-fixes.patch" Content-Transfer-Encoding: quoted-printable =46rom=203c982c50cd8ecdd5420e8fa16b2a52cb2a3806fd=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Jostein=3D20Kj=3DC3=3DB8nigsen?=3D=20= =0ADate:=20Sat,=206=20Sep=202025=2022:50:53=20= +0200=0ASubject:=20[PATCH]=20csharp-mode:=20indentation=20fixes=0A=0A*=20= csharp-ts-mode--indent-rules:=20adjust=20rules=20to=20fix=20the=20= following=0Aincorrect=20behaviours:=0A=0A-=20in=20multiline=20= expressions/method=20call=20chains=0A-=20in=20object=20initialization=20= expressions=0A-=20in=20array=20creation=20expressions=0A---=0A=20= lisp/progmodes/csharp-mode.el=20|=203=20+++=0A=201=20file=20changed,=203=20= insertions(+)=0A=0Adiff=20--git=20a/lisp/progmodes/csharp-mode.el=20= b/lisp/progmodes/csharp-mode.el=0Aindex=206ced5206b9b..2dfe2a9f946=20= 100644=0A---=20a/lisp/progmodes/csharp-mode.el=0A+++=20= b/lisp/progmodes/csharp-mode.el=0A@@=20-679,11=20+679,14=20@@=20= csharp-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;;=20= actual=20initialization=20is=20in=20contained=20initializer_expression=0A= +=20=20=20=20=20((match=20"{"=20"initializer_expression"=20)=20= parent-bol=200)=0A=20=20=20=20=20=20((parent-is=20= "initializer_expression")=20parent-bol=20csharp-ts-mode-indent-offset)=0A= =20=20=20=20=20=20((match=20"{"=20= "anonymous_object_creation_expression")=20parent-bol=200)=0A=20=20=20=20=20= =20((parent-is=20"anonymous_object_creation_expression")=20parent-bol=20= csharp-ts-mode-indent-offset)=0A=20=20=20=20=20=20((match=20"{"=20= "object_creation_expression")=20parent-bol=200)=0A=20=20=20=20=20=20= ((parent-is=20"object_creation_expression")=20parent-bol=200)=0A+=20=20=20= =20=20((parent-is=20"member_access_expression")=20parent-bol=20= csharp-ts-mode-indent-offset)=0A=20=20=20=20=20=20((parent-is=20= "method_declaration")=20parent-bol=200)=0A=20=20=20=20=20=20((parent-is=20= "enum_declaration")=20parent-bol=200)=0A=20=20=20=20=20=20((parent-is=20= "operator_declaration")=20parent-bol=200)=0A--=20=0A2.51.0=0A=0A= --Apple-Mail=_8F2A22CF-D148-44ED-9F98-2C8D848CEA4F Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii
--Apple-Mail=_8F2A22CF-D148-44ED-9F98-2C8D848CEA4F-- --Apple-Mail=_35674DAF-ED81-4BF6-B893-0155DE41002C-- From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 07 13:57:51 2025 Received: (at 79398) by debbugs.gnu.org; 7 Sep 2025 17:57:51 +0000 Received: from localhost ([127.0.0.1]:45674 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uvJeB-0006ia-5i for submit@debbugs.gnu.org; Sun, 07 Sep 2025 13:57:51 -0400 Received: from mout-p-201.mailbox.org ([2001:67c:2050:0:465::201]:39294) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uvJe2-0006i7-TP; Sun, 07 Sep 2025 13:57:45 -0400 Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4cKd8Z0Whlz9t2h; Sun, 7 Sep 2025 19:57:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; t=1757267854; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jeQdVI+TlSmJk7Uw9EP8QeavhDBUD+0q5KjZcPdJ02A=; b=JPGf35OjTWY2i82OuaagzKxDsjMFN9HrLoe1FbLnI0uzdV/YsXJBB2ZVM5mouO5oWJNn3X Z7OLCCcwJxRgFSOltgW7G5KJc35fmtgXZSRIi7X+FydWqTjDIwIbYYRCcQIJ1HXGS6+gfz FHi1/nDTX17IxWJY283br5YSE/YEs6swOx8bpJZx4BuznGgH+UfqIhvrcA3bKgfDMkn8E1 tHLkqo1Ti4XogSqjkMzxk/n1IOLrjtXAH5UKk1pgPqznK5m+9uA9CHWXshadktsy+wZmRU sIqt1kai0fqzFi1GbNiGf3+951UaTCsPcoQDJlpJrQlBXNqPem4SjL7jjKA5xA== From: Juri Linkov To: Jostein =?iso-8859-1?Q?Kj=F8nigsen?= Subject: Re: bug#79398: [PATCH] 31.0.50; csharp-ts-mode has various indentation bugs In-Reply-To: Organization: LINKOV.NET References: Date: Sun, 07 Sep 2025 20:55:48 +0300 Message-ID: <87v7lucfrf.fsf@mail.linkov.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79398 Cc: Yuan Fu , 79398@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.7 (-) close 79398 31.0.50 thanks > Attached is a patch which fixes these behaviours. Thanks, now pushed (I had to push the patch as soon as possible to avoid merge conflicts with bug#79363 where we are refactoring indentation functions.)