简体   繁体   中英

How do I set up VS Code debugging for a workspace using Angular and Flutter (both Dart)?

I have a VS Code workspace with the following structure:

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

How do I configure the debugger for each package? So far, I only have mobile working:

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

To run the angular dart app through CLI:

cd [web directory]
pub global activate webdev 
webdev serve

You can configure a new task and use the following configuration. just run the task and it will do the trick.

{
  // 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
    }
  ]
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM