Search code examples
c#visual-studioresharpernamed-parameters

"Automatically insert all named arguments" at method call-site, in code


Say there is a method,

void M(int a, int b, int c /* and many more */)

Is there a way to transform M() to M(a: .., b: .., c: ..) at the call-site?

I am using Visual Studio 2013 (Ultimate) 2017 Professional with ReSharper 8 ReSharper 2018.1. A built-in solution (or extension if such is required) that utilized either would be suitable.

This is similar to Is there any tools to help me refactor a method call from using position-based to name-based parameters, although I expect to start with no arguments; and am asking the question 4 years later.


Solution

  • Resharper can do this for you https://www.jetbrains.com/help/resharper/Argument_Style.html