【问题标题】:Is there way to open DEBUG CONSOLE tab after starting debugging with specified preLaunchTask?使用指定的 preLaunchTask 开始调试后,有没有办法打开 DEBUG CONSOLE 选项卡?
【发布时间】:2017-09-18 00:04:00
【问题描述】:

我使用 preLaunchTask 进行调试配置:

{
    "type": "node",
    "request": "launch",
    "name": "index.js - Build then launch",
    "program": "${workspaceRoot}/node/dist/index.js",
    "cwd": "${workspaceRoot}/node",
    "preLaunchTask": "build"
}

当我开始调试时,vscode 会打开 OUTPUT 选项卡而不是 DEBUG CONSOLE:

开始调试后有没有办法打开DEBUG CONSOLE?我想创建与 DOM UI 交互的扩展,但结果发现扩展无法访问 DOM UI。

【问题讨论】:

    标签: debugging visual-studio-code


    【解决方案1】:

    您可以在启动配置中设置 "internalConsoleOptions": "openOnSessionStart" 以在启动调试会话后始终显示控制台。

    【讨论】:

      【解决方案2】:

      "internalConsoleOptions": "openOnSessionStart" 不足以用于 python 启动配置。

      这也需要

      "purpose": [
          "debug-test"
      ],
      

      launch.json

      {
          // Use IntelliSense to learn about possible attributes.
          // Hover to view descriptions of existing attributes.
          // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
          "version": "0.2.0",
          "configurations": [
              {
                  "name": "Python: Debug Tests",
                  "type": "python",
                  "request": "launch",
                  "program": "${file}",
                  "purpose": [ //
                      "debug-test"
                  ],
                  "console": "integratedTerminal",
                  "justMyCode": false,
                  "internalConsoleOptions": "openOnSessionStart"
              }
          ]
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2019-04-26
        • 2020-03-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-03-28
        相关资源
        最近更新 更多