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

To reply to this bug, email your comments to 67709 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#67709; Package emacs. (Fri, 08 Dec 2023 14:19:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jacob Leeming <jacobtophatleeming <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 08 Dec 2023 14:19:02 GMT) Full text and rfc822 format available.

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

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"




Reply sent to Jacob Leeming <jacobtophatleeming <at> gmail.com>:
You have taken responsibility. (Fri, 08 Dec 2023 14:31:03 GMT) Full text and rfc822 format available.

Notification sent to Jacob Leeming <jacobtophatleeming <at> gmail.com>:
bug acknowledged by developer. (Fri, 08 Dec 2023 14:31:03 GMT) Full text and rfc822 format available.

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

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67709; Package emacs. (Fri, 08 Dec 2023 14:40:03 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jacob Leeming <jacobtophatleeming <at> gmail.com>
Cc: jacobtophatleeming <at> gmail.com, 67709 <at> debbugs.gnu.org
Subject: Re: bug#67709:
Date: Fri, 08 Dec 2023 16:39:42 +0200
reopen 67709
merge 67710 67709
thanks

> From: Jacob Leeming <jacobtophatleeming <at> gmail.com>
> Date: Fri, 8 Dec 2023 14:30:20 +0000
> 
> duplicate of 67710

We don't close duplicates, we merge them.




Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 08 Dec 2023 14:40:03 GMT) Full text and rfc822 format available.

Merged 67709 67710. Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 08 Dec 2023 14:40:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67709; Package emacs. (Sat, 16 Dec 2023 11:41:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jacob Leeming <jacobtophatleeming <at> gmail.com>,
 Theodor Thornhill <theo <at> thornhill.no>
Cc: 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, 16 Dec 2023 13:39:58 +0200
> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67709; Package emacs. (Sat, 23 Dec 2023 09:04:02 GMT) Full text and rfc822 format available.

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.
> 
> 
> 
> 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67709; Package emacs. (Thu, 28 Dec 2023 08:05:02 GMT) Full text and rfc822 format available.

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

From: Theodor Thornhill <theo <at> thornhill.no>
To: Eli Zaretskii <eliz <at> gnu.org>
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: Thu, 28 Dec 2023 09:04:13 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

> Ping!  Theo, could you please look into this?
>

Absolutely, thanks!

Theo

>> 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.
>> 
>> 
>> 
>> 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67709; Package emacs. (Tue, 09 Jan 2024 20:01:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Theodor Thornhill <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: Tue, 09 Jan 2024 21:59:41 +0200
> From: Theodor Thornhill <theo <at> thornhill.no>
> Cc: jacobtophatleeming <at> gmail.com, 67709 <at> debbugs.gnu.org
> Date: Thu, 28 Dec 2023 09:04:13 +0100
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > Ping!  Theo, could you please look into this?
> >
> 
> Absolutely, thanks!

Any progress?

> >> 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.
> >> 
> >> 
> >> 
> >> 
> 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67709; Package emacs. (Sat, 20 Jan 2024 09:06:01 GMT) Full text and rfc822 format available.

Message #32 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, 20 Jan 2024 11:05:22 +0200
Ping! Ping! Any progress there?

> Cc: jacobtophatleeming <at> gmail.com, 67709 <at> debbugs.gnu.org
> Date: Tue, 09 Jan 2024 21:59:41 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> > From: Theodor Thornhill <theo <at> thornhill.no>
> > Cc: jacobtophatleeming <at> gmail.com, 67709 <at> debbugs.gnu.org
> > Date: Thu, 28 Dec 2023 09:04:13 +0100
> > 
> > Eli Zaretskii <eliz <at> gnu.org> writes:
> > 
> > > Ping!  Theo, could you please look into this?
> > >
> > 
> > Absolutely, thanks!
> 
> Any progress?
> 
> > >> 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.
> > >> 
> > >> 
> > >> 
> > >> 
> > 
> 
> 
> 
> 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67709; Package emacs. (Sat, 20 Jan 2024 09:12:01 GMT) Full text and rfc822 format available.

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

From: Theodor Thornhill <theo <at> thornhill.no>
To: Eli Zaretskii <eliz <at> gnu.org>
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, 20 Jan 2024 10:10:57 +0100
[Message part 1 (text/html, inline)]

Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 13 Feb 2025 07:07:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67709; Package emacs. (Sun, 23 Feb 2025 06:03:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Theodor Thornhill <theo <at> thornhill.no>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 67710 <at> debbugs.gnu.org,
 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: Sun, 23 Feb 2025 06:02:15 +0000
Theodor Thornhill <theo <at> thornhill.no> writes:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>> Ping!  Theo, could you please look into this?
>>
>
> Absolutely, thanks!
>
> Theo

Theo, did you ever get the chance to 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 153 days ago.

Previous Next


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