需要澄清 vs 代码调试

Need clarification on vs code debug

谁能解释一下我在网上找到的 VSCode 这三个调试符号?

我的 vs 代码有一个带有播放图标的。

在线调试的所有demo都是中间那个。我如何获得它?

此外,节点 js 调试已安装,但我认为它显示为已禁用,我找不到启用它的选项。

直接回答你的问题 [TL;DR]:如果你使用的是最新版本的 vscode,你已经拥有它了。它将带您到与右侧相同的视图


如果你查看 codicon 库 ref 你指出的中间那个不存在。

Visual Studio 代码在 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.

所以换句话说,没有区别。 'Run' 和 'Debug' 视图是同义词,图标反映了这些变化。正如他们所说,调试视图现在称为 'Run' 视图,但它仍然提供调试和断点。

然而,您 运行 有 2 种可能性:

  1. 您使用的教程和指南已过时(显示 vscode 的过时版本)

  2. 教程或指南使用的是提供调试功能的扩展。扩展程序可以控制您看到的图标

    • 扩展用于单文件调试,根据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 月更新以反映以下内容:

如您所见,其中 none 以 'run' 之类的措辞作为前缀,但它们都代表相同的功能。

另外,您可能还会看到这个图标:

这代表调试输出的面板(视图)。