你可以如何一次性标记多行以在Visual Studio Code中进行调试?

huangapple go评论65阅读模式
英文:

How can I mark multiple lines at once for debugging in visual studio code?

问题

如何在 Visual Studio Code 中快速为调试将 Python 函数中从第 4 行到第 27 行的每一行都标记为红色点,而无需逐个标记每一行?逐个标记每一行非常慢且繁琐。

英文:

For example I have a python function that goes from line 4 to 27. How do I quickly mark every line with red dot in visual studio code for debugging without having to mark each line individually? It is super slow and tedious having to mark them one by one.

答案1

得分: 1

有可能有更好的选择来实现你想要的功能。你可以在你想要在其中断点的代码行上设置断点,然后不要在后续执行的代码行上设置断点,只需使用调试器的“步过”功能。另请参阅VS Code调试器操作文档

> 步过 <kbd>F10</kbd>
> 将下一个方法作为单个命令执行,而不检查或跟踪其组成步骤。

我尝试了在谷歌上搜索“github vscode issues add breakpoint multiple consecutive lines”,看看是否有人已经提出了与你所要求的完全相符的功能请求,但在前几个搜索结果中似乎没有找到任何匹配项。如果使用“步过”功能不能解决你的问题,你可以提出一个功能请求,要求添加这样的功能。如果你这样做,请确保提供足够的细节,以理解你的请求以及所需功能的示例/如何使用。然后,请在这里发表评论,附上你的问题链接,如果你创建了问题票证的话。

英文:

There might be a better alternative to get what you want. You can set a breakpoint at whichever lines of code are executed first that you want to break upon, and then instead of putting breakpoints on the lines of code that are executed after, just use the "step over" feature of the debugger. See also the VS Code docs on Debugger Actions:

> Step Over <kbd>F10</kbd>
> Execute the next method as a single command without inspecting or following its component steps.

I tried googling "github vscode issues add breakpoint multiple consecutive lines" to see if someone had already raised a feature request for exactly what you asked for, but didn't see anything that looked like a match in the top search results. If using "step over" doesn't solve your problem, you can raise a feature-request asking for such a feature to be added. If you do, make sure to provide enough detail to understand what you are asking for and an example of what it would look like / how to use the feature you want. And then please do comment here with a link to you issue ticket if/when you create it.

huangapple
  • 本文由 发表于 2023年6月6日 04:32:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/76409813.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定