Resharper 大括号自动格式化
我对 Resharper 和自动格式化大括号有疑问。 有一段时间,当我输入左大括号时,Resharper 不再添加右大括号。 此外,当我在方法的最后一行键入右大括号时,该方法的右大括号将被删除。
示例:
private void Method()
{
if(true)
{ // If I type '{' resharper of vs2010 will normally add a '}'
// but I don't know why not now
}
private void AnotherMethod(){}
如果 am am 手动添加右大括号,则该方法的右大括号将被删除,并且 AnotherMethod()
会缩进。
private void Method()
{
if(true)
{
} // Why is the closing brace of the method removed?
private void AnotherMethod(){}
我的resharper的相关设置:
格式样式>大括号布局:
- 大括号布局:适用于所有在下一行(BSD 样式)(以及空大括号格式:在不同行 )
- 强制大括号:对于所有添加大括号
IntelliSence >完成行为:
- 启用:完成后自动插入括号
+- 选择:打开和关闭
编辑器
- 启用:自动插入右大括号
+-已选择:在输入左大括号时
解决此问题所需的 resharper 设置是什么?
I have a problem with Resharper and auto formating braces.
Since a while Resharper don't add closing braces while I am typing an opening brace.
Also when I am typing a closing brace at the last line of a method, the closing brace of the method will be removed.
Example:
private void Method()
{
if(true)
{ // If I type '{' resharper of vs2010 will normally add a '}'
// but I don't know why not now
}
private void AnotherMethod(){}
If am am manually add the closing brace the closing brace of the method is removed and AnotherMethod()
is indented.
private void Method()
{
if(true)
{
} // Why is the closing brace of the method removed?
private void AnotherMethod(){}
My related settings of resharper:
Formatting style > Braces Layout:
- Braces Layout: for all At next line (BSD style) (and Empty braces formatting: On different lines)
- Force Braces: for all Add braces
IntelliSence > Completion Behavior:
- Enabled: Automatically insert parentheses after completion
+- selected: Both opening and closing
Editor
- Enabled: Auto-insert closing brace
+-selected: On typing an opening brace
What are the required resharper settings to solve this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论