csharpextensions
csharpextensions copied to clipboard
Initialize from parameter messes up method/constructor signature
If a method signature or a constructor span multiple lines, and "Initialize ... from parameter" is executed for a parameter on the second or a subsequent line, the new field or property is generated within the method signature or constructor.
Example:
public void DoSomething(int par1,
int par2)
{
}
Calling "Initialize field from parameter" on par2 results in:
public void DoSomething(int par1,
private readonly int par2; //this is always generated one line above the parameter declaration
int par2)
{
this.par2 = par2;
}