谁能解释一下我在互联网上找到的 VSCode 上的这三个调试符号吗?
我的 vs code 有一个带有播放图标的。
所有关于调试的在线演示都有中间的一个。我怎样才能得到它?
此外,已安装 Node js 调试,但我认为它显示为禁用,我找不到启用它的选项。
最佳答案
直接回答你的问题[TL;DR]:如果你使用的是最新版本的 vscode,你已经拥有它了。它将带您进入与右侧相同的 View
如果你查看 codicon 库 ref 你指出的中间那个不存在。
Visual Studio Code 于 2020 年 2 月进行了更改 ref 将运行和调试结合起来,变得更加和谐:
User studies revealed that new users have difficulties finding how to run their programs in VS Code. One reason is that the existing "Debugging" functionality is not something that they relate to "Running" a program. For that reason, we are making "Run" more prominent in the UI.
- The main menu Debug has become the Run menu.
- The Run and Debug view has become the Run view and the corresponding Activity Bar icon now shows a large "Play" icon with a small "bug" decoration.
换句话说,没有区别。 “运行”和“调试” View 是同义词,图标反射(reflect)了这些更改。正如他们所指出的,“调试” View 现在称为“运行” View ,但它仍然提供调试和断点。
但是您遇到了两种可能性:
您使用的教程和指南已过时(显示过时的 vscode 版本)
教程或指南正在使用提供调试功能的扩展。扩展程序可以对您看到的图标进行一些控制
- 根据 2020 年 6 月的 ref,该扩展用于单文件调试 注意,vscode 建议如下:
For debug extensions that want to improve the single file debug experience by adding a "Run" and/or "Debug" button to the editor, we recommend following these guidelines for a consistent look and feel:
- Contribute Run and/or Debug commands in the package.json (see Mock Debug):
- Use the command titles "Run File"/"Debug File" or "Run Python File"/"Debug Python File".
- Use the $(play) icon for Run and $(debug-alt-small) for Debug.
他们的codicon library在哪里于 6 月进行了更新,以反射(reflect)以下内容:
正如您所看到的,它们都没有像“run”这样的措辞作为前缀,但它们都代表相同的功能。
这代表调试输出将进入的面板( View )。
关于visual-studio-code - 需要澄清 vs 代码调试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62844509/