Rename constructor parameters on rename of field

Hi,

I noticed that when renaming a field that is initialized through a constructor
parameter with the same name, you don't have the option to rename that parameter
as well.

Current situation:
Before:
public class Foo
{
private int bar;

public Foo(int bar)
{
this.bar = bar;
}
}

After refactoring of bar too foobar:
public class Foo
{
private int foobar;

public Foo(int bar)
{
this.foobar = bar;
}
}

It would be nice to have the constructor parameter renamed as well if it
has the same name, or at least give the user the option to do so, as is the
case with properties for refactored fields.

Would this be something that can be included in a future release of r#?

Greetings,

Guy


2 comments
Comment actions Permalink

Please submit feature request for this into the tracker.

Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hi,

I noticed that when renaming a field that is initialized through a
constructor parameter with the same name, you don't have the option to
rename that parameter as well.

Current situation:
Before:
public class Foo
{
private int bar;
public Foo(int bar)
{
this.bar = bar;
}
}
After refactoring of bar too foobar:
public class Foo
{
private int foobar;
public Foo(int bar)
{
this.foobar = bar;
}
}
It would be nice to have the constructor parameter renamed as well if
it has the same name, or at least give the user the option to do so,
as is the case with properties for refactored fields.

Would this be something that can be included in a future release of
r#?

Greetings,

Guy



0
Comment actions Permalink

Hello Valentin,

Done, request #22185.

Greetings,

Guy

Please submit feature request for this into the tracker.

Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

>> Hi,
>>
>> I noticed that when renaming a field that is initialized through a
>> constructor parameter with the same name, you don't have the option
>> to rename that parameter as well.
>>
>> Current situation:
>> Before:
>> public class Foo
>> {
>> private int bar;
>> public Foo(int bar)
>> {
>> this.bar = bar;
>> }
>> }
>> After refactoring of bar too foobar:
>> public class Foo
>> {
>> private int foobar;
>> public Foo(int bar)
>> {
>> this.foobar = bar;
>> }
>> }
>> It would be nice to have the constructor parameter renamed as well if
>> it has the same name, or at least give the user the option to do so,
>> as is the case with properties for refactored fields.
>> Would this be something that can be included in a future release of
>> r#?
>>
>> Greetings,
>>
>> Guy
>>


0

Please sign in to leave a comment.