-
Notifications
You must be signed in to change notification settings - Fork 231
Add error reporting for the new version solver #1785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This improves some complex error output
This is useful for formatting human-readable error messages.
This was just the root package's directory, which is always the current working directory anyway.
This makes it possible to produce terse output by default while also providing enough detail to diagnose incompatible sources or descriptions.
A thought (for my contrived case)
My attempt at tweaks...
This is 1000x than what we have now. Feel free to tuck this away as a p2 for later. |
@kevmoo What would your proposed output do if the terminal was too narrow to fit the entire first line?
My instinct is that including this level of explanation at every step would make the output in even moderately complex cases a lot more verbose. There comes a point at which explicitness is actually unhelpful because there's so much raw text that peoples eyes gloss over. Is this worth it? |
f440189
to
d4842cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests?
lib/src/solver/failure.dart
Outdated
/// | ||
/// See https://github.com/dart-lang/pub/tree/master/doc/solver.md#error-reporting | ||
/// for details on how this algorithm works. | ||
String toString() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is quite the method! Given that it has state and a number of sub-functions with their own doc comments, I think it's worth moving it out to a separate class that this calls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
lib/src/solver/failure.dart
Outdated
/// If [incompatibility] is only used to derive one other incompatibility, | ||
/// it may make sense to skip that derivation and just derive the second | ||
/// incompatibility directly from three causes. This is usually clear enough | ||
/// to the user, and makes the proof much terser. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give an example? (If that's not easy, feel free to ignore this.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests?
Coming in the next PR. This behavior is mostly covered by the existing failure tests, but I didn't want to add to an already large change by triaging all the tests and migrating them to the new output format.
lib/src/solver/failure.dart
Outdated
/// | ||
/// See https://github.com/dart-lang/pub/tree/master/doc/solver.md#error-reporting | ||
/// for details on how this algorithm works. | ||
String toString() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
lib/src/solver/failure.dart
Outdated
/// If [incompatibility] is only used to derive one other incompatibility, | ||
/// it may make sense to skip that derivation and just derive the second | ||
/// incompatibility directly from three causes. This is usually clear enough | ||
/// to the user, and makes the proof much terser. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
This helps allow tables conserve horizontal space without affecting readability too drastically.
cb2f508
to
8c27f03
Compare
No description provided.