Reputation: 5
How can I set auto inserting curly brackets after loop/IF + [ENTER] in C# ReSharper 8.2.3?
Example:
if (statement) //+[ENTER]
should gives me:
if (statement)
{
//CURSOR HERE
}
Upvotes: 0
Views: 498
Reputation: 18583
You can use ReSharper's Complete Statement command to auto-insert the braces for you. This is Ctrl+Shift+Enter. It's useful all over the place, automatically inserting semi-colons and closing brackets and so on.
Upvotes: 0
Reputation: 1185
I don't know if it will insert both braces for you, however, there is an option to complete your brace. I.e., if you type:
if(statement) // + {
it will auto add and format your braces to be on the next line as follows
if(statement)
{
// Cursor here
}
From the IDE, the option is in TOOLS -> Options -> ReSharper, "Options...". then under Environment -> Editor -> Editor Behavior Check the 'Auto-insert closing brace and choose the first option.
Upvotes: 1