Dart-Code: Debug Console doesn't add clickable links for stdout output when using new Flutter SDK debug adapters

Describe the bug Until about a week ago in the PREVIEW release, clickable code links were showing up on the right side of the “Debug Output” window if the format was using this format: <Regular output> (<package>:<file path>:<line number>:<column number>) It was convenient.

Now the code appears unformatted and unclickable. I checked to see if there might have been a setting that got turned off but couldn’t find anything to enable that feature.

Note the release version of the plugin still works as described

To Reproduce Steps to reproduce the behavior:

  1. Print to the console with say: print('New route pushed: ServicesRoute (package:app/router.dart:61:9)'

Expected behavior The above line should produce a clickable link on the right side

Screenshots Release version Release version of extension

Current Pre Release Pre Release of extension

Please complete the following information:

  • Operating System and version: Windows 10
  • VS Code version: 1.81.1
  • Dart extension version: v3.71.20230831 pre release
  • Dart/Flutter SDK version: 3.1.0 (stable)
  • Target device (if the issue relates to Flutter debugging): Android

About this issue

  • Original URL
  • State: open
  • Created 10 months ago
  • Reactions: 12
  • Comments: 19 (8 by maintainers)

Most upvoted comments

The reason you saw this in the pre-release and v3.72 and not in v3.70 is that in v3.72 (and the recent pre-releases) I increased the percentage of users that get the new SDK debug adapters. These are better in most ways, but have the issue described above.

Switching to v3.70 works, but you can also switch back to the original debug adapters (in v3.72) by adding the following to your VS Code user settings JSON:

// Force new debug adapters off
// https://github.com/Dart-Code/Dart-Code/issues/4711
"dart.previewSdkDaps": false,

The latest versions of Flutter (master and perhaps beta) have the structured errors issue resolved. I need to do some more testing of your examples above to figure out whether there’s still more (non-structured-errors) output that was previously handled but is not now though.

@adrianvintu

Some workaround? This is how we catch errors:

I don’t have any good workaround (besides using legacy adapters, but that’s not great), but if you only need Sentry for release builds, I wonder if you could skip setting FlutterError.onError for debug builds so the normal Flutter handling occurs?

@larssn

Maybe a restart of VSCode was needed after setting dart.useLegacyDebugAdapters

No restart of VS Code should be required, but you will need to start a new debug session (the setting is read during the debug session start).

Note: Using useLegacyDebugAdapters is not a good long-term fix because the legacy adapters are not getting new features as the language evolves.

I do hope to look at this soon, but it needs some refactoring across both Dart + Flutter debug adapters (and because of how the Dart adapter rolls into Flutter, this isn’t as straightforward as I’d like).

Hey, the "dart.previewSdkDaps": false is gone on v3.82.0, any way to force the previous debug adapters without downgrading the vscode dart extension? Currently on 3.16.5 Flutter SDK

"dart.useLegacyDebugAdapters": true