-
Notifications
You must be signed in to change notification settings - Fork 206
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 can't resolve library not transitively imported from primary input #493
Comments
Are you running wrapped as a What is the use case for resolving a library which is not imported? Supporting resolution will be tough since the analyzer code expects files to be available synchronously while builds can only read assets asynchronously. |
No it's a bare The strange thing is that I was expecting that calling |
... and the file I'm going to analyze is part of the current project, it doesn't resides in another - not imported - package. |
Ya, this is a known issue that was a side effect of some of the simplification around the resolver apis. Today you can only resolve dart code that is reachable from your primary input, primarily for performance reasons. When we move away from the |
Yeah I think we stand a much better chance at resolving this in |
Ok. In the meanwhile I have resorted on using my own |
I've created a
Builder
that accept an HTML file as its primary input but needs to analyze some dart files to accomplish its task.Trying to use
buildStep.resolver.isLibrary(assetId)
/getLibrary(assetId)
with a valid dart libraryassetId
always returnsfalse
or throws (the latter). It behaves like if theresolver
didn't actually knows anything about the asset. This doesn't change even if a previously callcanRead
orreadAsString
on the same assets.If I make the builder accept the dart file as primary input (only to investigate the problem) then the resolver works.
The text was updated successfully, but these errors were encountered: