VS Code——通过键盘跳转到当前调试位置
VS Code – jump to current debugging position via keyboard
在VS Code中,如何跳转到调试器的当前位置?它由一条淡黄色的线表示,但我在浏览其他文件和函数时往往会迷路,只能努力找到返回调试会话当前暂停位置的方法。
应该很简单,但我在文档中找不到任何内容。我什至在键盘映射中完成了所有包含 'debug' 的操作,但没有找到我要找的东西。
似乎没有任何 go to current breakpoint
命令,只有上一个和下一个命令。
不过,我发现这个 "bug" 可能有用:请参阅 repl evaluation causes editor to jump to current breakpoint!
因此您只需聚焦 repl,Enter 即可跳转到当前断点。它确实会用 undefined
结果污染您的调试控制台,但也许这是可以接受的。
或者您可以将键绑定分配给执行焦点命令并一次性清除调试控制台的宏。使用您选择的宏扩展 - 我正在使用 multi-command below - 这将进入您的设置:
"multiCommand.commands": [
{
"command": "multiCommand.gotoCurrentBreakpoint",
// "interval": 350,
"sequence": [
"workbench.debug.action.focusRepl",
"repl.action.acceptInput",
// following command clears the debug console if you wish
"workbench.debug.panel.action.clearReplAction"
]
}
]
和一些键绑定:
{
"key": "alt+/",
"command": "extension.multiCommand.execute",
"args": { "command": "multiCommand.gotoCurrentBreakpoint" },
},
底层 "bug" - 如果它是一个错误 - 将在那里使用多长时间......?
通过单击(或select使用键盘)“调用堆栈”视图中最顶部的条目可以实现所需的效果(跳转到当前执行点)。
使用 multi-command macro extension (inspired by ),可以创建一个自定义命令,它总是 select 调用堆栈视图中的最顶层条目。
这会转到您的 keybindings.json
:
{
"key": "cmd+f4",
// Go to current debugging position
"command": "extension.multiCommand.execute",
"args": {
"sequence": [
"workbench.debug.action.focusCallStackView",
"list.clear",
"list.focusFirst",
"list.select"
// optional, to focus your editor:
// workbench.files.action.focusOpenEditorsView
]
}
},
在VS Code中,如何跳转到调试器的当前位置?它由一条淡黄色的线表示,但我在浏览其他文件和函数时往往会迷路,只能努力找到返回调试会话当前暂停位置的方法。
应该很简单,但我在文档中找不到任何内容。我什至在键盘映射中完成了所有包含 'debug' 的操作,但没有找到我要找的东西。
似乎没有任何 go to current breakpoint
命令,只有上一个和下一个命令。
不过,我发现这个 "bug" 可能有用:请参阅 repl evaluation causes editor to jump to current breakpoint!
因此您只需聚焦 repl,Enter 即可跳转到当前断点。它确实会用 undefined
结果污染您的调试控制台,但也许这是可以接受的。
或者您可以将键绑定分配给执行焦点命令并一次性清除调试控制台的宏。使用您选择的宏扩展 - 我正在使用 multi-command below - 这将进入您的设置:
"multiCommand.commands": [
{
"command": "multiCommand.gotoCurrentBreakpoint",
// "interval": 350,
"sequence": [
"workbench.debug.action.focusRepl",
"repl.action.acceptInput",
// following command clears the debug console if you wish
"workbench.debug.panel.action.clearReplAction"
]
}
]
和一些键绑定:
{
"key": "alt+/",
"command": "extension.multiCommand.execute",
"args": { "command": "multiCommand.gotoCurrentBreakpoint" },
},
底层 "bug" - 如果它是一个错误 - 将在那里使用多长时间......?
通过单击(或select使用键盘)“调用堆栈”视图中最顶部的条目可以实现所需的效果(跳转到当前执行点)。
使用 multi-command macro extension (inspired by
这会转到您的 keybindings.json
:
{
"key": "cmd+f4",
// Go to current debugging position
"command": "extension.multiCommand.execute",
"args": {
"sequence": [
"workbench.debug.action.focusCallStackView",
"list.clear",
"list.focusFirst",
"list.select"
// optional, to focus your editor:
// workbench.files.action.focusOpenEditorsView
]
}
},