ReSharper in Detail: Complete Statement Scenarios
May 16th, 2008 by Jura GorohovskyAs you might already know, Complete Statement (Ctrl+Shift+Enter) is one of major enhancements in Code Completion brought by ReSharper 4.0. This feature inserts necessary syntax elements to complete the current statement or another language construct, and gets you in position to write your code further.
Complete Statement is currently known to work with the following language constructs:
- Type members: class, interface, struct, enum, delegate, field, event, and method declarations;
- Statements: if, while, do, switch, using, lock, continue, break, and return statements; case and default clauses; conversion of single-line statements to block statements;
- Expressions: invocation, element access, string/char literals; object, member, and collection item initializers; expressions that create anonymous types and implicitly typed arrays.
Below are a number of specific examples of the assistance that Complete Statement provides in specific contexts.
Class declaration
Before Complete Statement:
After Complete Statement:
Delegate declaration
Before Complete Statement:
After Complete Statement:
Method declaration
Before Complete Statement:
After Complete Statement:
Nested method invocation
Before Complete Statement:
After Complete Statement:
if statement
Before Complete Statement:
After Complete Statement:
case clause
Before Complete Statement:
After Complete Statement:
Conversion of a single-line statement into block
Before Complete Statement:
After Complete Statement:
Element access expression
Before Complete Statement:
After Complete Statement:
Tags: ReSharper

May 17th, 2008 at 11:22 pm
Love it.
November 9th, 2011 at 7:59 pm
It is sweet! But why have you left out support for class-level const declarations?
November 11th, 2011 at 11:43 am
@Peter Have we? This looks like a bug. Can you please report it in the bug tracker? Thank you