-
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
Simpler in memory filesystem #3823
Simpler in memory filesystem #3823
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. |
a8fb66b
to
d103d23
Compare
…Filesystem. Implement the analyzer interfaces rather than using it's in-memory filesystem, which provides a lot of unused functionality. Simplify `AnalysisDriverModel` and `BuildAssetUriResolver`. Add unit test.
d103d23
to
f3c86e3
Compare
CI found some test failures, please hold off on reviewing while I take a look :) |
One of the "unused" methods was used ;) now implemented, PTAL. |
/// | ||
/// Returns null if the Uri cannot be parsed. | ||
static AssetId? parseAsset(Uri uri) { | ||
if (const ['dart', 'dart-ext'].any(uri.isScheme)) return null; |
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.
Can't we write this similar to the line below instead?
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.
Oh, actually this line is not needed at all, it will anyway fall through and return null
. (This was copied existing code but with the consts inlined).
Removed. Thanks.
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 :)
/// | ||
/// Returns null if the Uri cannot be parsed. | ||
static AssetId? parseAsset(Uri uri) { | ||
if (const ['dart', 'dart-ext'].any(uri.isScheme)) return null; |
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.
Oh, actually this line is not needed at all, it will anyway fall through and return null
. (This was copied existing code but with the consts inlined).
Removed. Thanks.
/// | ||
/// Tracks modified paths, which should be passed to | ||
/// `AnalysisDriver.changeFile` to update the analyzer state. | ||
class AnalysisDriverFilesystem implements UriResolver, ResourceProvider { |
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.
Ouch. I did not expect that clients will start implementing ResourceProvider
.
This will potentially complicate making any change to this interface.
For #3811.
Switch from using the analyzer's in memory filesystem implementation, which does a lot of things that are not needed, to a local implementation that does only what is needed.
Improvements: