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

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

Issue 1712313002: Get LibraryElement(s) and CompilationUnitElement(s) from summary. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/task/dart.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/summary_sdk.dart
diff --git a/pkg/analyzer/lib/src/summary/summary_sdk.dart b/pkg/analyzer/lib/src/summary/summary_sdk.dart
index 2108b74797cc4b6cb8b7994a5e683b3f5502a06f..25caa9341536e0aa6cde66687fb71ceb5063ee4a 100644
--- a/pkg/analyzer/lib/src/summary/summary_sdk.dart
+++ b/pkg/analyzer/lib/src/summary/summary_sdk.dart
@@ -8,6 +8,7 @@ import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/src/context/cache.dart' show CacheEntry;
import 'package:analyzer/src/context/context.dart';
+import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/dart/element/type.dart';
import 'package:analyzer/src/generated/constant.dart';
import 'package:analyzer/src/generated/engine.dart';
@@ -89,6 +90,18 @@ class SdkSummaryResultProvider implements SummaryResultProvider {
// throw new UnimplementedError('$result of $target');
}
}
+ if (target is LibrarySpecificUnit) {
+ if (result == COMPILATION_UNIT_ELEMENT) {
+ String uri1 = target.library.uri.toString();
+ String uri2 = target.unit.uri.toString();
+ CompilationUnitElement unit = resynthesizer
+ .getElement(new ElementLocationImpl.con3(<String>[uri1, uri2]));
+ if (unit != null) {
+ entry.setValue(result, unit, TargetedResult.EMPTY_LIST);
+ return true;
+ }
+ }
+ }
return false;
}
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/task/dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698