-
Notifications
You must be signed in to change notification settings - Fork 323
Expose Dart's "why not promoted" information in VS Code #3136
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
Comments
Ah, this work might already have been done? @DanTup, I'll close this issue (but please re-open if you think there's something to do here). |
If the info is in the Non-LSP: Dart-Code/src/extension/providers/dart_diagnostic_provider.ts Lines 52 to 55 in 6966fba
I'm not totally familiar with the "why not promoted" info (your screenshot doesn't look like it's that?) but if there's an example I can use to trigger it I can test in both LSP/non-LSP. |
You should be able to test using this example (it works with the command-line analyzer as of dart-lang/sdk@a42244f): f(int? i, int? j) {
if (i == null) return; // (1)
i = j; // (2)
i.isEven; // (3)
} On the line marked (3) there should be an error message saying Two minor notes:
|
@stereotype441 thanks! In that case, it appears to be working as expected (both under LSP and the original protocol): Clicking on the main error ( |
@DanTup Great! Thanks for checking. |
As of dart-lang/sdk@a42244f, the analyzer now generates context messages in some circumstances explaining why type promotion failed. We would like these messages to show up in VS Code in a way that's easily discoverable.
See also dart-lang/sdk#44897.
(Danny, I'll give you some context on this when we sync up next)
The text was updated successfully, but these errors were encountered: