From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jacob Leeming Newsgroups: gmane.emacs.bugs Subject: bug#67710: [PATCH] 29.1.50 missing indent rule for parameter list in csharp-ts-mode Date: Fri, 8 Dec 2023 14:12:28 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12041"; mail-complaints-to="usenet@ciao.gmane.io" To: 67710@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 08 15:19:31 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rBbhT-0002w1-T5 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Dec 2023 15:19:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBbh0-0007I7-64; Fri, 08 Dec 2023 09:19:02 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBbgp-00071Y-1A for bug-gnu-emacs@gnu.org; Fri, 08 Dec 2023 09:18:52 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rBbgo-0000Ag-NY for bug-gnu-emacs@gnu.org; Fri, 08 Dec 2023 09:18:50 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rBbh1-0004dA-Fw for bug-gnu-emacs@gnu.org; Fri, 08 Dec 2023 09:19:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jacob Leeming Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Dec 2023 14:19:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 67710 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.170204509317671 (code B ref -1); Fri, 08 Dec 2023 14:19:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Dec 2023 14:18:13 +0000 Original-Received: from localhost ([127.0.0.1]:44205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBbgC-0004ap-SC for submit@debbugs.gnu.org; Fri, 08 Dec 2023 09:18:13 -0500 Original-Received: from lists.gnu.org ([2001:470:142::17]:49428) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBbbC-0004Mw-Rv for submit@debbugs.gnu.org; Fri, 08 Dec 2023 09:13:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBbat-0004rL-Bs for bug-gnu-emacs@gnu.org; Fri, 08 Dec 2023 09:12:43 -0500 Original-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 ) id 1rBbar-0005HR-Ja for bug-gnu-emacs@gnu.org; Fri, 08 Dec 2023 09:12:43 -0500 Original-Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-286e05d9408so1633537a91.1 for ; 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) Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=jacobtophatleeming@gmail.com; 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-Mailman-Approved-At: Fri, 08 Dec 2023 09:18:11 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:275773 Archived-At: >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"