DanTup · GitHub

@DanTup

VS Code v1.92 will ship with a breaking change (from a new version of NodeJS) that prevents spawning `.bat` files without using `shell: true`. Although Dart-Code uses `shell: true`, the debug adapter is spawned by VS Code and we don't currently have the ability to ask it to use a shell, which means launching the Flutter debugger on Windows is broken.
I've filed microsoft/vscode#224184 and open a PR at microsoft/vscode#224204 but this will not be included in the 1.92 release, so to keep debugging working on Windows, we need a workaround.
This change switches from asking VS Code to run `flutter.bat debug_adapter` to instead running `dart.exe` and using the same args that Flutter would use. This unfortunately bypasses some code (like ensuring everything is up-to-date), however since we'll have already started things like `flutter daemon` at the start of the session, it's very unlikely everything won't already be set up.
Once a better fix is available in VS Code, we should use that and change the scope of the `isUnableToRunBatDebugAdapters` VS Code capability to _only_ the version(s) that require this workaround, because it makes assumptions about flags passed to `dart` that may or may not remain accurate across Flutter SDK versions.
Fixes #5183

Read the original on github.com ↗