views:

42

answers:

2

My cursor (the pipe) is inside the body of the child class.

public class BarContext : FooContext {
    |
}

I type "override" and press tab to view a list of methods in FooContext which I can override. "Context" is one of the options, so I select that.

public class BarContext : FooContext {
    protected override void Context() {
        |base.Context();
    }
}

VS generates the override method for me and places my cursor (again, the pipe) just before the call to the base method.

How can I make VS finish my cursor after the base method call (or on a new line below it) -- but still within the override method, of course?

A: 

I'm not aware of anyway to change that behavior.

Just get used to hitting END > ENTER afterwards. :)

Chris Martin
I can also press Ctrl-Enter to create a new empty line below and have my cursor moved automatically from before "base." to immediately below, on the new, empty line.
lance
+1  A: 

As Ilya correctly pointed out, what you're showing is the default behavior of Visual Studio.

Here's how you can do what you want with ReSharper.

Go to ReSharper > Options > Languages > Common > Members Generation and make sure that "Generated member default body style" is set to "Return default value". This will force ReSharper to generate base calls in overridden methods.

As soon as you have an inheriting class declaration that derives from a base class, press Alt+Ins and select "Overriding members" in the pop-up menu. Select which members to override (there will be Object methods in addition to the methods of your base class) and click Finish.

As a result, ReSharper will generate the overriding methods with base calls and the caret right after the base call in the first of them.

gorohoroh