快捷方式可同时切换已注释和未注释的代码

问题描述 投票:1回答:1

在Visual Studio Code中,快捷键Ctrl + /使您可以注释选定的行(如果以前没有注释该行,或者如果注释了每行,则取消注释/切换注释/。)>

是否有可能撤消评论?因此,请关闭所有注释行,并为选定代码块中的任何未注释行开启注释?

例如,现在:

line 1    \                 // line 1
line 2     -> [Ctrl + /] -> // line 2
// line 3 /                 // // line 3

预期:

line 1    \                   // line 1
line 2     -> [Ctrl + ???] -> // line 2
// line 3 /                   line 3

在Visual Studio Code中,快捷键Ctrl + /允许您注释选定的行(如果以前没有注释行,或者如果注释了每行,则取消注释/切换注释/。是否有可能...

visual-studio-code comments toggle vscode-settings
1个回答
0
投票

您可以通过一个额外的命令轻松完成此操作:

© www.soinside.com 2019 - 2024. All rights reserved.