Chromium Code Reviews
DescriptionFix regression in import fixups introduced by .packages support.
With the introduction of support for ".packages" files, analysis
server now uses a slightly different code path for translating the
Source objects from imported package files into "package:" URI's.
Previously it used PackageUriResolver.resolveAbsolute(); now it uses
ResourceUriResolver.resolveAbsolute(), and then translates the
resulting file: URI to a package: URI uring the .packages file.
The old code path used Source.fullName (the file path) to locate the
file in the filesystem; the new code path uses Source.uri. This
causes problems because when figuring out the correct import statement
to insert, the analysis server creates a bogus Source object whose uri
field is null. As a result, import fixups were getting relative paths
like "../../../../.pub-cache/..." rather than package imports, which
is clearly wrong.
As a short term non-invasive fix, we set Source.uri in the bogus
Source object, so that the new codepath is able to find the path of
the imported file.
R=brianwilkerson@google.com
Committed: https://github.com/dart-lang/sdk/commit/f3f52d4b59081e2f294126ac7f69f902968692d7
Patch Set 1 #Patch Set 2 : Cleaner fix #
Messages
Total messages: 4 (1 generated)
|
|||||||||||||||||||||||||||||||||||||