GNU bug report logs - #70345
[PATCH] 29.1.50; csharp-ts-mode indentation of if statements with single-statement body

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Jacob Leeming <jacobtophatleeming@HIDDEN>; Keywords: patch; Done: Eli Zaretskii <eliz@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 70345 <at> debbugs.gnu.org:


Received: (at 70345) by debbugs.gnu.org; 27 Apr 2024 19:18:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 27 15:18:43 2024
Received: from localhost ([127.0.0.1]:49702 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s0nZK-00059K-Vo
	for submit <at> debbugs.gnu.org; Sat, 27 Apr 2024 15:18:43 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:56646)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1s0nZH-00059E-Uz
 for 70345 <at> debbugs.gnu.org; Sat, 27 Apr 2024 15:18:41 -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 <eliz@HIDDEN>)
 id 1s0nYs-0006Tz-VW; Sat, 27 Apr 2024 15:18:14 -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=ih2ZifgWTQEjF9Q/9J+vYvJHR9ZbyvUStWQdE/09S5g=; b=R+/lfPsQI2VJ5+14I/wx
 sEnrzjFjmG48RjwqgvFzvCsoR+2vEPmnJPOpKfXyAFvC/q5aI9kRhaJ4d0qLEvF0Yi566mw3xGBJL
 NtEr5pEVCXFGgnJcqKptCjt07qPEY3sSnsfV22t0xq7xFemQIyZR7OtvDm38PK5Ac2C7QaSAVJuId
 8W0RYKydomnUftRSl+oSSxDYAPrm6w7SFn68kNxb4zugcLupZ00VX3kyff4MwtGCKV94ZpZPsujlQ
 mXngd6atTKn+g4WAy3WegHPVQXEX+LEbgniMwTgUz1gPBFpd8gfXL1ptXgn4TIxCN+i3vWUM3JNO/
 SNIRQET3ZMCjuQ==;
Date: Sat, 27 Apr 2024 22:18:09 +0300
Message-Id: <86frv6vclq.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: john muhl <jm@HIDDEN>
In-Reply-To: <87edaq3evk.fsf@HIDDEN> (message from john muhl on Sat, 27 Apr
 2024 12:13:12 -0500)
Subject: Re: bug#70345: [PATCH] 29.1.50; csharp-ts-mode indentation of if
 statements with single-statement body
References: <87o7afod31.fsf@HIDDEN> <87mspusb5k.fsf@HIDDEN>
 <87wmopaii8.fsf@HIDDEN> <867cgl1la9.fsf@HIDDEN>
 <875xw2et3e.fsf@HIDDEN> <86h6fmvmm0.fsf@HIDDEN> <87edaq3evk.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: 70345
Cc: dmitry@HIDDEN, 70345 <at> debbugs.gnu.org, theo@HIDDEN,
 jacobtophatleeming@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

> From: john muhl <jm@HIDDEN>
> Cc: jacobtophatleeming@HIDDEN, dmitry@HIDDEN, 70345 <at> debbugs.gnu.org,
>  theo@HIDDEN
> Date: Sat, 27 Apr 2024 12:13:12 -0500
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > Thanks, but shouldn't we invoke treesit-ready-p with second argument
> > non-nil?
> 
> Looks like it’s gone either way so far.

"Two wrongs don't make a right."  Without the 2nd arg, the function
complains:

  Warning (treesit): Cannot activate tree-sitter, because language grammar for c-sharp is unavailable (not-found): (libtree-sitter-c-sharp libtree-sitter-c-sharp.dll) No such file or directory
    skipped  2/2  csharp-ts-mode-test-indentation (0.007771 sec)

So I've added the 2nd argument to your patch and installed it on the
emacs-29 branch.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70345; Package emacs. Full text available.

Message received at 70345 <at> debbugs.gnu.org:


Received: (at 70345) by debbugs.gnu.org; 27 Apr 2024 17:17:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 27 13:17:04 2024
Received: from localhost ([127.0.0.1]:49600 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s0lfb-0000tq-M0
	for submit <at> debbugs.gnu.org; Sat, 27 Apr 2024 13:17:04 -0400
Received: from wfout1-smtp.messagingengine.com ([64.147.123.144]:60829)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jm@HIDDEN>) id 1s0lfY-0000tQ-Mu
 for 70345 <at> debbugs.gnu.org; Sat, 27 Apr 2024 13:17:01 -0400
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
 by mailfout.west.internal (Postfix) with ESMTP id D49851C000BB;
 Sat, 27 Apr 2024 13:16:34 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute5.internal (MEProxy); Sat, 27 Apr 2024 13:16:35 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pub.pink; h=cc
 :cc:content-transfer-encoding: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=1714238194;
 x=1714324594; bh=4s0aJc4/D7jEbNFFbQRqCtU+RFE78R/jSb/TkbivuCA=; b=
 qxbX+hL6cY4cJwZ3YDEPb+I7i2HEaj5gcX/dOSGNz4c2sVqfAs9wlOvmsvftZs4Q
 X2hRq5CId8yKVlVGTOC2NvQmHJBpJia2NgEwkKt7fAK+WKMveOm3TgKyKcVijVlw
 kv8L8DxYupRcVWx4FqX9IhD1l3SJX4hIpTaVtOPVir9e+ZSGtigaAzHrPqusQGkg
 MNrvmMXHTvGxT4ojdzyX/ZKt9OKDRVMAi4KLGi+W5rL3kQdk527UB4XQwwf62+NY
 83KX7TrrRp7kdQjqVR3nhRdLzPIVQNqa5v6UDcg3PdCWzEomxZXn1ez2nCB4YabN
 Gf0T9NHlVlaNepyksX4fYQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :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-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1714238194; x=
 1714324594; bh=4s0aJc4/D7jEbNFFbQRqCtU+RFE78R/jSb/TkbivuCA=; b=O
 zoL8rqHBIr8Zm8GYMHJ5YqVD53GEnVAxMRA71Lq6soacFbsU6G0mvQITElzLpWOJ
 he5ehYWnfuNmRvl8A4tz7VRcRT3cgigkmdWS9QSik2yREvEkPwmL922xMBQ/8onx
 p81pElvY1A+BNyrL4Hkt6BLH9BxqW1j6yMsLBL0WbrB9VTeicIJlwV1k/fhZVp+9
 u4rLQLFjEfao5Som5s3xq3C0PKkPolOhpBElYP4h8wuNTzWHrqBeJa3Y2XL71xTP
 G1TVztMn4vCBaKT5zmN281NsKiD4kG99St1k9ibyr0K3VP1IQb6zRrj7uOHf5eKs
 g4mjlRd7XlAgCrUz2Lckw==
X-ME-Sender: <xms:8TItZv1Ba17hEvMLBXwxMS4v2gDwiw2tdTMVTpFQgYm991VdZYI4yg>
 <xme:8TItZuGCJhTYPUw2ALkAo9lmvuUKX_jydFpBy6zxyvAYkd8bGf1FbS3m6qnCSn6RO
 zonqeFzJnvfzVh3DyQ>
X-ME-Received: <xmr:8TItZv43yOrOeZtWiUWs6583F0voVzr-bAN7vN1yiI49fQ-lItVCcx2G>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvddtuddguddutdcutefuodetggdotefrod
 ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh
 necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd
 enucfjughrpehffgfhvfevufffjgfkgggtgfesthhqredttderjeenucfhrhhomhepjhho
 hhhnuchmuhhhlhcuoehjmhesphhusgdrphhinhhkqeenucggtffrrghtthgvrhhnpeeiue
 dugedtveehjeehudeuieduudekffekvdekkeefhfevgeetvddugeffueelheenucevlhhu
 shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjmhesphhusgdrph
 hinhhk
X-ME-Proxy: <xmx:8TItZk13mQBsoielg8WrzbQaxWTzAi3CvwWLy05qzqDNeihlY3ICrw>
 <xmx:8TItZiG-xh8jUPueNM45Af-4gMf5zNJhfOQFPZeW2dPSAiRthO4M7A>
 <xmx:8TItZl82w3uogNY_mcg-mKvKCupNYOyVl6QviQd8pCLB6VNXs3aasA>
 <xmx:8TItZvkRKQmSxvvrz5MMt6cPC0X-mBProIH3p-lFgKqz_T5PD7TdlA>
 <xmx:8jItZvPWvbjP7uiLNv5DzdmlD19FohR0mLHLr_IShq4PNnyLwZKcgWCd>
Feedback-ID: i74194916:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat,
 27 Apr 2024 13:16:32 -0400 (EDT)
References: <87o7afod31.fsf@HIDDEN> <87mspusb5k.fsf@HIDDEN>
 <87wmopaii8.fsf@HIDDEN> <867cgl1la9.fsf@HIDDEN>
 <875xw2et3e.fsf@HIDDEN> <86h6fmvmm0.fsf@HIDDEN>
User-agent: mu4e 1.10.8; emacs 30.0.50
From: john muhl <jm@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#70345: [PATCH] 29.1.50; csharp-ts-mode indentation of if
 statements with single-statement body
Date: Sat, 27 Apr 2024 12:13:12 -0500
In-reply-to: <86h6fmvmm0.fsf@HIDDEN>
Message-ID: <87edaq3evk.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70345
Cc: dmitry@HIDDEN, 70345 <at> debbugs.gnu.org, theo@HIDDEN,
 jacobtophatleeming@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: john muhl <jm@HIDDEN>
>> Cc: Jacob Leeming <jacobtophatleeming@HIDDEN>, dmitry@HIDDEN,
>>  70345 <at> debbugs.gnu.org, theo@HIDDEN
>> Date: Sat, 27 Apr 2024 08:10:47 -0500
>>=20
>> The test should check that the c-sharp grammar is available so
>> that it gets marked as skipped instead of failed.
>>=20
>> >From 068cad8612c31cea41f0cc21a865efe0785d4e7a Mon Sep 17 00:00:00 2001
>> From: john muhl <jm@HIDDEN>
>> Date: Sat, 27 Apr 2024 09:55:42 -0500
>> Subject: [PATCH] ; Skip 'csharp-ts-mode' test if grammar is missing
>>=20
>> * test/lisp/progmodes/csharp-mode-tests.el
>> (csharp-ts-mode-test-indentation): Skip test instead of failing.
>> ---
>>  test/lisp/progmodes/csharp-mode-tests.el | 1 +
>>  1 file changed, 1 insertion(+)
>>=20
>> diff --git a/test/lisp/progmodes/csharp-mode-tests.el b/test/lisp/progmo=
des/csharp-mode-tests.el
>> index 2878fa601f2..b3c57a7026b 100644
>> --- a/test/lisp/progmodes/csharp-mode-tests.el
>> +++ b/test/lisp/progmodes/csharp-mode-tests.el
>> @@ -27,6 +27,7 @@ csharp-mode-test-indentation
>>    (ert-test-erts-file (ert-resource-file "indent.erts")))
>>=20=20
>>  (ert-deftest csharp-ts-mode-test-indentation ()
>> +  (skip-unless (treesit-ready-p 'c-sharp))
>>    (ert-test-erts-file (ert-resource-file "indent-ts.erts")))
>
> Thanks, but shouldn't we invoke treesit-ready-p with second argument
> non-nil?

Looks like it=E2=80=99s gone either way so far.

$ git grep 'treesit-ready-p' test/lisp/
test/lisp/align-tests.el:(autoload 'treesit-ready-p "treesit")
test/lisp/align-tests.el:  (skip-unless (treesit-ready-p 'lua))
test/lisp/progmodes/c-ts-mode-tests.el:  (skip-unless (treesit-ready-p 'c))
test/lisp/progmodes/c-ts-mode-tests.el:  (skip-unless (treesit-ready-p 'c))
test/lisp/progmodes/c-ts-mode-tests.el:  (skip-unless (treesit-ready-p 'c))
test/lisp/progmodes/c-ts-mode-tests.el:  (skip-unless (treesit-ready-p 'c))
test/lisp/progmodes/csharp-mode-tests.el:  (skip-unless (treesit-ready-p 'c=
-sharp))
test/lisp/progmodes/elixir-ts-mode-tests.el:  (skip-unless (and (treesit-re=
ady-p 'elixir) (treesit-ready-p 'heex)))
test/lisp/progmodes/go-ts-mode-tests.el:  (skip-unless (treesit-ready-p 'go=
))
test/lisp/progmodes/heex-ts-mode-tests.el:  (skip-unless (treesit-ready-p '=
heex))
test/lisp/progmodes/java-ts-mode-tests.el:  (skip-unless (treesit-ready-p '=
java))
test/lisp/progmodes/java-ts-mode-tests.el:  (skip-unless (treesit-ready-p '=
java))
test/lisp/progmodes/js-tests.el:  (skip-unless (treesit-ready-p 'javascript=
))
test/lisp/progmodes/lua-ts-mode-tests.el:  (skip-unless (treesit-ready-p 'l=
ua))
test/lisp/progmodes/lua-ts-mode-tests.el:  (skip-unless (treesit-ready-p 'l=
ua))
test/lisp/progmodes/lua-ts-mode-tests.el:  (skip-unless (treesit-ready-p 'l=
ua))
test/lisp/progmodes/lua-ts-mode-tests.el:  (skip-unless (treesit-ready-p 'l=
ua))
test/lisp/progmodes/python-tests.el:     (skip-unless (treesit-ready-p 'pyt=
hon))
test/lisp/progmodes/ruby-ts-mode-tests.el:  (skip-unless (treesit-ready-p '=
ruby t))
test/lisp/progmodes/ruby-ts-mode-tests.el:  (skip-unless (treesit-ready-p '=
ruby t))
test/lisp/progmodes/ruby-ts-mode-tests.el:  (skip-unless (treesit-ready-p '=
ruby t))
test/lisp/progmodes/ruby-ts-mode-tests.el:  (skip-unless (treesit-ready-p '=
ruby t))
test/lisp/progmodes/ruby-ts-mode-tests.el:  (skip-unless (treesit-ready-p '=
ruby t))
test/lisp/progmodes/ruby-ts-mode-tests.el:  (skip-unless (treesit-ready-p '=
ruby t))
test/lisp/progmodes/ruby-ts-mode-tests.el:  (skip-unless (treesit-ready-p '=
ruby t))
test/lisp/progmodes/ruby-ts-mode-tests.el:  (skip-unless (treesit-ready-p '=
ruby t))
test/lisp/progmodes/ruby-ts-mode-tests.el:  (skip-unless (treesit-ready-p '=
ruby t))
test/lisp/progmodes/ruby-ts-mode-tests.el:  (skip-unless (treesit-ready-p '=
ruby t))
test/lisp/progmodes/ruby-ts-mode-tests.el:  (skip-unless (treesit-ready-p '=
ruby t))
test/lisp/progmodes/ruby-ts-mode-tests.el:  (skip-unless (treesit-ready-p '=
ruby t))
test/lisp/progmodes/ruby-ts-mode-tests.el:  (skip-unless (treesit-ready-p '=
ruby t))
test/lisp/progmodes/ruby-ts-mode-tests.el:  (skip-unless (treesit-ready-p '=
ruby t))
test/lisp/progmodes/ruby-ts-mode-tests.el:  (skip-unless (treesit-ready-p '=
ruby t))
test/lisp/progmodes/ruby-ts-mode-tests.el:     (skip-unless (treesit-ready-=
p 'ruby t))
test/lisp/progmodes/rust-ts-mode-tests.el:  (skip-unless (treesit-ready-p '=
rust))
test/lisp/progmodes/typescript-ts-mode-tests.el:  (skip-unless (and (treesi=
t-ready-p 'typescript)
test/lisp/progmodes/typescript-ts-mode-tests.el:                    (treesi=
t-ready-p 'tsx)))





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70345; Package emacs. Full text available.

Message received at 70345 <at> debbugs.gnu.org:


Received: (at 70345) by debbugs.gnu.org; 27 Apr 2024 15:42:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 27 11:42:30 2024
Received: from localhost ([127.0.0.1]:49528 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s0kC6-0002Wo-31
	for submit <at> debbugs.gnu.org; Sat, 27 Apr 2024 11:42:30 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:58452)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1s0kC3-0002Wf-HQ
 for 70345 <at> debbugs.gnu.org; Sat, 27 Apr 2024 11:42:28 -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 <eliz@HIDDEN>)
 id 1s0kBe-0001uq-Lx; Sat, 27 Apr 2024 11:42:02 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=THq8nVEW9Ph+4EpUCF25WPxpIdQxwa6rU8jxUD6+4BE=; b=QQC1WP+04TaE
 zvSw1HK/CmhdOGz9QvJLvrjJsdLbQiINWO91AYVab2i/Qrezf0tDeV6+JEp1eRR/d1Jh6ivf+K8B+
 44s1IjDejYoQi+pEhBLc77TSwppPJ1sbH7RCJ5u7bLEZSfyZEG2ZSnu/p7Ira486uk6k2175QjsGg
 6UFVBB0s2Ir8u7XnGIugOQUXRsZ55NSSMpM0odBYyP27syCTBWoUSMmehEGyV4GPUlfW5GEj1KAqk
 Pho5mbaHB4t0TiNsHNQqqk5TEYh0lPg32G/BpMb1DMPE4HSgH/Yr8PMlAxJSg+TmjPMNyA+0uLsbj
 JaP/UGeDYkHXnlpNfYq3YA==;
Date: Sat, 27 Apr 2024 18:41:59 +0300
Message-Id: <86h6fmvmm0.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: john muhl <jm@HIDDEN>
In-Reply-To: <875xw2et3e.fsf@HIDDEN> (message from john muhl on Sat, 27 Apr
 2024 08:10:47 -0500)
Subject: Re: bug#70345: [PATCH] 29.1.50; csharp-ts-mode indentation of if
 statements with single-statement body
References: <87o7afod31.fsf@HIDDEN> <87mspusb5k.fsf@HIDDEN>
 <87wmopaii8.fsf@HIDDEN> <867cgl1la9.fsf@HIDDEN> <875xw2et3e.fsf@HIDDEN>
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: 70345
Cc: dmitry@HIDDEN, 70345 <at> debbugs.gnu.org, theo@HIDDEN,
 jacobtophatleeming@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

> From: john muhl <jm@HIDDEN>
> Cc: Jacob Leeming <jacobtophatleeming@HIDDEN>, dmitry@HIDDEN,
>  70345 <at> debbugs.gnu.org, theo@HIDDEN
> Date: Sat, 27 Apr 2024 08:10:47 -0500
> 
> The test should check that the c-sharp grammar is available so
> that it gets marked as skipped instead of failed.
> 
> >From 068cad8612c31cea41f0cc21a865efe0785d4e7a Mon Sep 17 00:00:00 2001
> From: john muhl <jm@HIDDEN>
> Date: Sat, 27 Apr 2024 09:55:42 -0500
> Subject: [PATCH] ; Skip 'csharp-ts-mode' test if grammar is missing
> 
> * test/lisp/progmodes/csharp-mode-tests.el
> (csharp-ts-mode-test-indentation): Skip test instead of failing.
> ---
>  test/lisp/progmodes/csharp-mode-tests.el | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/test/lisp/progmodes/csharp-mode-tests.el b/test/lisp/progmodes/csharp-mode-tests.el
> index 2878fa601f2..b3c57a7026b 100644
> --- a/test/lisp/progmodes/csharp-mode-tests.el
> +++ b/test/lisp/progmodes/csharp-mode-tests.el
> @@ -27,6 +27,7 @@ csharp-mode-test-indentation
>    (ert-test-erts-file (ert-resource-file "indent.erts")))
>  
>  (ert-deftest csharp-ts-mode-test-indentation ()
> +  (skip-unless (treesit-ready-p 'c-sharp))
>    (ert-test-erts-file (ert-resource-file "indent-ts.erts")))

Thanks, but shouldn't we invoke treesit-ready-p with second argument
non-nil?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70345; Package emacs. Full text available.

Message received at 70345 <at> debbugs.gnu.org:


Received: (at 70345) by debbugs.gnu.org; 27 Apr 2024 15:14:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 27 11:14:31 2024
Received: from localhost ([127.0.0.1]:49512 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s0jl1-0002FR-Fb
	for submit <at> debbugs.gnu.org; Sat, 27 Apr 2024 11:14:31 -0400
Received: from wfout8-smtp.messagingengine.com ([64.147.123.151]:54721)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jm@HIDDEN>) id 1s0jkw-0002FJ-77
 for 70345 <at> debbugs.gnu.org; Sat, 27 Apr 2024 11:14:30 -0400
Received: from compute6.internal (compute6.nyi.internal [10.202.2.47])
 by mailfout.west.internal (Postfix) with ESMTP id 07EB01C000B5;
 Sat, 27 Apr 2024 11:14:00 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute6.internal (MEProxy); Sat, 27 Apr 2024 11:14:01 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pub.pink; 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=1714230840; x=1714317240; bh=6H9F5GFbMc
 9Cww+KmhWsjCFcD9z1D+QXpTl4NjwP2vk=; b=JEjsfp5F4ryJf2ETvdyCXBNkvv
 clGr6vWsaPRKUhuazU76H/80hjl9y8cP9rK+fDqKRbktAy0FJi+WmnbufJgfTqGO
 tTBOCPjt0ly5Z6EnlKPtzNBi0WawOd3BQ2dB5XuBvMXOWbf4a48hBA327QJxIj8E
 NR0I8H4rDliusG4+CRlLAQRcp+kp0qwuyj9AABTh1U784iWNMAiwAYrZyVmDbhu7
 mzhusaTriWxEg3fPg0kRtO/Si+Aa9OOYhaaCCYsl7GqeBzWcFhI6s9CqY3KCaz/h
 2+4YS8PmS6VZz56qLqiNEXQxYOj0B+Squj3sdwpltTpZtJ4QsmDFDFlXvyLw==
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-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=
 fm3; t=1714230840; x=1714317240; bh=6H9F5GFbMc9Cww+KmhWsjCFcD9z1
 D+QXpTl4NjwP2vk=; b=A0NpOR1RQj1UZXxIcfYP3HCMr5puRYMT5ANabWiwKTK8
 PjtSm0K/hJ8XHC0CvCXJ4Z7LjuKaSZRqkS3ZQWo5k88dduK6AnKbYQrjcxdE/Qpt
 6bhj876iT3LGLB2DPquqBcHzhMPuLybjhK/LdOKsAKUvx6sAf84Psv/Hfxbgkeww
 7AM81MIoMZKfhEprWGZj3gFKN1qCm9xbuPLkYSnv7CiW55FCsl4/IPpjojsPnbHA
 /QxPUpS6hSmKXQ0GA+gkToZQok402DLR4q2eS2r35ZBVCoYffuG81szKNkkWa4yK
 ZfjPQ+mn8kXpUA/oi4OH69cK7TpL8gG0Tp/34ZzOSg==
X-ME-Sender: <xms:NxYtZiLLM1hhwP-l0T1ElHs2X7Zl2ez5wdziczRHsEnAZ1WwZQFXUw>
 <xme:NxYtZqIl3B0-apbVjl8yMW-e6DyolkGvcFmk_LgtECopqy6-07u0Y-8wuTTHnCjRV
 UaWZKFodlIpg7bpB9Q>
X-ME-Received: <xmr:NxYtZivqQ6X1B5NsH_b350HT0TPPEAAICunaK1cvujIrldX2wW-fkdos>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvddtuddgkeegucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhepfhgfhffvvefuffgjkfggtgesmhdtreertdertdenucfhrhhomhepjhhohhhn
 uchmuhhhlhcuoehjmhesphhusgdrphhinhhkqeenucggtffrrghtthgvrhhnpedufedtte
 eludegledvfefhhfeileetkeelhffhheekuefggffftdejgfehgfelhfenucevlhhushht
 vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjmhesphhusgdrphhinh
 hk
X-ME-Proxy: <xmx:NxYtZnbC1NDBTBmxIXLvFMhua-nm7az-Ah4V3bXdLJ0yc8pvCiH7SQ>
 <xmx:NxYtZpaUWOakWjvAtJnVBuAIUUntQ51eJuWN9qzJvz8nTStIXjx5Fg>
 <xmx:NxYtZjCkZDgWRLrtWvpQ1TNPQkrB7qDnIUeFICOIpvBgaz4GJ1hOcA>
 <xmx:NxYtZvaZOt2sgJMgzXZWtMnQ2cDCaSow1hR3phHHoPYTzqYHfziEwg>
 <xmx:OBYtZsyJICrEZK_NflHPUpd5zR3PL1wR3gyp1aVSNFHmIQNx-gy25JZ2>
Feedback-ID: i74194916:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat,
 27 Apr 2024 11:13:59 -0400 (EDT)
References: <87o7afod31.fsf@HIDDEN> <87mspusb5k.fsf@HIDDEN>
 <87wmopaii8.fsf@HIDDEN> <867cgl1la9.fsf@HIDDEN>
User-agent: mu4e 1.10.8; emacs 30.0.50
From: john muhl <jm@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#70345: [PATCH] 29.1.50; csharp-ts-mode indentation of if
 statements with single-statement body
Date: Sat, 27 Apr 2024 08:10:47 -0500
In-reply-to: <867cgl1la9.fsf@HIDDEN>
Message-ID: <875xw2et3e.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 70345
Cc: dmitry@HIDDEN, 70345 <at> debbugs.gnu.org, theo@HIDDEN,
 Jacob Leeming <jacobtophatleeming@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--=-=-=
Content-Type: text/plain

Eli Zaretskii <eliz@HIDDEN> writes:

>> Cc: 70345 <at> debbugs.gnu.org, Jacob Leeming <jacobtophatleeming@HIDDEN>
>> From: Jacob Leeming <jacobtophatleeming@HIDDEN>
>> Date: Mon, 22 Apr 2024 09:50:23 +0100
>> 
>> > Looks good to me. Are you willing to pack this up with a nice test
>> > confirming the behavior?
>> >
>> > All the best,
>> > Theo
>> 
>> Thanks all,
>> 
>> Discovered we had a similar issue for else blocks. Wrote a test that
>> covers both cases.
>> 
>> See the attached diff which contains my changes to the indent rules and
>> the test.
>
> Thanks, I installed this on the emacs-29 branch.  (The test you added
> should have been added to csharp-mode-tests.el, since our test files
> follow the names of the implementation files, and csharp-ts-mode is
> implemented in csharp-mode.el.  I fixed that.)

The test should check that the c-sharp grammar is available so
that it gets marked as skipped instead of failed.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Skip-csharp-ts-mode-test-if-grammar-is-missing.patch

From 068cad8612c31cea41f0cc21a865efe0785d4e7a Mon Sep 17 00:00:00 2001
From: john muhl <jm@HIDDEN>
Date: Sat, 27 Apr 2024 09:55:42 -0500
Subject: [PATCH] ; Skip 'csharp-ts-mode' test if grammar is missing

* test/lisp/progmodes/csharp-mode-tests.el
(csharp-ts-mode-test-indentation): Skip test instead of failing.
---
 test/lisp/progmodes/csharp-mode-tests.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/test/lisp/progmodes/csharp-mode-tests.el b/test/lisp/progmodes/csharp-mode-tests.el
index 2878fa601f2..b3c57a7026b 100644
--- a/test/lisp/progmodes/csharp-mode-tests.el
+++ b/test/lisp/progmodes/csharp-mode-tests.el
@@ -27,6 +27,7 @@ csharp-mode-test-indentation
   (ert-test-erts-file (ert-resource-file "indent.erts")))
 
 (ert-deftest csharp-ts-mode-test-indentation ()
+  (skip-unless (treesit-ready-p 'c-sharp))
   (ert-test-erts-file (ert-resource-file "indent-ts.erts")))
 
 (provide 'csharp-mode-tests)
-- 
2.41.0


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70345; Package emacs. Full text available.

Message received at 70345 <at> debbugs.gnu.org:


Received: (at 70345) by debbugs.gnu.org; 26 Apr 2024 15:24:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 26 11:24:38 2024
Received: from localhost ([127.0.0.1]:38226 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s0NRF-0008C0-G2
	for submit <at> debbugs.gnu.org; Fri, 26 Apr 2024 11:24:38 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:53968)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1s0NRC-0008AM-Ge
 for 70345 <at> debbugs.gnu.org; Fri, 26 Apr 2024 11:24:35 -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 <eliz@HIDDEN>)
 id 1s0NQo-0008O8-Mx; Fri, 26 Apr 2024 11:24:10 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=FOsbcoA8rYDbBJZDC702hC6GHPcJEkLvPwlNojYEPaU=; b=O4yOAfdu7j39
 1DcSvN/JafUdNdb1iMKLiT2j87mYsetqgRa7Gn1ey0lZkOyrVFscFxd3JGTmM69kwgy4bHSWrGrxN
 QKp7RgUmnlHMWz9DUAMWY4mHbciJ8boeI5cmClVrY3r6GwfGp2TAGLZpjxscqqzlVSWuqSxU/6JX2
 NP/Jf1Q7utlVjVIOJMHsq2TbG7XxMDJzTTgD+r53dmK6vgTkZnS5l32c5LhYAY6NiW6sEJU+MTmeo
 p2abpBqo+IJl9MiKEkc62hKS3r87bWNsng3YFb0mpFrrk3lZ/kdpWhzZE2KiYxfY6YUMBlVuA9iEI
 hgLFVQ71gGp6Wb443Xj8zg==;
Date: Fri, 26 Apr 2024 18:24:07 +0300
Message-Id: <86ttjoxi3s.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Jacob Leeming <jacobtophatleeming@HIDDEN>
In-Reply-To: <8734r8xman.fsf@HIDDEN> (message from Jacob Leeming on Fri, 26
 Apr 2024 14:53:36 +0100)
Subject: Re: bug#70345: [PATCH] 29.1.50; csharp-ts-mode indentation of if
 statements with single-statement body
References: <87o7afod31.fsf@HIDDEN> <87mspusb5k.fsf@HIDDEN>
 <87wmopaii8.fsf@HIDDEN> <867cgl1la9.fsf@HIDDEN> <8734r8xman.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70345
Cc: 70345 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Jacob Leeming <jacobtophatleeming@HIDDEN>
> Cc: 70345 <at> debbugs.gnu.org
> Date: Fri, 26 Apr 2024 14:53:36 +0100
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > With this changeset you have exhausted the amount of changes that we
> > can accept from you without copyright assignment.  Would you like to
> > start the paperwork of assigning the copyright at this time, so that
> > we could accept your contributions in the future without limitations?
> > If yes, I will send you the form to fill and the instructions to send
> > the form.
> >
> > I'm closing this bug.
> 
> Thanks Eli,
> 
> Please send the paperwork! I'll get it filled in and sent off when
> possible.

Thanks, form sent off-list.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70345; Package emacs. Full text available.

Message received at 70345 <at> debbugs.gnu.org:


Received: (at 70345) by debbugs.gnu.org; 26 Apr 2024 13:54:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 26 09:54:17 2024
Received: from localhost ([127.0.0.1]:34408 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s0M1h-0005wd-KV
	for submit <at> debbugs.gnu.org; Fri, 26 Apr 2024 09:54:16 -0400
Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]:55380)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jacobtophatleeming@HIDDEN>) id 1s0M1a-0005uV-5L
 for 70345 <at> debbugs.gnu.org; Fri, 26 Apr 2024 09:54:06 -0400
Received: by mail-ej1-x635.google.com with SMTP id
 a640c23a62f3a-a55b3d57277so272907966b.2
 for <70345 <at> debbugs.gnu.org>; Fri, 26 Apr 2024 06:53:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1714139618; x=1714744418; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=dXFOGPNgVv9V4pgx9SeMhZOq89sAsW9V1qpanw+FzAY=;
 b=kwDijHb/tQXvb1jemgUt/E4gIUTm144uE6aurqUBDt1JTFEFarlvvabyjYv/OfpDOk
 r0HV/VYPmw3S2g9kXGghU7wqR+0EZ+3S1XAfVxuIei/iKvwyLb9ZIipcxhM4DgKHzgXo
 bHy2bbsLWeTzRs6eo0tR845enCtRFQNn1ammwZAfUE26vAty000TO9/QzCmwqPKcV9Ki
 qLivqxy6Gp763HzlemqQno9b8OxxU3JwR5D3APXlU8JyIB+qwMJkppeSGc9s6RoDyA38
 5x6JQyNlcOmHxjVKR1Pf00GTdlBdiCnA6DmypYAIMdBzaMUZVFIFnFAlpNFAoXO2+2X4
 8itw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1714139618; x=1714744418;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=dXFOGPNgVv9V4pgx9SeMhZOq89sAsW9V1qpanw+FzAY=;
 b=muYeIO/t5aeppzmzau+eruiSJg3DMZwVyJXnpKwJCFczBhhicPQn1GFZIRQtesC5BW
 2Ko7xUYzajtWIHwpx5rDCR5SnWhmuUiojbAK8LCh7Yvi3m2mWuQXvDLpReVqgmVeW4aw
 AhQwJZKmtNy2c2x9vrCP9K7BVb8ogoz277pfcRexejfych87aXDAfYDEGym8xnZb2GWC
 r+YfPDaWCU7hUFCx9DXIOdP+JG26a/aDYtcl5D4tBr0eTMmqSg1PpEWMVPx9UomczplH
 E5FDCKhHXDuGT2ZiTDTcmRj3EhfsHWbczUEdK+SJVD+SgADUiP9OkN5xpgEPhh8A5D8N
 V72A==
X-Gm-Message-State: AOJu0Yx5NaXy5mpNT8bo8ibmJah8VBpckQmyPOkh/mOioPfGT47FbO3S
 HFDUGgs7h7N3THHYH7gClLjo4MwgcCmz0g6nYMjocDdREhCMtNccP4q5pw==
X-Google-Smtp-Source: AGHT+IFFViuXJDaL+nd6gogkdngfyHApFOOfknCqvq01mGvebfDyhkaLLnm2fL+VxT8T3Lcr+xMoeA==
X-Received: by 2002:a17:906:a152:b0:a51:c88e:e95a with SMTP id
 bu18-20020a170906a15200b00a51c88ee95amr2036945ejb.23.1714139617606; 
 Fri, 26 Apr 2024 06:53:37 -0700 (PDT)
Received: from jacobDebianWorkLaptop ([154.51.68.114])
 by smtp.gmail.com with ESMTPSA id
 i9-20020a170906090900b00a55b05c4598sm6618074ejd.133.2024.04.26.06.53.36
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 26 Apr 2024 06:53:37 -0700 (PDT)
From: Jacob Leeming <jacobtophatleeming@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#70345: [PATCH] 29.1.50; csharp-ts-mode indentation of if
 statements with single-statement body
In-Reply-To: <867cgl1la9.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 25 Apr
 2024 19:04:14 +0300")
References: <87o7afod31.fsf@HIDDEN> <87mspusb5k.fsf@HIDDEN>
 <87wmopaii8.fsf@HIDDEN> <867cgl1la9.fsf@HIDDEN>
Date: Fri, 26 Apr 2024 14:53:36 +0100
Message-ID: <8734r8xman.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70345
Cc: 70345 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> Cc: 70345 <at> debbugs.gnu.org, Jacob Leeming <jacobtophatleeming@HIDDEN>
>> From: Jacob Leeming <jacobtophatleeming@HIDDEN>
>> Date: Mon, 22 Apr 2024 09:50:23 +0100
>> 
>> > Looks good to me. Are you willing to pack this up with a nice test
>> > confirming the behavior?
>> >
>> > All the best,
>> > Theo
>> 
>> Thanks all,
>> 
>> Discovered we had a similar issue for else blocks. Wrote a test that
>> covers both cases.
>> 
>> See the attached diff which contains my changes to the indent rules and
>> the test.
>
> Thanks, I installed this on the emacs-29 branch.  (The test you added
> should have been added to csharp-mode-tests.el, since our test files
> follow the names of the implementation files, and csharp-ts-mode is
> implemented in csharp-mode.el.  I fixed that.)
>
> With this changeset you have exhausted the amount of changes that we
> can accept from you without copyright assignment.  Would you like to
> start the paperwork of assigning the copyright at this time, so that
> we could accept your contributions in the future without limitations?
> If yes, I will send you the form to fill and the instructions to send
> the form.
>
> I'm closing this bug.

Thanks Eli,

Please send the paperwork! I'll get it filled in and sent off when
possible. If I have future questions about the paperwork, is it best to
use the emacs devel mailing list?

Cheers,
Jacob




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70345; Package emacs. Full text available.

Message received at 70345-done <at> debbugs.gnu.org:


Received: (at 70345-done) by debbugs.gnu.org; 25 Apr 2024 16:05:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 25 12:05:01 2024
Received: from localhost ([127.0.0.1]:33151 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s01aj-0008Qm-H4
	for submit <at> debbugs.gnu.org; Thu, 25 Apr 2024 12:05:01 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:51870)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1s01ac-0008Nk-L5
 for 70345-done <at> debbugs.gnu.org; Thu, 25 Apr 2024 12:04:54 -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 <eliz@HIDDEN>)
 id 1s01aF-00059l-3r; Thu, 25 Apr 2024 12:04:27 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=ITrOKHNPSd63cWNSLMFJrpVyg/t0gFWlLXsg8vLQWag=; b=Yp+qerLaoPJU
 a3fE6S7OaZIARk1Unm9lZ/iAKOTnsR5igkVjOxOMw48YkOD+rOBaYhmo7jIgViM740AUCUgUSA7ch
 Tqc/uhb2LDTRI52vz8iCDNO/jbBn2BkbPZcMhpqV4bGI+h6iXDii4a93zbsxjFq7DHMaz7zXcvQG3
 kjq3P+z0Cl1+GJ3NlOil0sq+98vTcmdjnade2zAKf/c4Gb8QSREkRYz0Od4y/YUO94Y2uPnXiKlPH
 2nvzT5qKkXoQh3VujnoxeVJsw8wxRgmTR1zZomM5UoOikqVgVPaCrMDVz0n8xCFxgepJmdFVqVJQ4
 2x6/ut3faHNVrBs1pBkZkA==;
Date: Thu, 25 Apr 2024 19:04:14 +0300
Message-Id: <867cgl1la9.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Jacob Leeming <jacobtophatleeming@HIDDEN>
In-Reply-To: <87wmopaii8.fsf@HIDDEN> (message from Jacob Leeming on Mon, 22
 Apr 2024 09:50:23 +0100)
Subject: Re: bug#70345: [PATCH] 29.1.50;
 csharp-ts-mode indentation of if statements with single-statement body
References: <87o7afod31.fsf@HIDDEN> <87mspusb5k.fsf@HIDDEN>
 <87wmopaii8.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70345-done
Cc: dmitry@HIDDEN, 70345-done <at> debbugs.gnu.org, theo@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: 70345 <at> debbugs.gnu.org, Jacob Leeming <jacobtophatleeming@HIDDEN>
> From: Jacob Leeming <jacobtophatleeming@HIDDEN>
> Date: Mon, 22 Apr 2024 09:50:23 +0100
> 
> > Looks good to me. Are you willing to pack this up with a nice test
> > confirming the behavior?
> >
> > All the best,
> > Theo
> 
> Thanks all,
> 
> Discovered we had a similar issue for else blocks. Wrote a test that
> covers both cases.
> 
> See the attached diff which contains my changes to the indent rules and
> the test.

Thanks, I installed this on the emacs-29 branch.  (The test you added
should have been added to csharp-mode-tests.el, since our test files
follow the names of the implementation files, and csharp-ts-mode is
implemented in csharp-mode.el.  I fixed that.)

With this changeset you have exhausted the amount of changes that we
can accept from you without copyright assignment.  Would you like to
start the paperwork of assigning the copyright at this time, so that
we could accept your contributions in the future without limitations?
If yes, I will send you the form to fill and the instructions to send
the form.

I'm closing this bug.




Notification sent to Jacob Leeming <jacobtophatleeming@HIDDEN>:
bug acknowledged by developer. Full text available.
Reply sent to Eli Zaretskii <eliz@HIDDEN>:
You have taken responsibility. Full text available.

Message received at 70345 <at> debbugs.gnu.org:


Received: (at 70345) by debbugs.gnu.org; 22 Apr 2024 08:50:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 04:50:56 2024
Received: from localhost ([127.0.0.1]:45652 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rypO2-00043r-GN
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2024 04:50:56 -0400
Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]:60464)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jacobtophatleeming@HIDDEN>) id 1rypNw-00042W-Ex
 for 70345 <at> debbugs.gnu.org; Mon, 22 Apr 2024 04:50:52 -0400
Received: by mail-lj1-x22c.google.com with SMTP id
 38308e7fff4ca-2d895e2c6efso62284521fa.0
 for <70345 <at> debbugs.gnu.org>; Mon, 22 Apr 2024 01:50:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1713775826; x=1714380626; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=WAP/Zck6DTQ2SnyqQq8n2uhWW53ahpQWNI2vrmVCI5Y=;
 b=Z/i6+21yPizOgp1MEpw1TX9oRopfi17W/hYvJYoeuqpLiWlTWwb7yNXcYN5QBTj7Bu
 7+3x+qBoB2aZV6I+gBl1K0FJBBCNKjrV36FCQ/AIKLInr9tOG63CwOKLOzBUJgA25k05
 w0GsTHBPywhW8Sms99hXa+xhiV/rwPsnjrsx7WHDxnHhjSeajKtxjmJQ3Yjx9UkCB+5n
 vGqIBWdhfQv7KgNAzTpc3ck3FYsi8wrbCCZIuoSeBA4ZsG7S39uLb/Xt/XLlWjuSrHNB
 MqqIQFz2CjSHTzoAHII12XFNwwsqOhnoXqjT2x9jMTpU4196RUrRiKwPTZUHLUZ9jZ6P
 bhaQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1713775826; x=1714380626;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=WAP/Zck6DTQ2SnyqQq8n2uhWW53ahpQWNI2vrmVCI5Y=;
 b=XNZxv1iYV+i0S3XVsgNKKaKkRBQy9ObGU5OTVexR67ZH1SPx4Q76oKZwFnTiiaAr1y
 oY0QER9iPqJ+EPbFrt4R3rlQej4Rfl51QbgNBJ8nd50zZcJTQWpgug1YjI6lzWn9c88V
 kPX7pzst03XiwaD0YYG0JolyZJx8H1Dd7SXu+vV5QEY0U6+G3UYLx0ZcKofQ0rc5kfcR
 4eqDyXcEg/63kLWQ3lbm+EqzRqDLU4WXoIEnPgf4MOsabGv4KBfn0Qzk4J/f7kQ0m2V9
 oMI2T/ib8IH/RUuf0HWn76kzQbh8CidNWQIcj1tUGvC8k4+eW7NZrhtylUscS6au3uqM
 UjdQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCUr581JLK4vPS6wb4LvkHB2KDpe4ialeOMDQkbZoeVapuIG/b0K0fuT1rsiNmDGYDCfM5pinm7TN+L06rrzam7+hM3A1t4=
X-Gm-Message-State: AOJu0Yyw5wDb4oB7mvgaO+FOM8kJwW5ZnAAlgzCNKMRPtniT9BMcwzFS
 gYY4bwDZVQ0a7RUe1WyWn4fYroEjdRVQpmMElknWuNmoFXO+wYV6OVEUDeCe
X-Google-Smtp-Source: AGHT+IHnb+9uPM/s9HfUjlXSWTN6JKV7aQvDXEVbHHzz/94C1kbPX812V1wuDFybYAvoh/EzRWzPXA==
X-Received: by 2002:a2e:93c7:0:b0:2dd:9d77:bd60 with SMTP id
 p7-20020a2e93c7000000b002dd9d77bd60mr938587ljh.52.1713775825873; 
 Mon, 22 Apr 2024 01:50:25 -0700 (PDT)
Received: from jacobDebianWorkLaptop ([2a00:23c7:238a:701:c982:ec15:697:6050])
 by smtp.gmail.com with ESMTPSA id
 n2-20020a05600c4f8200b0041884b79b81sm15833640wmq.1.2024.04.22.01.50.24
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 22 Apr 2024 01:50:25 -0700 (PDT)
From: Jacob Leeming <jacobtophatleeming@HIDDEN>
To: Theodor Thornhill <theo@HIDDEN>, Dmitry Gutov <dmitry@HIDDEN>
Subject: Re: bug#70345: [PATCH] 29.1.50; csharp-ts-mode indentation of if
 statements with single-statement body
In-Reply-To: <87mspusb5k.fsf@HIDDEN> (Theodor Thornhill's message of
 "Mon, 15 Apr 2024 21:01:27 +0200")
References: <87o7afod31.fsf@HIDDEN> <87mspusb5k.fsf@HIDDEN>
Date: Mon, 22 Apr 2024 09:50:23 +0100
Message-ID: <87wmopaii8.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70345
Cc: 70345 <at> debbugs.gnu.org, Jacob Leeming <jacobtophatleeming@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

> Theodor Thornhill <theo@HIDDEN> writes:

>> Hi all,
>>
>
> Hi, Jacob!
>
>>>From emacs -Q:
>>
>> Evaluate this elisp to set up treesitter for csharp:
>>
>> (setq treesit-language-source-alist '((c-sharp
>> "https://github.com/tree-sitter/tree-sitter-c-sharp" "master" "src"))
>>       treesit-load-name-override-list '((c-sharp
>> "libtree-sitter-csharp" "tree_sitter_c_sharp"))
>>       major-mode-remap-alist '((csharp-mode . csharp-ts-mode)))
>>
>> Insert the following text into a csharp-ts-mode buffer:
>>
>> if (true)
>> var x = 2;
>>
>> Try to indent the variable declaration of the function with
>> indent-for-tab-command. Nothing will happen. I'd expect to see this:
>>
>> if (true)
>>     var x = 2;
>>
>> This issue can be fixed with the following patch:
>>
>> diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el
>> index 53c52e6..1a7d535 100644
>> --- a/lisp/progmodes/csharp-mode.el
>> +++ b/lisp/progmodes/csharp-mode.el
>> @@ -678,7 +678,8 @@ csharp-ts-mode--indent-rules
>>       ((parent-is "binary_expression") parent 0)
>>       ((parent-is "block") parent-bol csharp-ts-mode-indent-offset)
>>       ((parent-is "local_function_statement") parent-bol 0)
>> -     ((parent-is "if_statement") parent-bol 0)
>> +     ((match "block" "if_statement") parent-bol 0)
>> +     ((parent-is "if_statement") parent-bol csharp-ts-mode-indent-offset)
>>       ((parent-is "for_statement") parent-bol 0)
>>       ((parent-is "for_each_statement") parent-bol 0)
>>       ((parent-is "while_statement") parent-bol 0)
>>
>
> Looks good to me. Are you willing to pack this up with a nice test
> confirming the behavior?
>
> All the best,
> Theo

Thanks all,

Discovered we had a similar issue for else blocks. Wrote a test that
covers both cases.

See the attached diff which contains my changes to the indent rules and
the test.

Cheers,
Jacob


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0001-indent-single-statement-if-in-csharp-ts-mode.patch

From cd86e2e3fbe596b999f4cfd9655f0a37ac3845d2 Mon Sep 17 00:00:00 2001
From: Jacob Leeming <jacobtophatleeming@HIDDEN>
Date: Mon, 22 Apr 2024 09:49:15 +0100
Subject: [PATCH] indent single statement if in csharp-ts-mode

bug#70345
---
 lisp/progmodes/csharp-mode.el                 |  4 +-
 .../csharp-ts-mode-resources/indent.erts      | 51 +++++++++++++++++++
 test/lisp/progmodes/csharp-ts-mode-tests.el   | 30 +++++++++++
 3 files changed, 84 insertions(+), 1 deletion(-)
 create mode 100644 test/lisp/progmodes/csharp-ts-mode-resources/indent.erts
 create mode 100644 test/lisp/progmodes/csharp-ts-mode-tests.el

diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el
index 607360f737a..62bbbfe02ff 100644
--- a/lisp/progmodes/csharp-mode.el
+++ b/lisp/progmodes/csharp-mode.el
@@ -689,7 +689,9 @@ csharp-ts-mode--indent-rules
      ((parent-is "binary_expression") parent 0)
      ((parent-is "block") parent-bol csharp-ts-mode-indent-offset)
      ((parent-is "local_function_statement") parent-bol 0)
-     ((parent-is "if_statement") parent-bol 0)
+     ((match "block" "if_statement") parent-bol 0)
+     ((match "else" "if_statement") parent-bol 0)
+     ((parent-is "if_statement") parent-bol csharp-ts-mode-indent-offset)
      ((parent-is "for_statement") parent-bol 0)
      ((parent-is "for_each_statement") parent-bol 0)
      ((parent-is "while_statement") parent-bol 0)
diff --git a/test/lisp/progmodes/csharp-ts-mode-resources/indent.erts b/test/lisp/progmodes/csharp-ts-mode-resources/indent.erts
new file mode 100644
index 00000000000..3cb23608270
--- /dev/null
+++ b/test/lisp/progmodes/csharp-ts-mode-resources/indent.erts
@@ -0,0 +1,51 @@
+Code:
+  (lambda ()
+    (csharp-ts-mode)
+    (indent-region (point-min) (point-max)))
+
+Point-Char: |
+
+Name: Indent single statement body for if/else. (bug#70345)
+
+=-=
+
+int x;
+int y;
+
+if (true)
+    x = 2;
+
+if (true)
+{
+    x = 2;
+}
+
+if (true)
+    x = 2;
+else
+    y = 2;
+
+if (true)
+{
+    x = 2;
+}
+else
+{
+    y = 2;
+}
+
+if (true)
+    x = 2;
+else
+{
+    y = 2;
+}
+
+if (true)
+{
+    x = 2;
+}
+else
+    y = 2;
+
+=-=-=
diff --git a/test/lisp/progmodes/csharp-ts-mode-tests.el b/test/lisp/progmodes/csharp-ts-mode-tests.el
new file mode 100644
index 00000000000..0df0211d86b
--- /dev/null
+++ b/test/lisp/progmodes/csharp-ts-mode-tests.el
@@ -0,0 +1,30 @@
+;;; csharp-ts-mode-tests.el --- Tests for Tree-sitter-based C# mode  -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2024 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(require 'ert)
+(require 'ert-x)
+(require 'csharp-mode)
+
+(ert-deftest csharp-ts-mode-test-indentation ()
+  (ert-test-erts-file (ert-resource-file "indent.erts")))
+
+(provide 'csharp-ts-mode-tests)
+;;; csharp-ts-mode-tests.el ends here
-- 
2.39.2


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70345; Package emacs. Full text available.

Message received at 70345 <at> debbugs.gnu.org:


Received: (at 70345) by debbugs.gnu.org; 16 Apr 2024 00:28:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 15 20:28:00 2024
Received: from localhost ([127.0.0.1]:40513 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rwWg2-00059G-I9
	for submit <at> debbugs.gnu.org; Mon, 15 Apr 2024 20:27:59 -0400
Received: from wfout2-smtp.messagingengine.com ([64.147.123.145]:49983)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dmitry@HIDDEN>) id 1rwWfy-00057q-Vm
 for 70345 <at> debbugs.gnu.org; Mon, 15 Apr 2024 20:27:56 -0400
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
 by mailfout.west.internal (Postfix) with ESMTP id BDCDF1C0013D;
 Mon, 15 Apr 2024 20:27:36 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute5.internal (MEProxy); Mon, 15 Apr 2024 20:27:37 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc
 :cc:content-transfer-encoding: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=fm1; t=1713227256;
 x=1713313656; bh=oNIM9OmAFkFaqw2aAg6GRt3zsJ8H0KMRiPgAOn8mqWg=; b=
 WzmRsnPuDtsEbxwa0YIRgoKgwRSsWzm16kOQ0/qc+pZ2eX6gCWTT5Se97cNHy1dA
 zByutlvDgidYnkpAfrO9eYySAYtQOXAeIcLQGhAMhRC554US9RVq025xlNpnHBwA
 VDtrwdtcbWGAenD2+oKp7OJn/sLHHUoW6m0pfIiveChuKgPRvH7CddLpWKqf4coQ
 eiIUQ0ihMLqG1lyY+6AooXEixw3Ut2mPWugEAnP68qLnErn+Q1KYRmP3uq8aLUJA
 h/O7Z/zHz8TfkFgkbThzmyiXwOeaMfJssAZllRBRi4aoyzYp/p16fvoFsK9HW0d5
 mVnp6U2d1gJ4/OHFmkiHkg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :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-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1713227256; x=
 1713313656; bh=oNIM9OmAFkFaqw2aAg6GRt3zsJ8H0KMRiPgAOn8mqWg=; b=C
 IthkaQScGXNC3f4QwID1lmcuKrjMT6+8aA57MnWuXimGW8WfkUcSgjT3CQ112y7q
 q6ASr8Xx1rIIQ4K+/sIuj1yFZrZnNUhGnRmY2Kf4HJtZMYNuCxh1f10KwOptdr+H
 SYRGDTammlMm6Duuw2sor/4Ftk+bhb38EfhhoyS3IafCoIlz6dZjagBgKqr/YhmP
 4amnVBXhew7rSAFD28ZqETidKGpbfHi+su0R+9CHXzvchX6vd2mqQs/2PS/++ewn
 XyaUdOIf5hD4uMWjNbcEYu8PgYHitmVCxutP8Ky6FXbMsY90+k/q5D1EPbBRhPwq
 hjAZWh+uBi0F9Mt17iwug==
X-ME-Sender: <xms:-MUdZvXCt2G5IMhNT3DYEG3JXbUSt3wl2uVfL2V40GW6nFUISO2_Bw>
 <xme:-MUdZnk8OCxDBu5ft9Tpzf1XTj5hu7Ljr-6FzIDc8eEwwuwSyUfNGujhNLpAc3PGN
 L058Tv5htUzcG3Ed1o>
X-ME-Received: <xmr:-MUdZrbNMv9HNkCAQHBG1-lpLCOuoLxUz5cyC-KoGQIZ07x1y9Mw_DivXJgQzd0zhP8A>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudejfedgfeegucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhi
 thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth
 htvghrnhepteduleejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedu
 jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug
 hmihhtrhihsehguhhtohhvrdguvghv
X-ME-Proxy: <xmx:-MUdZqWGHgqgCOW2rr23-seyS8tuUi-DLlRGnQ-2edWB9B_9KwGgAw>
 <xmx:-MUdZplWVy5t9H6rLU3qP4nfiNF765fA9oArWFdeQ93s7aQOrPCVHw>
 <xmx:-MUdZnfx7zaMpQgRTDhZhkBwiFT2pYU5cBTx7cCJzGHeWxEYef6LoA>
 <xmx:-MUdZjFLbDWLAo8BNYKL49wwMHd8CCRW_9FmFWsCzyPymmY5vRMe5A>
 <xmx:-MUdZvhuwtBgqQtogjzXKhQWfG2vsFQxlUdMGQ3AmVijAohoEiG0KYhl>
Feedback-ID: i0e71465a:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
 15 Apr 2024 20:27:34 -0400 (EDT)
Message-ID: <51e75fa0-c392-4d6a-b7ab-3355af4a2053@HIDDEN>
Date: Tue, 16 Apr 2024 03:27:33 +0300
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#70345: [PATCH] 29.1.50; csharp-ts-mode indentation of if
 statements with single-statement body
To: Jacob Leeming <jacobtophatleeming@HIDDEN>,
 Theodor Thornhill <theo@HIDDEN>
References: <87o7afod31.fsf@HIDDEN> <87mspusb5k.fsf@HIDDEN>
 <8734rmnqkd.fsf@HIDDEN>
Content-Language: en-US
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <8734rmnqkd.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70345
Cc: 70345 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 16/04/2024 00:38, Jacob Leeming wrote:
> I'm willing, where can I find other tests for csharp-ts-mode? Had a
> quick look round the emacs repo but could not find any.

Check out

test/lisp/progmodes/csharp-mode-resources/indent.erts
and
test/lisp/progmodes/csharp-mode-tests.el

These are for csharp-mode (non tree-sitter version), so you'll basically 
need to make a copy of the latter to run the counterpart for the former.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70345; Package emacs. Full text available.

Message received at 70345 <at> debbugs.gnu.org:


Received: (at 70345) by debbugs.gnu.org; 15 Apr 2024 23:40:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 15 19:40:10 2024
Received: from localhost ([127.0.0.1]:40318 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rwVvl-0006tc-KZ
	for submit <at> debbugs.gnu.org; Mon, 15 Apr 2024 19:40:09 -0400
Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:42478)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jacobtophatleeming@HIDDEN>) id 1rwVvj-0006s5-9Q
 for 70345 <at> debbugs.gnu.org; Mon, 15 Apr 2024 19:40:08 -0400
Received: by mail-wm1-x32e.google.com with SMTP id
 5b1f17b1804b1-4187991d01bso6528225e9.1
 for <70345 <at> debbugs.gnu.org>; Mon, 15 Apr 2024 16:39:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1713224388; x=1713829188; darn=debbugs.gnu.org;
 h=mime-version:message-id:cc:user-agent:references:lines:date
 :in-reply-to:subject:to:from:from:to:cc:subject:date:message-id
 :reply-to; bh=BigdgMX3GDgZM/dBpwETeciIJslcUVwj1JOba7dMq88=;
 b=Nc45PSgd3cgn22i/vuADuWCtFZ3pNXDj59ZFfTImgSa4xQuRrQW06SJXTee9zskt6y
 XRien8DXYQe4L0s8Ux+Ajxmo0TEG9UfnVoWdL3IL0pArzOYoAfwXv6jmLPFxIjkbV4N4
 f71ciqY0TM9S7VywpAbagihzcLRlayBiiZc2i1SL5F8nf0IWElrpjtGzVzZMuPR/4y/b
 xxKXidp214qTzcUW7JnSkZw8Qh/Y/QfYWrSXuOgqDEKL0Ofxhnn3my8fCu9FhRG65sCp
 V98WLi/yeyS6NZRejaG9GFOAel+m/iUAoHc+wQHNp4gQhq3ivDfPFqAlFrgPc//JcJwB
 zwMw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1713224388; x=1713829188;
 h=mime-version:message-id:cc:user-agent:references:lines:date
 :in-reply-to:subject:to:from:x-gm-message-state:from:to:cc:subject
 :date:message-id:reply-to;
 bh=BigdgMX3GDgZM/dBpwETeciIJslcUVwj1JOba7dMq88=;
 b=fckivR/nL9VSVGLvneKmJ6V4BvHtngSn2aid5Gtwr0CxwepDkgkhvfbNKQYAVkgf63
 nQ6MNWBcY6b5eKUWKWxoOTDb/axlCfc0jnORISQUKCqljLsWVc/Q1idaed4SANWjja6y
 umHcNn6n3h+ObqcTiYmdBKNpX7zci+ij2Zic9H1ps+LjCdDPLhfUjDW46JCZmhpFpKuJ
 Kg2Ok5eoA3zbJHzo2rMszjSj8r7f2t279cfJ6bkT2ITlDf5esjsgsDXQh7gmxW4FdFnU
 ghgR2p1IfmI0SYU84IPmBekH6ShgiNMfznBuGfmyhIKBM68khMznEzqmao0Z9AYc9e/T
 jyGg==
X-Gm-Message-State: AOJu0YzDyWwVDYrPLVWsAVzdonYI1JJQeGpqAT1DDzQ9Nq89MF8Rgbxj
 YNb/tpbBBHXD3dsS2swzEh9YUd4aZP7jX8R3uwrwxa05enlNIHC7RW0fyA==
X-Google-Smtp-Source: AGHT+IH+z93R/OeQdvjbdRP7N+TcjpftdFNz7Jcz+j19TRVN3sDLo0irBBqqHieiCG5qsSbXLmIxsw==
X-Received: by 2002:a7b:c3d6:0:b0:418:91ae:befc with SMTP id
 t22-20020a7bc3d6000000b0041891aebefcmr220111wmj.0.1713224388210; 
 Mon, 15 Apr 2024 16:39:48 -0700 (PDT)
Received: from jacobDebianWorkLaptop ([2a00:23c7:238a:701:ff8a:6fe9:c7f8:fb19])
 by smtp.gmail.com with ESMTPSA id
 m2-20020a05600c4f4200b0041892c774bcsm296377wmq.2.2024.04.15.16.39.47
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 15 Apr 2024 16:39:47 -0700 (PDT)
From: Jacob Leeming <jacobtophatleeming@HIDDEN>
To: Theodor Thornhill <theo@HIDDEN>
Subject: Re: bug#70345: [PATCH] 29.1.50; csharp-ts-mode indentation of if
 statements with single-statement body
In-Reply-To: <87mspusb5k.fsf@HIDDEN> (Theodor Thornhill's message of
 "Mon, 15 Apr 2024 21:01:27 +0200")
Date: Mon, 15 Apr 2024 22:38:00 +0100
Lines: 57
References: <87o7afod31.fsf@HIDDEN> <87mspusb5k.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
X-From-Line: nobody Mon Apr 15 22:38:02 2024
Message-ID: <8734rmnqkd.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70345
Cc: 70345 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Theodor Thornhill <theo@HIDDEN> writes:

>> Hi all,
>>
>
> Hi, Jacob!
>
>>From emacs -Q:
>>
>> Evaluate this elisp to set up treesitter for csharp:
>>
>> (setq treesit-language-source-alist '((c-sharp
>> "https://github.com/tree-sitter/tree-sitter-c-sharp" "master" "src"))
>>       treesit-load-name-override-list '((c-sharp
>> "libtree-sitter-csharp" "tree_sitter_c_sharp"))
>>       major-mode-remap-alist '((csharp-mode . csharp-ts-mode)))
>>
>> Insert the following text into a csharp-ts-mode buffer:
>>
>> if (true)
>> var x = 2;
>>
>> Try to indent the variable declaration of the function with
>> indent-for-tab-command. Nothing will happen. I'd expect to see this:
>>
>> if (true)
>>     var x = 2;
>>
>> This issue can be fixed with the following patch:
>>
>> diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el
>> index 53c52e6..1a7d535 100644
>> --- a/lisp/progmodes/csharp-mode.el
>> +++ b/lisp/progmodes/csharp-mode.el
>> @@ -678,7 +678,8 @@ csharp-ts-mode--indent-rules
>>       ((parent-is "binary_expression") parent 0)
>>       ((parent-is "block") parent-bol csharp-ts-mode-indent-offset)
>>       ((parent-is "local_function_statement") parent-bol 0)
>> -     ((parent-is "if_statement") parent-bol 0)
>> +     ((match "block" "if_statement") parent-bol 0)
>> +     ((parent-is "if_statement") parent-bol csharp-ts-mode-indent-offset)
>>       ((parent-is "for_statement") parent-bol 0)
>>       ((parent-is "for_each_statement") parent-bol 0)
>>       ((parent-is "while_statement") parent-bol 0)
>>
>
> Looks good to me. Are you willing to pack this up with a nice test
> confirming the behavior?
>
> All the best,
> Theo

I'm willing, where can I find other tests for csharp-ts-mode? Had a
quick look round the emacs repo but could not find any.

Cheers,
Jacob




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70345; Package emacs. Full text available.

Message received at 70345 <at> debbugs.gnu.org:


Received: (at 70345) by debbugs.gnu.org; 15 Apr 2024 19:01:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 15 15:01:56 2024
Received: from localhost ([127.0.0.1]:39026 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rwRaV-0000ww-1p
	for submit <at> debbugs.gnu.org; Mon, 15 Apr 2024 15:01:56 -0400
Received: from out-189.mta0.migadu.com ([91.218.175.189]:58240)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <theo@HIDDEN>) id 1rwRaP-0000oK-4c
 for 70345 <at> debbugs.gnu.org; Mon, 15 Apr 2024 15:01:51 -0400
X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and
 include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no;
 s=key1; t=1713207690;
 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=DVZJbvniHwjXDMDpcuvvBJTLiG4xFPrQ28Tq213NipY=;
 b=svLOInecFXTLlB0MABMkAe0tIGS5JGzVSdaqEmSNmck9DjrmT9fmXQyJgPBIIcb7aAH/Ze
 1MBv984UKrgLia1Vt4i8kQayVahwkiAlge/qyu20/9B9oMYbPQfsVcy73K8JKjRUJm9Mta
 Ixk+CqMDZ+AAVghDJ8K+D+EURPPeLNgp8ck2SblSYl3qCoyf3/eGhVBLKvP4EBKgees7nd
 592wdrUEDwcdEXkB1znGs8UBPxdtXm0ust8IQB/CXvL+7StmsYM/bS6q9J9Zpt8kiR6hBr
 Av+j7vyGzA1CWPFFLa1/45sGirPabiyzfPs5uGD75j27WNmmZHypR3JWpFTEDg==
From: Theodor Thornhill <theo@HIDDEN>
To: Jacob Leeming <jacobtophatleeming@HIDDEN>
Subject: Re: bug#70345: [PATCH] 29.1.50; csharp-ts-mode indentation of if
 statements with single-statement body
In-Reply-To: <87o7afod31.fsf@HIDDEN> (Jacob Leeming's message of "Thu, 11
 Apr 2024 21:32:02 +0100")
References: <87o7afod31.fsf@HIDDEN>
Date: Mon, 15 Apr 2024 21:01:27 +0200
Message-ID: <87mspusb5k.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Migadu-Flow: FLOW_OUT
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70345
Cc: 70345 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> Hi all,
>

Hi, Jacob!

>>From emacs -Q:
>
> Evaluate this elisp to set up treesitter for csharp:
>
> (setq treesit-language-source-alist '((c-sharp
> "https://github.com/tree-sitter/tree-sitter-c-sharp" "master" "src"))
>       treesit-load-name-override-list '((c-sharp
> "libtree-sitter-csharp" "tree_sitter_c_sharp"))
>       major-mode-remap-alist '((csharp-mode . csharp-ts-mode)))
>
> Insert the following text into a csharp-ts-mode buffer:
>
> if (true)
> var x = 2;
>
> Try to indent the variable declaration of the function with
> indent-for-tab-command. Nothing will happen. I'd expect to see this:
>
> if (true)
>     var x = 2;
>
> This issue can be fixed with the following patch:
>
> diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el
> index 53c52e6..1a7d535 100644
> --- a/lisp/progmodes/csharp-mode.el
> +++ b/lisp/progmodes/csharp-mode.el
> @@ -678,7 +678,8 @@ csharp-ts-mode--indent-rules
>       ((parent-is "binary_expression") parent 0)
>       ((parent-is "block") parent-bol csharp-ts-mode-indent-offset)
>       ((parent-is "local_function_statement") parent-bol 0)
> -     ((parent-is "if_statement") parent-bol 0)
> +     ((match "block" "if_statement") parent-bol 0)
> +     ((parent-is "if_statement") parent-bol csharp-ts-mode-indent-offset)
>       ((parent-is "for_statement") parent-bol 0)
>       ((parent-is "for_each_statement") parent-bol 0)
>       ((parent-is "while_statement") parent-bol 0)
>

Looks good to me. Are you willing to pack this up with a nice test
confirming the behavior?

All the best,
Theo




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70345; Package emacs. Full text available.

Message received at 70345 <at> debbugs.gnu.org:


Received: (at 70345) by debbugs.gnu.org; 15 Apr 2024 04:57:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 15 00:57:18 2024
Received: from localhost ([127.0.0.1]:36445 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rwEP8-0004Bh-F9
	for submit <at> debbugs.gnu.org; Mon, 15 Apr 2024 00:57:18 -0400
Received: from out-188.mta0.migadu.com ([2001:41d0:1004:224b::bc]:65109)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <theo@HIDDEN>) id 1rwEP6-0004AR-08
 for 70345 <at> debbugs.gnu.org; Mon, 15 Apr 2024 00:57:17 -0400
Date: Mon, 15 Apr 2024 06:56:52 +0200
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no;
 s=key1; t=1713157017;
 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:
 content-transfer-encoding:content-transfer-encoding:  in-reply-to:in-reply-to; 
 bh=6ji9SNzUpY0lF0KfiEaDRw3Lv9CGS1eRSTj58zFBBVo=;
 b=JnQrqHb4qOk1UM82ThBtslURly1mN0i4HOP8u38e9JyLrXHJcXR7wHxC8ODzecysiGtEpG
 jM8iVxiUluTOpW4+F7v3u11QMUnKuMWrY14Z72o48V3syJmCj/BJbcFWbGQ0ek4ffwuCHm
 zGPDwFI5oXuAycQwFXaLCctYr7velQneSt5N0TTFciMfu1F7Ac67JSOCGvQ54wFu2gCJnz
 lPnP8b6V1+VHOffoeP7aKYTM7CR7TtGp4UVhfyIXC+cYMbau1ZERs300xUgkyVcPqZ1Boy
 awaJjxez5syjpEM0DQeQ6sFh9FZlbe7AGcv4wz4BmsBQyBUpdRY9JhmEK9pqkQ==
Subject: Re: bug#70345: [PATCH] 29.1.50; csharp-ts-mode indentation of if 
 statements with single-statement body
Message-ID: <41dae351-b556-4f13-8968-2dfca8c390b5@HIDDEN>
X-Android-Message-ID: <41dae351-b556-4f13-8968-2dfca8c390b5@HIDDEN>
In-Reply-To: <10AB4365-72E5-4864-8E47-21B7C8FF8FCE@HIDDEN>
X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and
 include these headers.
From: Theodor Thornhill <theo@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
Importance: Normal
X-Priority: 3
X-MSMail-Priority: Normal
MIME-Version: 1.0
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: base64
X-Migadu-Flow: FLOW_OUT
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: 70345
Cc: Eli Zaretskii <eliz@HIDDEN>, 70345 <at> debbugs.gnu.org,
 jacobtophatleeming@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

PGRpdiBkaXI9J2F1dG8nPjxkaXY+PGJyPjxkaXYgY2xhc3M9ImdtYWlsX2V4dHJhIj48YnI+PGRp
diBjbGFzcz0iZ21haWxfcXVvdGUiPk9uIEFwciAxNSwgMjAyNCAwMTowMiwgWXVhbiBGdSAmbHQ7
Y2Fzb3VyaUBnbWFpbC5jb20mZ3Q7IHdyb3RlOjxiciB0eXBlPSJhdHRyaWJ1dGlvbiI+PGJsb2Nr
cXVvdGUgY2xhc3M9InF1b3RlIiBzdHlsZT0ibWFyZ2luOjAgMCAwIC44ZXg7Ym9yZGVyLWxlZnQ6
MXB4ICNjY2Mgc29saWQ7cGFkZGluZy1sZWZ0OjFleCI+PHAgZGlyPSJsdHIiPgo8YnI+CkVsaSBa
YXJldHNraWkgJmx0O2VsaXpAZ251Lm9yZyZndDsgd3JpdGVzOgo8YnI+Cgo8YnI+CiZndDsmZ3Q7
IEZyb206IEphY29iIExlZW1pbmcgJmx0O2phY29idG9waGF0bGVlbWluZ0BnbWFpbC5jb20mZ3Q7
Cjxicj4KJmd0OyZndDsgRGF0ZTogVGh1LCAxMSBBcHIgMjAyNCAyMTozMjowMiArMDEwMAo8YnI+
CiZndDsmZ3Q7IAo8YnI+CiZndDsmZ3Q7IEhpIGFsbCwKPGJyPgomZ3Q7Jmd0OyAKPGJyPgomZ3Q7
Jmd0OyAmZ3Q7RnJvbSBlbWFjcyAtUToKPGJyPgomZ3Q7Jmd0OyAKPGJyPgomZ3Q7Jmd0OyBFdmFs
dWF0ZSB0aGlzIGVsaXNwIHRvIHNldCB1cCB0cmVlc2l0dGVyIGZvciBjc2hhcnA6Cjxicj4KJmd0
OyZndDsgCjxicj4KJmd0OyZndDsgKHNldHEgdHJlZXNpdC1sYW5ndWFnZS1zb3VyY2UtYWxpc3Qg
JygoYy1zaGFycAo8YnI+CiZndDsmZ3Q7ICJodHRwczovL2dpdGh1Yi5jb20vdHJlZS1zaXR0ZXIv
dHJlZS1zaXR0ZXItYy1zaGFycCIgIm1hc3RlciIgInNyYyIpKQo8YnI+CiZndDsmZ3Q7Jm5ic3A7
Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7IHRyZWVzaXQtbG9hZC1uYW1lLW92ZXJyaWRl
LWxpc3QgJygoYy1zaGFycAo8YnI+CiZndDsmZ3Q7ICJsaWJ0cmVlLXNpdHRlci1jc2hhcnAiICJ0
cmVlX3NpdHRlcl9jX3NoYXJwIikpCjxicj4KJmd0OyZndDsmbmJzcDsmbmJzcDsmbmJzcDsmbmJz
cDsmbmJzcDsmbmJzcDsgbWFqb3ItbW9kZS1yZW1hcC1hbGlzdCAnKChjc2hhcnAtbW9kZSAuIGNz
aGFycC10cy1tb2RlKSkpCjxicj4KJmd0OyZndDsgCjxicj4KJmd0OyZndDsgSW5zZXJ0IHRoZSBm
b2xsb3dpbmcgdGV4dCBpbnRvIGEgY3NoYXJwLXRzLW1vZGUgYnVmZmVyOgo8YnI+CiZndDsmZ3Q7
IAo8YnI+CiZndDsmZ3Q7IGlmICh0cnVlKQo8YnI+CiZndDsmZ3Q7IHZhciB4ID0gMjsKPGJyPgom
Z3Q7Jmd0OyAKPGJyPgomZ3Q7Jmd0OyBUcnkgdG8gaW5kZW50IHRoZSB2YXJpYWJsZSBkZWNsYXJh
dGlvbiBvZiB0aGUgZnVuY3Rpb24gd2l0aAo8YnI+CiZndDsmZ3Q7IGluZGVudC1mb3ItdGFiLWNv
bW1hbmQuIE5vdGhpbmcgd2lsbCBoYXBwZW4uIEknZCBleHBlY3QgdG8gc2VlIHRoaXM6Cjxicj4K
Jmd0OyZndDsgCjxicj4KJmd0OyZndDsgaWYgKHRydWUpCjxicj4KJmd0OyZndDsmbmJzcDsmbmJz
cDsmbmJzcDsmbmJzcDsgdmFyIHggPSAyOwo8YnI+CiZndDsmZ3Q7IAo8YnI+CiZndDsmZ3Q7IFRo
aXMgaXNzdWUgY2FuIGJlIGZpeGVkIHdpdGggdGhlIGZvbGxvd2luZyBwYXRjaDoKPGJyPgomZ3Q7
Jmd0OyAKPGJyPgomZ3Q7Jmd0OyBkaWZmIC0tZ2l0IGEvbGlzcC9wcm9nbW9kZXMvY3NoYXJwLW1v
ZGUuZWwgYi9saXNwL3Byb2dtb2Rlcy9jc2hhcnAtbW9kZS5lbAo8YnI+CiZndDsmZ3Q7IGluZGV4
IDUzYzUyZTYuLjFhN2Q1MzUgMTAwNjQ0Cjxicj4KJmd0OyZndDsgLS0tIGEvbGlzcC9wcm9nbW9k
ZXMvY3NoYXJwLW1vZGUuZWwKPGJyPgomZ3Q7Jmd0OyArKysgYi9saXNwL3Byb2dtb2Rlcy9jc2hh
cnAtbW9kZS5lbAo8YnI+CiZndDsmZ3Q7IEBAIC02NzgsNyArNjc4LDggQEAgY3NoYXJwLXRzLW1v
ZGUtLWluZGVudC1ydWxlcwo8YnI+CiZndDsmZ3Q7Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5i
c3A7Jm5ic3A7ICgocGFyZW50LWlzICJiaW5hcnlfZXhwcmVzc2lvbiIpIHBhcmVudCAwKQo8YnI+
CiZndDsmZ3Q7Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7ICgocGFyZW50LWlz
ICJibG9jayIpIHBhcmVudC1ib2wgY3NoYXJwLXRzLW1vZGUtaW5kZW50LW9mZnNldCkKPGJyPgom
Z3Q7Jmd0OyZuYnNwOyZuYnNwOyZuYnNwOyZuYnNwOyZuYnNwOyZuYnNwOyAoKHBhcmVudC1pcyAi
bG9jYWxfZnVuY3Rpb25fc3RhdGVtZW50IikgcGFyZW50LWJvbCAwKQo8YnI+CiZndDsmZ3Q7IC0m
bmJzcDsmbmJzcDsmbmJzcDsmbmJzcDsgKChwYXJlbnQtaXMgImlmX3N0YXRlbWVudCIpIHBhcmVu
dC1ib2wgMCkKPGJyPgomZ3Q7Jmd0OyArJm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7ICgobWF0Y2gg
ImJsb2NrIiAiaWZfc3RhdGVtZW50IikgcGFyZW50LWJvbCAwKQo8YnI+CiZndDsmZ3Q7ICsmbmJz
cDsmbmJzcDsmbmJzcDsmbmJzcDsgKChwYXJlbnQtaXMgImlmX3N0YXRlbWVudCIpIHBhcmVudC1i
b2wgY3NoYXJwLXRzLW1vZGUtaW5kZW50LW9mZnNldCkKPGJyPgomZ3Q7Jmd0OyZuYnNwOyZuYnNw
OyZuYnNwOyZuYnNwOyZuYnNwOyZuYnNwOyAoKHBhcmVudC1pcyAiZm9yX3N0YXRlbWVudCIpIHBh
cmVudC1ib2wgMCkKPGJyPgomZ3Q7Jmd0OyZuYnNwOyZuYnNwOyZuYnNwOyZuYnNwOyZuYnNwOyZu
YnNwOyAoKHBhcmVudC1pcyAiZm9yX2VhY2hfc3RhdGVtZW50IikgcGFyZW50LWJvbCAwKQo8YnI+
CiZndDsmZ3Q7Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7ICgocGFyZW50LWlz
ICJ3aGlsZV9zdGF0ZW1lbnQiKSBwYXJlbnQtYm9sIDApCjxicj4KJmd0Owo8YnI+CiZndDsgVGhl
byBhbmQgWXVhbiwgYW55IGNvbW1lbnRzPwo8YnI+Cgo8YnI+CklmIFRoZW8gaXMgdG9vIGJ1c3kg
SSBjYW4gdGFrZSBhIGxvb2ssIGJ1dCBJIGRvbuKAmXQgcmVhbGx5IGtub3cKPGJyPgpjc2hhcnAt
dHMtbW9kZSB0b28gd2VsbC4KPGJyPgoKPGJyPgpZdWFuPC9wPjwvYmxvY2txdW90ZT48L2Rpdj48
L2Rpdj48L2Rpdj48ZGl2IGRpcj0iYXV0byI+PGJyPjwvZGl2PjxkaXYgZGlyPSJhdXRvIj5JJ2xs
IGxvb2sgYXQgaXQgdG9uaWdodDopPC9kaXY+PGRpdiBkaXI9ImF1dG8iPlRoZW88L2Rpdj48ZGl2
IGRpcj0iYXV0byI+PGRpdiBjbGFzcz0iZ21haWxfZXh0cmEiPjxkaXYgY2xhc3M9ImdtYWlsX3F1
b3RlIj48YmxvY2txdW90ZSBjbGFzcz0icXVvdGUiIHN0eWxlPSJtYXJnaW46MCAwIDAgLjhleDti
b3JkZXItbGVmdDoxcHggI2NjYyBzb2xpZDtwYWRkaW5nLWxlZnQ6MWV4Ij48cCBkaXI9Imx0ciI+
Cjxicj4KPC9wPgo8L2Jsb2NrcXVvdGU+PC9kaXY+PGJyPjwvZGl2PjwvZGl2PjwvZGl2Pg==





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70345; Package emacs. Full text available.

Message received at 70345 <at> debbugs.gnu.org:


Received: (at 70345) by debbugs.gnu.org; 14 Apr 2024 23:03:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 14 19:03:25 2024
Received: from localhost ([127.0.0.1]:36365 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rw8sd-0001cq-Kl
	for submit <at> debbugs.gnu.org; Sun, 14 Apr 2024 19:03:25 -0400
Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:44213)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1rw8sb-0001bG-NL
 for 70345 <at> debbugs.gnu.org; Sun, 14 Apr 2024 19:03:22 -0400
Received: by mail-pg1-x536.google.com with SMTP id
 41be03b00d2f7-5dbf7b74402so1367143a12.0
 for <70345 <at> debbugs.gnu.org>; Sun, 14 Apr 2024 16:03:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1713135784; x=1713740584; darn=debbugs.gnu.org;
 h=to:cc:date:message-id:subject:mime-version
 :content-transfer-encoding:from:from:to:cc:subject:date:message-id
 :reply-to; bh=F+znx2VpGKtEvPjg7hd/aMoQvVsdgfmFhsx2fX1ObXE=;
 b=QKFfc3sj/hwQEgE+1YGtE4r+3inRSwIM32OR1Z9dJinP6Q/tDPs0Uek0Av1Z+yGZXD
 luFHQvf+Ae+/xcYBlI2lQR8kZowpouOpf2IZJW+5ulhRKOyNMjh4sBljeus/Rjw5T9mJ
 C71PXT8U9G1u7haitWNCOCYueiRBza3cMX2tqpVdtzA3oFmVTshg/tsEl26oqBs9kNyG
 YESToPLh8eoMtuozCqK3dY1HD0hLBG4iAq/dcB99KoZgOeEAmSPOGmQPmCH31v5OuLhY
 76lndfVsp8fTznnEyFOSFJf0eNIVox+6FRuZ/5j1kptKfk7MjBC+Em0monVksvwFwNzs
 mT2A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1713135784; x=1713740584;
 h=to:cc:date:message-id:subject:mime-version
 :content-transfer-encoding:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=F+znx2VpGKtEvPjg7hd/aMoQvVsdgfmFhsx2fX1ObXE=;
 b=UTDqld6Sk9GZgorfXCjUDigM7rYbMfcE88jCqXjnr3TBiBJR4+D/fx3m8vmNB/QFXm
 mUDw6LhCXA1GBX2NAl/sdelM1yNqVOa2zFfKbWxtOy+xSD++8SOicmfksj9ivAT19Dyg
 4kseeTVf3sAsH12uG1K0pyC9nMvzPWJFBjiWuH9AJo9I1LnEO53YHE/ToMwUyESej7nk
 dBWpdKvLvs2oAiu0PyfGRs2qCMbGa9wu2B82z4UEnraJOPF1VcPVwXq92GyjvwEPoxAU
 //Kvx6IeDhT9gVQ0Or58AIANibHGMtZH7m5+SAQ7tW8HhFeI9UJAJJCC79SiIPuYwVFx
 z9dA==
X-Forwarded-Encrypted: i=1;
 AJvYcCUe6RB0zhTeVGLtyXkmKWmuByb1v6zjfuazt5y1gQeTBjMq87UM6yMfGGZ0CMQNJgLeVcoCbbw6PJZIhtP9Up9EQKHaVyA=
X-Gm-Message-State: AOJu0YxcAIjrN2y1GXTfkvTRCFVcNC6scGG4l9+XpaaY90Y21l+Hd4wI
 fHvl9RKOZ0prXk9/Vo0BeT1izSARkYgXdKpODF8sonDR1gZLmDZJ
X-Google-Smtp-Source: AGHT+IHcFyNsNKrfd2YTs8v3Ee7ceWEvX+i3uPl5MPQEnWSkRidH2YCNzfRT0rP6qudPJIHqy2Ta4g==
X-Received: by 2002:a05:6a20:dea6:b0:1a7:97df:323d with SMTP id
 la38-20020a056a20dea600b001a797df323dmr6492969pzb.59.1713135784419; 
 Sun, 14 Apr 2024 16:03:04 -0700 (PDT)
Received: from smtpclient.apple ([2601:641:300:4910:ddd5:ebc3:f048:bab8])
 by smtp.gmail.com with ESMTPSA id
 p12-20020aa7860c000000b006eae2d9298esm6053412pfn.194.2024.04.14.16.03.01
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Sun, 14 Apr 2024 16:03:02 -0700 (PDT)
From: Yuan Fu <casouri@HIDDEN>
Content-Type: text/plain;
	charset=utf-8
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\))
Subject: Re: bug#70345: [PATCH] 29.1.50; csharp-ts-mode indentation of if 
 statements with single-statement body
Message-Id: <10AB4365-72E5-4864-8E47-21B7C8FF8FCE@HIDDEN>
Date: Sun, 14 Apr 2024 16:02:50 -0700
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.3731.700.6)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70345
Cc: 70345 <at> debbugs.gnu.org, theo@HIDDEN, jacobtophatleeming@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Jacob Leeming <jacobtophatleeming@HIDDEN>
>> Date: Thu, 11 Apr 2024 21:32:02 +0100
>>=20
>> Hi all,
>>=20
>> >=46rom emacs -Q:
>>=20
>> Evaluate this elisp to set up treesitter for csharp:
>>=20
>> (setq treesit-language-source-alist '((c-sharp
>> "https://github.com/tree-sitter/tree-sitter-c-sharp" "master" "src"))
>>       treesit-load-name-override-list '((c-sharp
>> "libtree-sitter-csharp" "tree_sitter_c_sharp"))
>>       major-mode-remap-alist '((csharp-mode . csharp-ts-mode)))
>>=20
>> Insert the following text into a csharp-ts-mode buffer:
>>=20
>> if (true)
>> var x =3D 2;
>>=20
>> Try to indent the variable declaration of the function with
>> indent-for-tab-command. Nothing will happen. I'd expect to see this:
>>=20
>> if (true)
>>     var x =3D 2;
>>=20
>> This issue can be fixed with the following patch:
>>=20
>> diff --git a/lisp/progmodes/csharp-mode.el =
b/lisp/progmodes/csharp-mode.el
>> index 53c52e6..1a7d535 100644
>> --- a/lisp/progmodes/csharp-mode.el
>> +++ b/lisp/progmodes/csharp-mode.el
>> @@ -678,7 +678,8 @@ csharp-ts-mode--indent-rules
>>       ((parent-is "binary_expression") parent 0)
>>       ((parent-is "block") parent-bol csharp-ts-mode-indent-offset)
>>       ((parent-is "local_function_statement") parent-bol 0)
>> -     ((parent-is "if_statement") parent-bol 0)
>> +     ((match "block" "if_statement") parent-bol 0)
>> +     ((parent-is "if_statement") parent-bol =
csharp-ts-mode-indent-offset)
>>       ((parent-is "for_statement") parent-bol 0)
>>       ((parent-is "for_each_statement") parent-bol 0)
>>       ((parent-is "while_statement") parent-bol 0)
>
> Theo and Yuan, any comments?

If Theo is too busy I can take a look, but I don=E2=80=99t really know
csharp-ts-mode too well.

Yuan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70345; Package emacs. Full text available.

Message received at 70345 <at> debbugs.gnu.org:


Received: (at 70345) by debbugs.gnu.org; 12 Apr 2024 05:45:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 12 01:45:46 2024
Received: from localhost ([127.0.0.1]:57669 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rv9jM-0004Pz-4L
	for submit <at> debbugs.gnu.org; Fri, 12 Apr 2024 01:45:46 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:40792)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rv9jH-0004OW-Bf
 for 70345 <at> debbugs.gnu.org; Fri, 12 Apr 2024 01:45:42 -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 <eliz@HIDDEN>)
 id 1rv9j1-0005OE-Ka; Fri, 12 Apr 2024 01:45:23 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=pItG0TZvIZc2SrMQgKc4+uB6BNcPblTRRmnOvivYCOs=; b=T9VjY2PsuX6V
 Bwn4FYPePWGgueiDCuPX5IpdQ/8KyWEirTTAwwPd7E9PuzQb7mZVJrsM/bCGOaSAD4JHaBeRrHqo+
 3ryXdGD0bj642ITsdWTqib3VlhMIoOs+nVrz/ljuE8fQLHG/+N46TreSpBSIaF/tauB9FmzLpbu0D
 h9+eUICRIp8cTjOfRTKRxpDjoO/DAY3E/Yi4iQ5G7rjtFJP6CQ798g+HNuarJBI/FOi4UbK60K8gR
 TS/XqnsSbhuuoBIrUNduax0IblHqxWJvidaKl8ARtuPFe3GDXim/s8gT08tiVMwXa3JiXYBjpAQID
 PMU13LQ227KRnnpwmkw41g==;
Date: Fri, 12 Apr 2024 08:45:19 +0300
Message-Id: <86zftzrv68.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Theodor Thornhill <theo@HIDDEN>, Yuan Fu <casouri@HIDDEN>
In-Reply-To: <87o7afod31.fsf@HIDDEN> (message from Jacob Leeming on Thu, 11
 Apr 2024 21:32:02 +0100)
Subject: Re: bug#70345: [PATCH] 29.1.50;
 csharp-ts-mode indentation of if statements with single-statement body
References: <87o7afod31.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70345
Cc: 70345 <at> debbugs.gnu.org, Jacob Leeming <jacobtophatleeming@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Jacob Leeming <jacobtophatleeming@HIDDEN>
> Date: Thu, 11 Apr 2024 21:32:02 +0100
> 
> Hi all,
> 
> >From emacs -Q:
> 
> Evaluate this elisp to set up treesitter for csharp:
> 
> (setq treesit-language-source-alist '((c-sharp
> "https://github.com/tree-sitter/tree-sitter-c-sharp" "master" "src"))
>       treesit-load-name-override-list '((c-sharp
> "libtree-sitter-csharp" "tree_sitter_c_sharp"))
>       major-mode-remap-alist '((csharp-mode . csharp-ts-mode)))
> 
> Insert the following text into a csharp-ts-mode buffer:
> 
> if (true)
> var x = 2;
> 
> Try to indent the variable declaration of the function with
> indent-for-tab-command. Nothing will happen. I'd expect to see this:
> 
> if (true)
>     var x = 2;
> 
> This issue can be fixed with the following patch:
> 
> diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el
> index 53c52e6..1a7d535 100644
> --- a/lisp/progmodes/csharp-mode.el
> +++ b/lisp/progmodes/csharp-mode.el
> @@ -678,7 +678,8 @@ csharp-ts-mode--indent-rules
>       ((parent-is "binary_expression") parent 0)
>       ((parent-is "block") parent-bol csharp-ts-mode-indent-offset)
>       ((parent-is "local_function_statement") parent-bol 0)
> -     ((parent-is "if_statement") parent-bol 0)
> +     ((match "block" "if_statement") parent-bol 0)
> +     ((parent-is "if_statement") parent-bol csharp-ts-mode-indent-offset)
>       ((parent-is "for_statement") parent-bol 0)
>       ((parent-is "for_each_statement") parent-bol 0)
>       ((parent-is "while_statement") parent-bol 0)

Theo and Yuan, any comments?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70345; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 11 Apr 2024 20:32:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 11 16:32:26 2024
Received: from localhost ([127.0.0.1]:57394 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rv15u-0004QW-Ka
	for submit <at> debbugs.gnu.org; Thu, 11 Apr 2024 16:32:26 -0400
Received: from lists.gnu.org ([2001:470:142::17]:60842)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jacobtophatleeming@HIDDEN>) id 1rv15s-0004PO-85
 for submit <at> debbugs.gnu.org; Thu, 11 Apr 2024 16:32:25 -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 <jacobtophatleeming@HIDDEN>)
 id 1rv15c-0001Ra-KC
 for bug-gnu-emacs@HIDDEN; Thu, 11 Apr 2024 16:32:08 -0400
Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <jacobtophatleeming@HIDDEN>)
 id 1rv15a-00022O-7s
 for bug-gnu-emacs@HIDDEN; Thu, 11 Apr 2024 16:32:08 -0400
Received: by mail-wr1-x432.google.com with SMTP id
 ffacd0b85a97d-343d1003106so111196f8f.1
 for <bug-gnu-emacs@HIDDEN>; Thu, 11 Apr 2024 13:32:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1712867524; x=1713472324; darn=gnu.org;
 h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc
 :subject:date:message-id:reply-to;
 bh=ksLuYeI90+vQkt1QHwzbraqhZ9EXeYoyZdjn9hNmZrc=;
 b=iKzfXjLFHMjhRZy1zEsOvC4vaKZsL9b72EW4TZsJ3ZFwcjqimzX62DvnSO1a7lT6KK
 kEq2WbrGp74ZzkB2hmxnxbwfBk+HDQxK8v+i06tduHpH1gclimPi0tx7muSdguA08/9e
 G4Z6yIcOjywGg+RcvgwxgYMXAc5D3T9QDsXVaOO5kGGBzNNTPjS+jO8iNwEBHqA8dehx
 YK4A/inmm1ZnMxIb4q8eBM1f+ymW4/mF2kBuCp3gbt2Dmf+kCy602mgmtxOs01rz6l91
 Ny9DIEt2uPZG4DR6gVQaS1agDU6dgw+1+yEnNkV0S7QbGyNysuDMLIklMhZPNAQJijvd
 p3cw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1712867524; x=1713472324;
 h=mime-version:user-agent:message-id:date:subject:to:from
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=ksLuYeI90+vQkt1QHwzbraqhZ9EXeYoyZdjn9hNmZrc=;
 b=aLYI40ht8KbOem+7nQljZKBvZFBDKkuSzwBXiCKyd6O383MAdhu4mejlBnA6bfVatg
 DGclu/3UQ4L4syBgQg6CykcpYhuIWern/nr0u47BpSUlYzrNHKd86x9ls3senFyLXZby
 AcoThsLGlUbd+OcZZJikLwtLWmPuOVPB6PptPBxQZG/Ap4sAQa+zlJjNEiU3U3dw/w0r
 w0eLcR2yhuFXLUKncVJPJNXFz1dSWzocZEkiyiU4dzNfsftZtGv0J4fw3ireiHZDp3Wd
 7jU0gEmmERZH47ISOd53cvjjOe7vYG6o2KS9lKSA6o8hyuIIY/HJnDwyhr4Q4QaMr3Ge
 xbqg==
X-Gm-Message-State: AOJu0Yz5soCQawLftVQ8RIgijB65+wKk5M0kSWLkJmSncO2fcEoz67H0
 8v+3XM7OGm9l0AEPhC8aDws4mCzZZ9NtZKPK70oK0Q28dnoPLxdMjIfXQw==
X-Google-Smtp-Source: AGHT+IF2w21SXfEXxylzOkiUPIJiw87/X7wYSP5k6UotOnTYyUP5Jqx0UhyDfkMdLuI6YGbII5ogVg==
X-Received: by 2002:a05:6000:2a7:b0:345:816c:6e16 with SMTP id
 l7-20020a05600002a700b00345816c6e16mr506687wry.25.1712867524111; 
 Thu, 11 Apr 2024 13:32:04 -0700 (PDT)
Received: from jacobDebianWorkLaptop ([2a00:23c7:238a:701:dd12:79a8:53c9:17cc])
 by smtp.gmail.com with ESMTPSA id
 d8-20020a5d5388000000b0034335f13570sm2552712wrv.116.2024.04.11.13.32.03
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 11 Apr 2024 13:32:03 -0700 (PDT)
From: Jacob Leeming <jacobtophatleeming@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] 29.1.50; csharp-ts-mode indentation of if statements with
 single-statement body
Date: Thu, 11 Apr 2024 21:32:02 +0100
Message-ID: <87o7afod31.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=2a00:1450:4864:20::432;
 envelope-from=jacobtophatleeming@HIDDEN; helo=mail-wr1-x432.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Hi all,

From emacs -Q:

Evaluate this elisp to set up treesitter for csharp:

(setq treesit-language-source-alist '((c-sharp
"https://github.com/tree-sitter/tree-sitter-c-sharp" "master" "src"))
      treesit-load-name-override-list '((c-sharp
"libtree-sitter-csharp" "tree_sitter_c_sharp"))
      major-mode-remap-alist '((csharp-mode . csharp-ts-mode)))

Insert the following text into a csharp-ts-mode buffer:

if (true)
var x = 2;

Try to indent the variable declaration of the function with
indent-for-tab-command. Nothing will happen. I'd expect to see this:

if (true)
    var x = 2;

This issue can be fixed with the following patch:

diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el
index 53c52e6..1a7d535 100644
--- a/lisp/progmodes/csharp-mode.el
+++ b/lisp/progmodes/csharp-mode.el
@@ -678,7 +678,8 @@ csharp-ts-mode--indent-rules
      ((parent-is "binary_expression") parent 0)
      ((parent-is "block") parent-bol csharp-ts-mode-indent-offset)
      ((parent-is "local_function_statement") parent-bol 0)
-     ((parent-is "if_statement") parent-bol 0)
+     ((match "block" "if_statement") parent-bol 0)
+     ((parent-is "if_statement") parent-bol csharp-ts-mode-indent-offset)
      ((parent-is "for_statement") parent-bol 0)
      ((parent-is "for_each_statement") parent-bol 0)
      ((parent-is "while_statement") parent-bol 0)

Cheers,
Jacob




Acknowledgement sent to Jacob Leeming <jacobtophatleeming@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#70345; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 27 Apr 2024 19:30:01 UTC

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