ReSharper and auto closing parentheses

别说谁变了你拦得住时间么 提交于 2019-11-29 05:00:29

问题


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...


回答1:


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)

Tested in Visual Studio 2008 with ReSharper 6.0.




回答2:


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.



来源:https://stackoverflow.com/questions/5201429/resharper-and-auto-closing-parentheses

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!