Recording Alt-Enter Selections in Macro

Is there anyway to record the selected quick fix from an Alt-Enter into a
macro?  I am finding that at times I want to record a series of R#
interactions into a macro due to some specialized cleanup that I am doing on
an older legacy codebase.  The things that I am doing are:

  1. Changing the scope of a variable
  2. Selecting the default rename selection (due to the variable name not
matching the renaming conventions defined).

Is this possible, and if so, how?  Or, if not, is there DTE commands that I
can enter into the macro to facilitate this?

1 comment
Comment actions Permalink


I'm afraid there's currently no good API for that.
Exposing a powerful yet simple macro API is a large task on its own, and
we do not have enough resources to implement it at the moment.

One option is writing a ReSharper plugin (see R# PowerToys for samples).
This requires some bit of a knowledge of the R# code model.

Another option is using standard UI Automation for invoking the activities,
which we'd also use for our live tests on the product. The advantage is that
this does not involve any R#-specific knowledge. The only issue is that you
have to explicitly activate UIA support on our context menu (via a late-bound
call) to have them visible in the UIA model. This is because UIA requires
netfx 3 and we'd only reference netfx 2 by default.

Serge Baltic
JetBrains, Inc —
“Develop with pleasure!”


Please sign in to leave a comment.