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

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

Issue 1565283002: Add uriOffset and uriEnd to the summary. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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/summarize_elements.dart
diff --git a/pkg/analyzer/lib/src/summary/summarize_elements.dart b/pkg/analyzer/lib/src/summary/summarize_elements.dart
index 35b28eb0973c533882a823ab7ebddda304c81d18..b2e073986ffc95a547f6b8ec549158b629a30b70 100644
--- a/pkg/analyzer/lib/src/summary/summarize_elements.dart
+++ b/pkg/analyzer/lib/src/summary/summarize_elements.dart
@@ -207,13 +207,17 @@ class _LibrarySerializer {
b.libraryName = libraryElement.name;
}
b.publicNamespace = encodeUnlinkedPublicNamespace(ctx,
- exports: libraryElement.exports.map(serializeExport).toList(),
+ exports: libraryElement.exports.map(serializeExportPublic).toList(),
parts: libraryElement.parts
- .map((CompilationUnitElement e) =>
- encodeUnlinkedPart(ctx, uri: e.uri))
+ .map((CompilationUnitElement e) => e.uri)
.toList(),
names: names);
+ b.exports = libraryElement.exports.map(serializeExportNonPublic).toList();
b.imports = libraryElement.imports.map(serializeImport).toList();
+ b.parts = libraryElement.parts
+ .map((CompilationUnitElement e) =>
+ encodeUnlinkedPart(ctx, uriOffset: e.uriOffset, uriEnd: e.uriEnd))
+ .toList();
} else {
// TODO(paulberry): we need to figure out a way to record library, part,
// import, and export declarations that appear in non-defining
@@ -432,10 +436,22 @@ class _LibrarySerializer {
}
/**
- * Serialize the given [exportElement] into an [UnlinkedExport].
+ * Serialize the given [exportElement] into an [UnlinkedExportNonPublic].
+ */
+ UnlinkedExportNonPublicBuilder serializeExportNonPublic(
+ ExportElement exportElement) {
+ UnlinkedExportNonPublicBuilder b = new UnlinkedExportNonPublicBuilder(ctx);
+ b.uriOffset = exportElement.uriOffset;
+ b.uriEnd = exportElement.uriEnd;
+ return b;
+ }
+
+ /**
+ * Serialize the given [exportElement] into an [UnlinkedExportPublic].
*/
- UnlinkedExportBuilder serializeExport(ExportElement exportElement) {
- UnlinkedExportBuilder b = new UnlinkedExportBuilder(ctx);
+ UnlinkedExportPublicBuilder serializeExportPublic(
+ ExportElement exportElement) {
+ UnlinkedExportPublicBuilder b = new UnlinkedExportPublicBuilder(ctx);
b.uri = exportElement.uri;
b.combinators = exportElement.combinators.map(serializeCombinator).toList();
return b;
@@ -457,6 +473,8 @@ class _LibrarySerializer {
b.isImplicit = true;
} else {
b.uri = importElement.uri;
+ b.uriOffset = importElement.uriOffset;
+ b.uriEnd = importElement.uriEnd;
}
addTransitiveExportClosure(importElement.importedLibrary);
prelinkedImports.add(serializeDependency(importElement.importedLibrary));
« no previous file with comments | « pkg/analyzer/lib/src/summary/resynthesize.dart ('k') | pkg/analyzer/test/src/summary/resynthesize_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698