-
Notifications
You must be signed in to change notification settings - Fork 210
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
Resolver should only throw for severe errors #3828
base: master
Are you sure you want to change the base?
Conversation
Package publishing
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
PR HealthChangelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. |
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.
Thanks! I ran into the exact same issue with @code
a few months ago, I had to go digging, turns out I "fixed" it for only one codepath, the analyzer's "sort directives":
https://dart-review.googlesource.com/c/sdk/+/391740/3/pkg/analysis_server/lib/src/g3/utilities.dart
The parsed results "errors" do indeed include warnings and infos, and it's the correct thing to ignore them here.
Could you please add a unit test? In build_resolvers/test/resolver_test.dart
it should work to copy the are reported
test, add the @code
case instead of the syntax error, and check that it doesn't throw.
I've added the relevant tests |
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.
Looks good, thanks! Let's wait for @jakemac53 to take a look also, this is my first external PR review for build_runner
.
Closes #3827
While using a code generator package I ran into an issue where I was being told that a file had a syntax error.
There was no error, analyzer reported no issues.
After further debugging, it turned out to be a
Doc directive 'hello' is unknown.
error.Because this error is not severe, it should be ignored.
This PR makes build_resolver only throw on severe syntax errors