ReSharper and auto closing parentheses

10k Views Asked by At

Is there a way to avoid closing the following parentheses:

String.Format(), or Console.WriteLine() automatically?

Sometimes is this is annoying and unnecessary, and I end up pressing Delete to remove it.

I tried disabling Auto-insert pair brackets, pharentheses and quotes and Auto-insert closing brace and it is still not working...

2

There are 2 best solutions below

0
On

In Resharper 9.2, I had the same items unchecked as given in Devendra's answer, but still experienced lag when typing parentheses and brackets.

I found that these issues went away by setting Do not complete on values as found in Resharper >> Options > Environment > IntelliSense > Completing Characters. In the Dialog pane that appears, I set the Do not complete on field to (){}. for C# and JavaScript.

4
On

The following options should be unchecked/checked in Resharper if you do not want autocomplete feature on parenthesis (all options can be accessed through Visual Studio > ReSharper > Options... > Environment)

To disable parenthesis auto insert in non method calls (as pointed out in the question, you have already disabled it)

  • Editor > Auto-insert pair brackets, pharentheses and quotes (unchecked)
  • Editor > Auto-insert closing brace (unchecked)

To disable parenthesis auto insert in method calls

  • Intellisense > Completion Behavior > Automatically insert parenthesis after completion > Opening only (enabled)

    Automatically insert parenthesis after completion

Tested in Visual Studio 2008 with ReSharper 6.0.