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


Message #23 received at 67709 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: theo <at> thornhill.no
Cc: jacobtophatleeming <at> gmail.com, 67709 <at> debbugs.gnu.org
Subject: Re: bug#67709: 29.1.50;
 [patch] missing indent rule for parameter list in csharp-ts-mode
Date: Sat, 23 Dec 2023 11:02:45 +0200
Ping!  Theo, could you please look into this?

> Cc: 67709 <at> debbugs.gnu.org
> Date: Sat, 16 Dec 2023 13:39:58 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> > From: Jacob Leeming <jacobtophatleeming <at> gmail.com>
> > 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"
> 
> Theo, any comments?  Should I install this?
> 
> Thanks.
> 
> 
> 
> 




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.