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

Unified Diff: pkg/front_end/lib/src/incremental_resolved_ast_generator_impl.dart

Issue 2643033003: Clean up hacky handling of "dart:" URIs in incremental resolved AST generator. (Closed)
Patch Set: Created 3 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/front_end/lib/src/incremental_resolved_ast_generator_impl.dart
diff --git a/pkg/front_end/lib/src/incremental_resolved_ast_generator_impl.dart b/pkg/front_end/lib/src/incremental_resolved_ast_generator_impl.dart
index 230fdbe192ca571e075763507002bc92b54f6412..7a44ab9d50f776b74649127b4e79781ef6f92c6f 100644
--- a/pkg/front_end/lib/src/incremental_resolved_ast_generator_impl.dart
+++ b/pkg/front_end/lib/src/incremental_resolved_ast_generator_impl.dart
@@ -74,9 +74,6 @@ class IncrementalResolvedAstGeneratorImpl
_scheduler.start();
_schedulerStarted = true;
}
- // The driver will request files from dart:, even though it actually uses
- // the data from the summary. TODO(paulberry): fix this.
- _fileRepository.store(Uri.parse('dart:core'), '');
for (var libraryCycle in graph.topologicallySortedCycles) {
for (var libraryUri in libraryCycle.libraries.keys) {
var libraryNode = libraryCycle.libraries[libraryUri];
@@ -122,7 +119,8 @@ class IncrementalResolvedAstGeneratorImpl
// TODO(paulberry): can we just use null?
var fileContentOverlay = new FileContentOverlay();
var sdkContext = new AnalysisContextImpl();
- var dartSdk = new _DartSdkProxy(await _options.getSdkSummary(), sdkContext);
+ var dartSdk = new _DartSdkProxy(
+ await _options.getSdkSummary(), sdkContext, _fileRepository);
sdkContext.sourceFactory =
new SourceFactory([new DartUriResolver(dartSdk)]);
bool strongMode = true; // TODO(paulberry): support strong mode flag.
@@ -172,15 +170,18 @@ class _DartSdkProxy implements DartSdk {
final AnalysisContext context;
- _DartSdkProxy(this.summary, this.context);
+ final FileRepository _fileRepository;
+
+ _DartSdkProxy(this.summary, this.context, this._fileRepository);
@override
PackageBundle getLinkedBundle() => summary;
@override
- Source mapDartUri(String uri) {
- // TODO(paulberry): this seems hacky.
- return new _SourceProxy(Uri.parse(uri), '$uri.dart');
+ Source mapDartUri(String uriString) {
+ var uri = Uri.parse(uriString);
+ return new _SourceProxy(
+ uri, _fileRepository.pathForUri(uri, allocate: true));
}
noSuchMethod(Invocation invocation) => unimplemented();
« no previous file with comments | « pkg/front_end/lib/src/base/file_repository.dart ('k') | pkg/front_end/test/src/base/file_repository_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698