【问题标题】:How do I set up VS Code debugging for a workspace using Angular and Flutter (both Dart)?如何使用 Angular 和 Flutter(都是 Dart)为工作区设置 VS Code 调试?
【发布时间】:2019-04-13 14:01:21
【问题描述】:

我有一个具有以下结构的 VS Code 工作区:

Root
--[core] (basic Dart package)
--[mobile] (Flutter)
--[web] (Angular Dart)

如何为每个包配置调试器?到目前为止,我只有移动办公:

// launch.json
{
   "version": "0.2.0",
   "configurations": [
      {
         "name": "Mobile",
         "program": "mobile/lib/main.dart",
         "request": "launch",
         "type": "dart"
      },
   ]
}

通过 CLI 运行 angular dart 应用程序:

cd [web directory]
pub global activate webdev 
webdev serve

【问题讨论】:

    标签: angular debugging visual-studio-code dart flutter


    【解决方案1】:

    您可以配置新任务并使用以下配置。只需运行任务,它就可以解决问题。

    {
      // See https://go.microsoft.com/fwlink/?LinkId=733558
      // for the documentation about the tasks.json format
      "version": "2.0.0",
      "command": "$HOME/.pub-cache/bin/webdev",
      "type": "shell",
      "args": [],
      "presentation": {
        "echo": true,
        "reveal": "always",
        "focus": false,
        "panel": "shared",
        "showReuseMessage": true,
        "clear": false
      },
      "options": {
        "cwd": "./web"
      },
      "tasks": [
        {
          "label": "serve",
          "args": [],
          "isBackground": true
        }
      ]
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-11-03
      • 2021-12-19
      • 2017-07-26
      • 2021-08-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-13
      相关资源
      最近更新 更多