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

Side by Side Diff: pkg/analyzer/lib/src/generated/sdk_io.dart

Issue 1591483002: Prepare for chaining resynthesizers from AC to SDK AC. (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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.generated.sdk_io; 5 library analyzer.src.generated.sdk_io;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import 'package:analyzer/src/context/context.dart'; 10 import 'package:analyzer/src/context/context.dart';
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 * should be used when it is available 248 * should be used when it is available
249 */ 249 */
250 DirectoryBasedDartSdk(JavaFile sdkDirectory, [bool useDart2jsPaths = false]) { 250 DirectoryBasedDartSdk(JavaFile sdkDirectory, [bool useDart2jsPaths = false]) {
251 this._sdkDirectory = sdkDirectory.getAbsoluteFile(); 251 this._sdkDirectory = sdkDirectory.getAbsoluteFile();
252 _libraryMap = initialLibraryMap(useDart2jsPaths); 252 _libraryMap = initialLibraryMap(useDart2jsPaths);
253 } 253 }
254 254
255 @override 255 @override
256 AnalysisContext get context { 256 AnalysisContext get context {
257 if (_analysisContext == null) { 257 if (_analysisContext == null) {
258 SdkBundle sdkBundle = _getSummarySdkBundle(); 258 _analysisContext = new SdkAnalysisContext();
259 if (sdkBundle != null) {
260 _analysisContext = new SummarySdkAnalysisContext(sdkBundle);
261 } else {
262 _analysisContext = new SdkAnalysisContext();
263 }
264 SourceFactory factory = new SourceFactory([new DartUriResolver(this)]); 259 SourceFactory factory = new SourceFactory([new DartUriResolver(this)]);
265 _analysisContext.sourceFactory = factory; 260 _analysisContext.sourceFactory = factory;
266 List<String> uris = this.uris; 261 List<String> uris = this.uris;
262 // Try to use summaries.
263 SdkBundle sdkBundle = _getSummarySdkBundle();
264 if (sdkBundle != null) {
265 _analysisContext.aboutToComputeResultHelper =
266 new SdkSummaryResultProvider(_analysisContext, sdkBundle);
267 }
268 // Add sources.
267 ChangeSet changeSet = new ChangeSet(); 269 ChangeSet changeSet = new ChangeSet();
268 for (String uri in uris) { 270 for (String uri in uris) {
269 changeSet.addedSource(factory.forUri(uri)); 271 changeSet.addedSource(factory.forUri(uri));
270 } 272 }
271 _analysisContext.applyChanges(changeSet); 273 _analysisContext.applyChanges(changeSet);
272 } 274 }
273 return _analysisContext; 275 return _analysisContext;
274 } 276 }
275 277
276 /** 278 /**
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 SdkLibrariesReader_LibraryBuilder libraryBuilder = 651 SdkLibrariesReader_LibraryBuilder libraryBuilder =
650 new SdkLibrariesReader_LibraryBuilder(_useDart2jsPaths); 652 new SdkLibrariesReader_LibraryBuilder(_useDart2jsPaths);
651 // If any syntactic errors were found then don't try to visit the AST 653 // If any syntactic errors were found then don't try to visit the AST
652 // structure. 654 // structure.
653 if (!errorListener.errorReported) { 655 if (!errorListener.errorReported) {
654 unit.accept(libraryBuilder); 656 unit.accept(libraryBuilder);
655 } 657 }
656 return libraryBuilder.librariesMap; 658 return libraryBuilder.librariesMap;
657 } 659 }
658 } 660 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698