phptools-docs icon indicating copy to clipboard operation
phptools-docs copied to clipboard

Using refactor rename on parameter does not rename named arguments

Open still-dreaming-1 opened this issue 2 years ago • 3 comments

Using the refactor rename feature on a parameter name does renames it in most places, but not for callers using the named argument of that parameter.

Even though I make heavy use inlay hints instead of named arguments, I also make heavy use named arguments for certain code that needs to be somewhat DSL like where I get a lot of value out of choosing which parameters to pass and which to leave as the default value. One of the main drawbacks of using named arguments is having to rename the named arguments everywhere any time you rename a parameter. Therefore if the rename refactor could rename all of them for you, that would be an amazing feature.

still-dreaming-1 avatar Sep 04 '23 00:09 still-dreaming-1

Thank you for pointing this out. ~~It should be easy fix.~~

jakubmisek avatar Sep 04 '23 09:09 jakubmisek

This would be very nice to have. I have stopped using named parameters in php because of this not working, but I would like to be able to use them.

still-dreaming-1 avatar May 16 '24 13:05 still-dreaming-1

Thank you for reminding me.

We're updating the rename refactoring in general (there are many cases where we don't rename correctly). Then we'll be adding named parameters rename refactoring and namespace rename refactoring.

jakubmisek avatar May 18 '24 21:05 jakubmisek