GNU bug report logs - #67709
29.1.50; [patch] missing indent rule for parameter list in csharp-ts-mode

Previous Next

Package: emacs;

Reported by: Jacob Leeming <jacobtophatleeming <at> gmail.com>

Date: Fri, 8 Dec 2023 14:19:02 UTC

Severity: wishlist

Tags: patch

Merged with 67710

Found in version 29.1.50

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Jacob Leeming <jacobtophatleeming <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#67709: closed (29.1.50; [patch] missing indent rule for
 parameter list in csharp-ts-mode)
Date: Fri, 08 Dec 2023 14:31:03 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 8 Dec 2023 14:30:20 +0000
with message-id <CAAVkrVaC7YV__im5amD_DRzZSV-xyCQNzJ3U2NYqYc6ci4HqtA <at> mail.gmail.com>
and subject line 
has caused the debbugs.gnu.org bug report #67709,
regarding 29.1.50; [patch] missing indent rule for parameter list in csharp-ts-mode
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
67709: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=67709
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Jacob Leeming <jacobtophatleeming <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.1.50;
 [patch] missing indent rule for parameter list in csharp-ts-mode
Date: Fri, 8 Dec 2023 13:44:14 +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"


[Message part 3 (message/rfc822, inline)]
From: Jacob Leeming <jacobtophatleeming <at> gmail.com>
To: 67709-done <at> debbugs.gnu.org
Date: Fri, 8 Dec 2023 14:30:20 +0000
duplicate of 67710


This bug report was last modified 154 days ago.

Previous Next


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