[flutter_tools/dap] Improve rendering of structured errors via DAP#131251
Merged
DanTup merged 6 commits intoflutter:masterfrom Jul 31, 2023
Merged
[flutter_tools/dap] Improve rendering of structured errors via DAP#131251DanTup merged 6 commits intoflutter:masterfrom
DanTup merged 6 commits intoflutter:masterfrom
Conversation
In the legacy VS Code DAP, we would deserialise the Flutter.Error event and provide some basic colouring (eg. stack frames are faded if not from user code) and attaching Source metadata so links are clickable. In the new DAPs we originally used `renderedErrorText` which didn't support either of these. This change adds changes to use the structured data (with some basic parsing because the source classes are in package:flutter and not accessible here) to provide a similar experience. Fixes Dart-Code/Dart-Code#4571.
packages/flutter_tools/lib/src/debug_adapters/error_formatter.dart
Outdated
Show resolved
Hide resolved
packages/flutter_tools/lib/src/debug_adapters/error_formatter.dart
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| enum _DiagnosticsNodeStyle { | ||
| flat, |
Contributor
There was a problem hiding this comment.
are there going to be more values later?
Contributor
Author
There was a problem hiding this comment.
There are other values in the source enum, but this is the only value we currently use for this formatting, so I trimmed the enums just to the used values (otherwise we'd be needlessly keeping them in-sync with the source).
In future it would be nice to extract these classes/enums from package:flutter into a shared package that flutter_tools can use, but I failed to do that cleanly previously because the source types have lots of references to other Flutter framework types.
christopherfujino
approved these changes
Jul 27, 2023
Contributor
christopherfujino
left a comment
There was a problem hiding this comment.
LGTM module a few nits
…tter.dart Co-authored-by: Christopher Fujino <[email protected]>
…tter.dart Co-authored-by: Christopher Fujino <[email protected]>
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jul 31, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jul 31, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jul 31, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jul 31, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jul 31, 2023
LouiseHsu
pushed a commit
to LouiseHsu/flutter
that referenced
this pull request
Jul 31, 2023
…lutter#131251) In the legacy VS Code DAP, we would deserialise the Flutter.Error event and provide some basic colouring (eg. stack frames are faded if not from user code and the text is split between stdout/stderr to allow the client to colour it). In the new DAPs we originally used `renderedErrorText` which didn't support either of these. This change adds changes to use the structured data (with some basic parsing because the source classes are in package:flutter and not accessible here) to provide a similar experience. It would be nicer if we could use the real underlying Flutter classes for this deserialisation, but extracting them from `package:flutter` and removing all dependencies on Flutter is a much larger job and I don't think should hold up providing improved error formatting for the new DAPs. Some comparisons:  
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jul 31, 2023
auto-submit bot
pushed a commit
to flutter/packages
that referenced
this pull request
Aug 1, 2023
Manual roll requested by [email protected] flutter/flutter@1d44fbd...1d59196 2023-07-31 [email protected] Appended period remove & Uri parsing fix. (flutter/flutter#131293) 2023-07-31 [email protected] Fixed regex to show missing assets file error (flutter/flutter#131160) 2023-07-31 [email protected] Update `CheckboxListTile` and `CalendarDatePicker` tests for M2/M3 (flutter/flutter#131363) 2023-07-31 [email protected] Reland --omit-type-checks for benchmarks. (flutter/flutter#131493) 2023-07-31 [email protected] Update the cirrus key jul-31-2023 (flutter/flutter#131624) 2023-07-31 [email protected] Add Expanded/Collapsed State for Semantics (flutter/flutter#131233) 2023-07-31 [email protected] Reland - "Update Unit Tests for M2/M3" (flutter/flutter#131504) 2023-07-31 [email protected] Roll Flutter Engine from ae6d1d60df95 to b83172a4e995 (4 revisions) (flutter/flutter#131614) 2023-07-31 [email protected] Upgrade compile and target sdk versions in tests and benchmarks (flutter/flutter#131428) 2023-07-31 [email protected] Roll Flutter Engine from b11a832ea7d4 to ae6d1d60df95 (1 revision) (flutter/flutter#131611) 2023-07-31 [email protected] Roll Packages from 10aab44 to 60e9a54 (6 revisions) (flutter/flutter#131607) 2023-07-31 [email protected] Fix dartdoc for `ButtonSegment` constructor (flutter/flutter#131400) 2023-07-31 [email protected] [flutter_tools/dap] Improve rendering of structured errors via DAP (flutter/flutter#131251) 2023-07-31 [email protected] [doc] Fix module_test_ios comments (flutter/flutter#131470) 2023-07-31 [email protected] Use Flutter app project's NDK version from FFI plugin (flutter/flutter#131141) 2023-07-31 [email protected] Roll Flutter Engine from 22f9aad5aba5 to b11a832ea7d4 (2 revisions) (flutter/flutter#131597) 2023-07-31 [email protected] Roll Flutter Engine from b84c93601684 to 22f9aad5aba5 (3 revisions) (flutter/flutter#131592) 2023-07-31 [email protected] Roll Flutter Engine from d95adb9c8bc6 to b84c93601684 (1 revision) (flutter/flutter#131585) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
vashworth
pushed a commit
to vashworth/flutter
that referenced
this pull request
Aug 2, 2023
…lutter#131251) In the legacy VS Code DAP, we would deserialise the Flutter.Error event and provide some basic colouring (eg. stack frames are faded if not from user code and the text is split between stdout/stderr to allow the client to colour it). In the new DAPs we originally used `renderedErrorText` which didn't support either of these. This change adds changes to use the structured data (with some basic parsing because the source classes are in package:flutter and not accessible here) to provide a similar experience. It would be nicer if we could use the real underlying Flutter classes for this deserialisation, but extracting them from `package:flutter` and removing all dependencies on Flutter is a much larger job and I don't think should hold up providing improved error formatting for the new DAPs. Some comparisons:  
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the legacy VS Code DAP, we would deserialise the Flutter.Error event and provide some basic colouring (eg. stack frames are faded if not from user code and the text is split between stdout/stderr to allow the client to colour it).
In the new DAPs we originally used
renderedErrorTextwhich didn't support either of these. This change adds changes to use the structured data (with some basic parsing because the source classes are in package:flutter and not accessible here) to provide a similar experience.It would be nicer if we could use the real underlying Flutter classes for this deserialisation, but extracting them from
package:flutterand removing all dependencies on Flutter is a much larger job and I don't think should hold up providing improved error formatting for the new DAPs.Some comparisons:
(fyi @jacob314 @christopherfujino)
Fixes Dart-Code/Dart-Code#4571.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.