Ability to combine context actions would be highly useful

when adding constructor parameters for DI, it requires 2 steps using R#, regardless of how I do it.

if, in a method, I write:

Then I can use context action “Create Field _someDependencyThatIsntYetInjected”
and can specify the interface name whilst doing this, so I might end up with:
    private ISomeDependency _someDependency;

but I also want to initialise this from the constructor
so I use context action “Initialise field from constructor”

but then R# suggests a context action of “make field _someDependency readonly”

So thats actually 3 or more steps, when it could be done in one.
It would be great to somehow be able to combine these, altho I appreciate its difficult to determine what actions are available at the beginning.

I could write a custom R# plugin, but this is very common for me in many scenarios and probably lots of other lazy developers also :-)
R# has made us lazy, and we want more :-)

1 comment

Hello David,

I've created a corresponding feature request - Combine several quick fixes into one. Please feel free to comment or vote for it.

Thank you.


Please sign in to leave a comment.