dotnet / dotnet/roslyn

Parameter reordering with 'Change Signature' with indented parameters has weird formatting

Open
#77,869 0 comments 0 reactions 0 assignees View on GitHub
Area-IDE
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

_This issue has been moved from [a ticket on Developer Community](https://developercommunity.visualstudio.com/t/Parameter-reordering-with-Change-Signat/10879738)._

---
[severity:It bothers me. A fix would be nice]
If use 'Change Signature' to reorder parameters of a method like this:

`public void Foo(int a, int b, int c){}` -> `public void Foo(int b, int c, int a){}`

And I have a method call like this:

```
Foo(
a: 1,
b: 2,
c: 3
);
```

I get following result:

```
Foo(
b: 2,
c: 3
,
a: 1);
```

But I would expect it to be:

```
Foo(
b: 2,
c: 3,
a: 1
);
```

---
### Original Comments

#### Feedback Bot on 3/26/2025, 11:09 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Contributor guide

Open the contributing guide

Research direction

Reproduce this in Visual Studio with a C# method call using indented named parameters, then run Change Signature to reorder the parameters. Compare the generated formatting with the expected example; done means the reordered call keeps the comma and closing parenthesis correctly indented.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.