Navigate to Location Prior to Introducing Variable Refactoring

I've been using Resharper for TDD a lot and I was wondering whether there's a shortcut to navigate to my last edit prior to using "introduce variable" refactoring.  For example:

     Before Refactoring

     var returnedValue = Class.TestMe("somevalue"

     After Refactoring

     var somevalue = "somevalue";
     var returnedValue = Class.TestMe(somevalue<==cursor location after goto last edit

If I introduce a variable for "somevalue", I can use the goto last edit shortcut to return to the location of the TestMe method parameter as long as I don't override the default variable name. 

However, if I rename the variable, go to last edit correctly returns to me the location where I renamed the somevalue.  Is there a navigation shortcut to navigate to the last location prior to "introduce variable" refactoring?  For example,

     After Refactoring

     var changedVariableName = "somevalue";
     var returnedValue = Class.TestMe(changedVariableName<=return cursor HERE after renaming the newly introduced variable

Thanks,

Dave

1 comment

Hello Dave,

Currently it merges edits located nearby to avoid eccessive number of edit
points. We resolved a number of issues with this behavior just yesterday,
but this one is harder to improve in the limited time we have before release.
We definitly want it to be better, but... Wait, I just got an idea... May
be we can fix it, but no promise at this moment. Thanks for heads up!

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


IR> I've been using Resharper for TDD a lot and I was wondering whether
IR> there's a shortcut to navigate to my last edit prior to using
IR> "introduce variable" refactoring. For example:
IR>
IR> * Before Refactoring*
IR>
IR> var returnedValue = Class.TestMe("somevalue"
IR>
IR> * After Refactoring*
IR>
IR> var somevalue = "somevalue";
IR> var returnedValue = Class.TestMe(somevalue*<==cursor location
IR> after goto last edit*
IR> If I introduce a variable for "somevalue", I can use the goto last
IR> edit shortcut to return to the location of the TestMe method
IR> parameter as long as I don't override the default variable name.
IR>
IR> However, if I rename the variable, go to last edit correctly returns
IR> to me the location where I renamed the somevalue. Is there a
IR> navigation shortcut to navigate to the last location prior to
IR> "introduce variable" refactoring? For example,
IR>
IR> After Refactoring
IR>
IR> var changedVariableName = "somevalue";
IR> var returnedValue = Class.TestMe(changedVariableName*<=return
IR> cursor HERE after renaming the newly introduced variable*
IR> Thanks,
IR>
IR> Dave
IR>
IR> ---
IR> Original message URL:
IR> http://www.jetbrains.net/devnet/message/5234072#5234072


0

Please sign in to leave a comment.