Mat*_*att 18 resharper curly-braces visual-studio-2010 curly-brackets
Visual Studio 2010中是否有键盘快捷键(我也使用ReSharper 6.1),这将允许我用大括号包围选定的文本块?我尝试了"Surround With ..." (Ctrl + K,Ctrl + S),但我没有看到列表中的选项来选择花括号作为周围元素.这个的常见用例是我将有一个if语句,如下所示:
if (conditional)
statement1;
// the rest of the program
Run Code Online (Sandbox Code Playgroud)
我会发现在if语句中需要执行一些额外的任务并添加它们:
if (conditional)
statement1;
statement2;
statement3;
// the rest of the program
Run Code Online (Sandbox Code Playgroud)
然后,我记得我需要用花括号包装所有语句,代码应该看起来像这样:
if (conditional)
{
statement1;
statement2;
statement3;
}
// the rest of the program
Run Code Online (Sandbox Code Playgroud)
我想要做的只是选择三个语句,然后点击快捷键将它们包装在花括号中.我实际上最终做的是将光标移动到条件之后的行的开头,然后键入{字符,然后删除}字符,ReSharper(无用)在{之后立即自动插入,然后将光标向下移动到结尾块的最后一个语句和输入}来完成块.
归档时间: |
|
查看次数: |
3498 次 |
最近记录: |