microsoft / vscode-azurestaticwebapps

Azure Static Web Apps extension for VS Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurestaticwebapps
MIT License
88 stars 35 forks source link

Provide dynamic debug configs #557

Closed alexweininger closed 2 years ago

alexweininger commented 2 years ago

Leaving this as a draft because we are waiting for updates on microsoft/vscode#135899 before merging/releasing, but I'd still like to get eyes on it sooner rather than later.

In summary, this PR removes the work I did that manually scaffolded out tasks/launch.json files for debugging and replaces it with dynamic debug configs using a DebugConfigurationProvider [^1].

We are dynamically providing both tasks and debug configs. Each does two things:

  1. Uses the NodeDetector on the root and each subfolder to look for static web apps, if found a task/config is created for that app using the detected framework defaults
  2. If a swa-cli.config.json is present, load configs from there and append them to the detected configs

[^1]: VS Code API - DebugConfigurationProvider

Edit: microsoft/vscode#135899 was fixed and released in insiders, so the PR is ready to go 🎉