Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: pkg/analyzer/lib/src/summary/package_bundle_reader.dart

Issue 1974323003: Add '--dart-sdk-summary' option to analyzer-cli and use SummaryBasedDartSdk. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/src/summary/package_bundle_reader.dart
diff --git a/pkg/analyzer/lib/src/summary/package_bundle_reader.dart b/pkg/analyzer/lib/src/summary/package_bundle_reader.dart
index bad7aefac2fce518a9a7ee0310e68785453898c3..7c6ee3222de9e931c532b279bee876c296cda514 100644
--- a/pkg/analyzer/lib/src/summary/package_bundle_reader.dart
+++ b/pkg/analyzer/lib/src/summary/package_bundle_reader.dart
@@ -134,6 +134,8 @@ class InputPackagesResultProvider extends ResultProvider {
/**
* The [UriResolver] that knows about sources that are served from their
* summaries.
+ *
+ * TODO(scheglov) rename to `InSummaryUriResolver` - it's not `package:` specific.
*/
class InSummaryPackageUriResolver extends UriResolver {
final SummaryDataStore _dataStore;
@@ -186,7 +188,7 @@ class InSummarySource extends Source {
int get hashCode => uri.hashCode;
@override
- bool get isInSystemLibrary => false;
+ bool get isInSystemLibrary => uri.scheme == DartUriResolver.DART_SCHEME;
@override
int get modificationStamp => 0;
@@ -215,6 +217,11 @@ class InSummarySource extends Source {
*/
class SummaryDataStore {
/**
+ * List of all [PackageBundle]s.
+ */
+ final List<PackageBundle> bundles = <PackageBundle>[];
+
+ /**
* Map from the URI of a compilation unit to the unlinked summary of that
* compilation unit.
*/
@@ -238,6 +245,7 @@ class SummaryDataStore {
* Add the given [bundle] loaded from the file with the given [path].
*/
void addBundle(String path, PackageBundle bundle) {
+ bundles.add(bundle);
for (int i = 0; i < bundle.unlinkedUnitUris.length; i++) {
String uri = bundle.unlinkedUnitUris[i];
uriToSummaryPath[uri] = path;
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/summary_sdk.dart » ('j') | pkg/analyzer/lib/src/summary/summary_sdk.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698