-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
LibraryElement.parts broken in analyzer 4.3.0 and newer #49566
Comments
OTOH, |
Yeah, there's already an open PR to move to
breaks backwards compatibility. |
I agree that this was a breaking change. But it is too late to publish it as I ran this change over large number of clients, and it affected only one in a tiny way. So, I would recommend for an affected client to publish a new version that restricts supported |
Might not be, it's possible to retract versions within 7 days so there may be a few hours left to retract In case anyone ends up here from Github issue search or googling the same problem, here's at least one way to access the URIs of part directives using // CaseElement clazz = ...;
Iterable<Uri> partUris = clazz.library.parts2
.map((e) => e.uri)
.whereType<DirectiveUriWithRelativeUri>()
.map((e) => e.relativeUri); Or if you just need the URI as a string: // CaseElement clazz = ...;
Iterable<String> partUriStrings = clazz.library.parts2
.map((e) => e.uri)
.whereType<DirectiveUriWithRelativeUriString>()
.map((e) => e.relativeUriString); See also the discussion at Milad-Akarie/auto_route_library#1165 |
closing as there is a workaround. |
The latest updates to
analyzer
seem to have brokenLibraryElement.parts
in at least some cases. Theauto_route
project uses that field in its code generator. With version4.3.0
or newer ofanalyzer
, theparts
field is empty even when there is a part directive in the file, which causes the generator to break. I have a separate bug open against that project at Milad-Akarie/auto_route_library#1172I bisected the
analyzer
package and found the issue was introduced in d19e1d1. Unfortunately that commit contains a lot of code and I'm not familiar with theanalyzer
internals, so that's when I stopped investigating and filed this issue.The text was updated successfully, but these errors were encountered: