Visual Studio代码快捷键从当前或封闭代码块中出现
Visual Studio代码中是否有任何快捷方式可以从当前代码块中出现。例如 -
while (!q.isEmpty()) {
Oranges obj = q.pollFirst();
ans = Math.max(obj.time, ans);
for (int[] d : neighbors) {
int r = obj.x + d[0];
int c = obj.y + d[1];
int t = obj.time + 1;//Cursor position
if (r >= 0 && r < grid.length && c >= 0 && c < grid[0].length && grid[r][c] == 1) {
q.offer(new Oranges(r, c, t));
grid[r][c] = 2;
}
}//Target Position
}
在上面的代码中,假设我的光标位于光标位置,我想直接从当前代码块中出来或将循环置于 目标位置。 如果有任何可以做到的扩展名,请建议。
Is there any shortcut in visual studio code to come out of the current block of code. For example -
while (!q.isEmpty()) {
Oranges obj = q.pollFirst();
ans = Math.max(obj.time, ans);
for (int[] d : neighbors) {
int r = obj.x + d[0];
int c = obj.y + d[1];
int t = obj.time + 1;//Cursor position
if (r >= 0 && r < grid.length && c >= 0 && c < grid[0].length && grid[r][c] == 1) {
q.offer(new Oranges(r, c, t));
grid[r][c] = 2;
}
}//Target Position
}
In code above, suppose my cursor is at Cursor position and I want to come directly out of the current block of code or enclosing for-loop to Target Position.
If there is any extension that can do it then please suggest.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(1)
有一个键盘快捷键,称为“转到括号”(
editor.action.jumptobracket
),可让您接近所需的内容。其默认键为 ctrl + shift + \ 。从您拥有
//光标位置
的位置,它将跳到带有//目标位置
的支架内部。因此:如果您使用箭头键很快,则一旦将其放下,就可以通过此操作很快地绕过代码。
There is a keyboard shortcut called "Go to Bracket" (
editor.action.jumpToBracket
) that gets you close to what you want. Its default keys are Ctrl + Shift + \.From where you have
//Cursor position
, it will jump down to the inside of the brace where you have//Target Position
. So:If you are quick with your arrow keys, you could navigate around your code quite fast with this once you get it down.