dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.06k stars 4.04k forks source link

Change Method Signature: add parameter #25143

Closed kuhlenh closed 6 years ago

kuhlenh commented 6 years ago

We have a way to add a parameter to a constructor (https://docs.microsoft.com/en-us/visualstudio/ide/reference/generate-constructor#addparameter) but the only way to do it for a method is to generate an entirely new method.

Neme12 commented 6 years ago

there's a PR for this: #22314 also existing issue: #21446

kendrahavens commented 5 years ago

I received an internal ask to have the "Add parameter" ability added to the Change method signature dialog. The current (Ctrl + R, V) dialog doesn't have the ability to

add a parameter, and strategies to pick a default value (leave as a TODO, select from context, use the same constant value everywhere, …)

Commenting here in case we need to reopen this.

CyrusNajmabadi commented 5 years ago

@kendrahavens can hte people making the internal ask open these issues (or at least be directed to them). That way we could actually discuss what it is that they're looking for and can involve them in the deign to vet whatever work may happen.

kendrahavens commented 5 years ago

@CyrusNajmabadi Sure, many of them are interested in multiple pre-existing feature requests. I can ask them to start commenting so we can investigate further.

arnaud-fabre commented 5 years ago

@CyrusNajmabadi The internal ask that Kendra mentioned originated from me. It's about the Change signature dialog box, that currently (at least in VS 2019 Preview 4.2) only allows to remove and reorder parameters. Adding parameters right from there, along with a strategy to pick a value for existing call sites would be a useful feature, don't hesitate to include me in discussions, should there be work planned for it.

sharwell commented 5 years ago

@kendrahavens @arnaud-fabre that would be issue #33534 👍