Resharper interferes with the VS2005 macro recorder

This may not be an issue with VS2010; I don't know yet. What I do know is that Resharper interferes with recording (and playing back) macros in Visual Studio 2005. I've always managed to overlook it before, but with a host of changes, many of which may be easily automated using temporary macros, it's becoming rather irritating. Is there some way to make Resharper (I'm using the latest release of the 4.x full version) play nicer with the macro recorder? Or optionally is there some way to disable and re-enable it easily? Thanks in advance.

8 comments
Comment actions Permalink

Hello,

For temporarily suspending R# v4, go to Tools / Add-In Manager. Starting
with R#5, it's a bit different, as described on wiki: http://confluence.jetbrains.net/display/ReSharper/SuspendReSharper5inVisual+Studio
.

What are the problems you're experiencing with Macro Recorder when R# is
running?


Serge Baltic
JetBrains, Inc — http://www.jetbrains.com
“Develop with pleasure!”



0
Comment actions Permalink

Thanks. Now that I know how to do that, I've been able to determine that Resharper screws up the recording process, not playback. Consider the following sample:

Macrotest1.jpg

Let's say Resharper is disabled and I need to change those three calls to append line to do some string formatting. So I place the cursor on the beginning of the first of the calls to StringBuilder.AppendLine and I record a temporary macro. The steps for my macro are:

    1. Hit Ctrl + RightArrow four times to move the cursor to the immediate left of the first double-quote.
    2. Type "string.Format(".
    3. Hit End to move to the end of the line, then LeftArrow to move to the left of the closing semicolon.
    4. Type ")", then press DownArrow and Home to go to the beginning of the line below.


I then end my macro recording and may use the macro to transform the remaining lines. But if Resharper was enabled during the recording process, the following is what I get instead when I try to use the new macro on the next line:

Macrotest2.jpg

That's the most innocuous sort of problem it produces. Suffice it to say, I've found it impossible to make macro recording work properly with Resharper enabled. Thanks for the tip!

0
Comment actions Permalink

Hello,

Thanks for the example. Yes, I see the problem here (I personally would prefer
doing Find&Replace in this case, maybe with regular expressions; and doing
String::Format to feed into a StringBuilder is generally not a good idea
because it creates yet another StringBuilder just to do the format -- but
all this doesn't cancel out the actual bug with ReSharper).

ReSharper has to intercept some of the text editor activities to add some
of its smartness ;) to the editor, that's what could be possibly interfering
with the macro recorder. I don't think it could be quickly fixed or worked
around in some way other than suspending ReSharper temporarily. We'll debug
the case to see if we can do something for the next version. I've filed a
bug at http://youtrack.jetbrains.net/issue/RSRP-180396.


Serge Baltic
JetBrains, Inc — http://www.jetbrains.com
“Develop with pleasure!”


0
Comment actions Permalink

Yeah, I agree with all your comments about the code. It wasn't real code; it was an example snippet. I can see why you might not be able to make Resharper play nice with the macro recorder. But perhaps you could provide a toolbar button (or something similarly useful) for disabling/re-enabling? Or maybe it should just disable itself anytime the macro recorder is active? At any rate, I have a workaround for the moment. Thanks!

0
Comment actions Permalink

Hello,

With R#5, you can have a toolbar button or keyboard shortcut for suspending
ReSharper. As of R#4, there is no such possibility. But I think you could
write a VS macro for that :) if there is any automation for Add-In Manager.

Suspending R# automatically is a questionable idea because on a sizable solution
it takes a noticeable amount of time to load back the solution context.


Serge Baltic
JetBrains, Inc — http://www.jetbrains.com
“Develop with pleasure!”


0
Comment actions Permalink

Hey there, Serge, I had been using the add-in manager method to disable/enable Resharper 4.5, but I recently upgraded to Resharper 5 and do not find the command to which you refer. Can you elaborate on how I might create a toolbar button that disable/enable Resharper 5? Thanks in advance.

0
Comment actions Permalink

Hello,

There're more details on this Wiki page:

http://confluence.jetbrains.net/display/ReSharper/SuspendReSharper5inVisual+Studio


Serge Baltic
JetBrains, Inc — http://www.jetbrains.com
“Develop with pleasure!”


0
Comment actions Permalink

Great! Thanks!

0

Please sign in to leave a comment.