GNU bug report logs - #67710
[PATCH] 29.1.50 missing indent rule for parameter list in csharp-ts-mode

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; merged with #67709; dated Fri, 8 Dec 2023 14:19:03 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Merged 67709 67710. Request was from Eli Zaretskii <eliz@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 67710) by debbugs.gnu.org; 8 Dec 2023 14:37:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 08 09:37:28 2023
Received: from localhost ([127.0.0.1]:44268 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rBbyq-0005OD-0S
	for submit <at> debbugs.gnu.org; Fri, 08 Dec 2023 09:37:28 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:51026)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>)
 id 1rBbyn-0005No-EQ; Fri, 08 Dec 2023 09:37:26 -0500
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 1rBbyV-0007IS-1Q; Fri, 08 Dec 2023 09:37:07 -0500
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=iO53iJiEVECsuOxPgLiRuug0HB9wgI64CIpqIzn1ia8=; b=Hd9EztOfU3cC
 e1vSyEhnkM/YRonuHyqETmaZ9yuHgqunF7aSohz8Mff5+iZiRunxfzT8WO35mtGNXsiy9LHWhSHB+
 2fIGilUwE3tWCeXM58dRahYKucvfkNyoZxB1p/uf7jfSH9/grW2Buq3dYxzGxwycBWpCp33Ns/WDA
 p5nT7IBBfns6Fxob8z8fDnb9mp/tcxJcEKZ1YAfoWdzKEJCWg0cPDTYCqiuBlSeehU5l06uKeIups
 1KijjOd8VkxBV/G8fwzLyOzu/acRUqSDeIUwYW1S5Z/xE6lyqJyQSQvMomK7DN+yNIpN2WZ9K2KF3
 NFZaKpGbdF4dWEemAhWdiQ==;
Date: Fri, 08 Dec 2023 16:37:11 +0200
Message-Id: <83plzgzroo.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Jacob Leeming <jacobtophatleeming@HIDDEN>
In-Reply-To: <CAAVkrVYacSnLpHj-PYJS0sb4-cJWW4Xsxh92V0eHiFGjZE9mFA@HIDDEN>
 (message from Jacob Leeming on Fri, 8 Dec 2023 14:12:28 +0000)
Subject: Re: bug#67710: [PATCH] 29.1.50 missing indent rule for parameter list
 in csharp-ts-mode
References: <CAAVkrVYacSnLpHj-PYJS0sb4-cJWW4Xsxh92V0eHiFGjZE9mFA@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 67710
Cc: 67710 <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 (---)

merge 67710 67709
thanks

> From: Jacob Leeming <jacobtophatleeming@HIDDEN>
> Date: Fri, 8 Dec 2023 14:12:28 +0000
> 
> >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:
> 
> void ExampleFunction(
>     int arg1,
>   int arg2,
>  int arg3,
> int arg4,
>     int arg5
> )
> {
>     Console.WriteLine(arg1);
> }
> 
> Try to indent the parameters of the function with
> indent-for-tab-command. Nothing will happen.
> 
> 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..8cc4e95 100644
> --- a/lisp/progmodes/csharp-mode.el
> +++ b/lisp/progmodes/csharp-mode.el
> @@ -704,7 +704,8 @@ csharp-ts-mode--indent-rules
>       ((parent-is "object_type") parent-bol csharp-ts-mode-indent-offset)
>       ((parent-is "enum_body") parent-bol csharp-ts-mode-indent-offset)
>       ((parent-is "arrow_function") parent-bol csharp-ts-mode-indent-offset)
> -     ((parent-is "parenthesized_expression") parent-bol
> csharp-ts-mode-indent-offset))))
> +     ((parent-is "parenthesized_expression") parent-bol
> csharp-ts-mode-indent-offset)
> +     ((parent-is "parameter_list") parent-bol csharp-ts-mode-indent-offset))))
> 
>  (defvar csharp-ts-mode--keywords
>    '("using" "namespace" "class" "if" "else" "throw" "new" "for"

This is an exact duplicate of bug#67709.  Merging.




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

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


Received: (at submit) by debbugs.gnu.org; 8 Dec 2023 14:18:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 08 09:18:13 2023
Received: from localhost ([127.0.0.1]:44205 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rBbgC-0004ap-SC
	for submit <at> debbugs.gnu.org; Fri, 08 Dec 2023 09:18:13 -0500
Received: from lists.gnu.org ([2001:470:142::17]:49428)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jacobtophatleeming@HIDDEN>) id 1rBbbC-0004Mw-Rv
 for submit <at> debbugs.gnu.org; Fri, 08 Dec 2023 09:13:03 -0500
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 1rBbat-0004rL-Bs
 for bug-gnu-emacs@HIDDEN; Fri, 08 Dec 2023 09:12:43 -0500
Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <jacobtophatleeming@HIDDEN>)
 id 1rBbar-0005HR-Ja
 for bug-gnu-emacs@HIDDEN; Fri, 08 Dec 2023 09:12:43 -0500
Received: by mail-pj1-x102b.google.com with SMTP id
 98e67ed59e1d1-286e05d9408so1633537a91.1
 for <bug-gnu-emacs@HIDDEN>; Fri, 08 Dec 2023 06:12:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1702044760; x=1702649560; darn=gnu.org;
 h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
 :date:message-id:reply-to;
 bh=ZB6UZFSJSfjzKHqE+nut4JCpLuOu7udhLzdb5nIPCXo=;
 b=dPfmCCna/phlcb6x/juc3LiYBHQGGZkWMMdsQVMdQGfu3a2hxDumYOVY06JoRAr9Hq
 78NUwTbiYYloqpHkaoZ9rmw5EzTeFwezYo/pDjUAP+M/EmO+5VT63ldCEiuhBGCjqTsy
 lStx+beQ50U2Uxe/B7Nf4HcaoPaK2gQQ1HTAShTNY1zIfl/mKUpayGWandB4b1/DDjLb
 mtvwgp2k1E/aN1+Jko1Ygi4NF2M3GYt+CmydxnWmqylzAuMOw7CSwYsCwXzCALwx4jZj
 GnTe23bjy1QSF/J3dLRMp971VhIpeHN13GrCkWuW3Ypi/jo/GHwfefMcFfKagciCPXY+
 rFBw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1702044760; x=1702649560;
 h=to:subject:message-id:date:from:mime-version:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=ZB6UZFSJSfjzKHqE+nut4JCpLuOu7udhLzdb5nIPCXo=;
 b=hyy3e1dCYWt0lXl84IfHiXOpTwfYekY8DRFa0vbQfoOIrOt8gSQ3gZ0RTrHGczLXag
 PdmjrASG2Ye3dms0Oao7P/7L3v2IEwru05/CkZytLYRs9SnGK7cduaams8iXtzoTtx/L
 LS9kSzVZu+dJPFrB259qJ4ptGALfYMg40Iwc9IHp8OCDFo75JdtMNkT9mGCr7TJ0sguE
 9ZkBWaWr4tZikN6yy1nqhRyRnfYEOBQxQwvjszACYGG64WB3FQg8GulrfQjjXS8UTIX7
 +renY96OjDDumfjkDl5vs1IdqpbrdyeHX6G4fK9338WSZfYRdE9QqUJ65kr6NtaaH9Oz
 Z/QA==
X-Gm-Message-State: AOJu0YzhrqSlxlNOcWss+gtOASvXHBsbWyMlcCPYn8a6/np2XGJR3kEH
 Z9jyTx1CH8tn3RCPLVFkgc1MYHt7SrfcV296GR+Rgsxy9jw=
X-Google-Smtp-Source: AGHT+IFHSDcrkondfjyr6QALmCqGRDeEn3GpzxK/2w1edvmKZTj3gmLIjyRRrHo/8wdlVtHHqcHKkHHnmw7VK975dRM=
X-Received: by 2002:a17:90a:65c9:b0:286:7c79:8dc7 with SMTP id
 i9-20020a17090a65c900b002867c798dc7mr245623pjs.11.1702044759870; Fri, 08 Dec
 2023 06:12:39 -0800 (PST)
MIME-Version: 1.0
From: Jacob Leeming <jacobtophatleeming@HIDDEN>
Date: Fri, 8 Dec 2023 14:12:28 +0000
Message-ID: <CAAVkrVYacSnLpHj-PYJS0sb4-cJWW4Xsxh92V0eHiFGjZE9mFA@HIDDEN>
Subject: [PATCH] 29.1.50 missing indent rule for parameter list in
 csharp-ts-mode
To: bug-gnu-emacs@HIDDEN
Content-Type: text/plain; charset="UTF-8"
Received-SPF: pass client-ip=2607:f8b0:4864:20::102b;
 envelope-from=jacobtophatleeming@HIDDEN; helo=mail-pj1-x102b.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,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Fri, 08 Dec 2023 09:18:11 -0500
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 (/)

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:

void ExampleFunction(
    int arg1,
  int arg2,
 int arg3,
int arg4,
    int arg5
)
{
    Console.WriteLine(arg1);
}

Try to indent the parameters of the function with
indent-for-tab-command. Nothing will happen.

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..8cc4e95 100644
--- a/lisp/progmodes/csharp-mode.el
+++ b/lisp/progmodes/csharp-mode.el
@@ -704,7 +704,8 @@ csharp-ts-mode--indent-rules
      ((parent-is "object_type") parent-bol csharp-ts-mode-indent-offset)
      ((parent-is "enum_body") parent-bol csharp-ts-mode-indent-offset)
      ((parent-is "arrow_function") parent-bol csharp-ts-mode-indent-offset)
-     ((parent-is "parenthesized_expression") parent-bol
csharp-ts-mode-indent-offset))))
+     ((parent-is "parenthesized_expression") parent-bol
csharp-ts-mode-indent-offset)
+     ((parent-is "parameter_list") parent-bol csharp-ts-mode-indent-offset))))

 (defvar csharp-ts-mode--keywords
   '("using" "namespace" "class" "if" "else" "throw" "new" "for"




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#67710; 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: Fri, 8 Dec 2023 14:45:02 UTC

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