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

Side by Side Diff: pkg/analyzer/lib/src/dart/sdk/sdk.dart

Issue 2648213007: Revert "Use single InputPackagesResultProvider, without SdkSummaryResultProvider." (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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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.sdk2; 5 library analyzer.src.generated.sdk2;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:convert'; 8 import 'dart:convert';
9 import 'dart:io' as io; 9 import 'dart:io' as io;
10 10
11 import 'package:analyzer/dart/ast/ast.dart'; 11 import 'package:analyzer/dart/ast/ast.dart';
12 import 'package:analyzer/error/listener.dart'; 12 import 'package:analyzer/error/listener.dart';
13 import 'package:analyzer/exception/exception.dart'; 13 import 'package:analyzer/exception/exception.dart';
14 import 'package:analyzer/file_system/file_system.dart'; 14 import 'package:analyzer/file_system/file_system.dart';
15 import 'package:analyzer/file_system/memory_file_system.dart'; 15 import 'package:analyzer/file_system/memory_file_system.dart';
16 import 'package:analyzer/src/context/context.dart'; 16 import 'package:analyzer/src/context/context.dart';
17 import 'package:analyzer/src/dart/scanner/reader.dart'; 17 import 'package:analyzer/src/dart/scanner/reader.dart';
18 import 'package:analyzer/src/dart/scanner/scanner.dart'; 18 import 'package:analyzer/src/dart/scanner/scanner.dart';
19 import 'package:analyzer/src/generated/engine.dart'; 19 import 'package:analyzer/src/generated/engine.dart';
20 import 'package:analyzer/src/generated/java_engine_io.dart'; 20 import 'package:analyzer/src/generated/java_engine_io.dart';
21 import 'package:analyzer/src/generated/parser.dart'; 21 import 'package:analyzer/src/generated/parser.dart';
22 import 'package:analyzer/src/generated/sdk.dart'; 22 import 'package:analyzer/src/generated/sdk.dart';
23 import 'package:analyzer/src/generated/source_io.dart'; 23 import 'package:analyzer/src/generated/source_io.dart';
24 import 'package:analyzer/src/summary/idl.dart' show PackageBundle; 24 import 'package:analyzer/src/summary/idl.dart' show PackageBundle;
25 import 'package:analyzer/src/summary/package_bundle_reader.dart'; 25 import 'package:analyzer/src/summary/summary_sdk.dart';
26 import 'package:path/path.dart' as pathos; 26 import 'package:path/path.dart' as pathos;
27 import 'package:yaml/yaml.dart'; 27 import 'package:yaml/yaml.dart';
28 28
29 /** 29 /**
30 * An abstract implementation of a Dart SDK in which the available libraries are 30 * An abstract implementation of a Dart SDK in which the available libraries are
31 * stored in a library map. Subclasses are responsible for populating the 31 * stored in a library map. Subclasses are responsible for populating the
32 * library map. 32 * library map.
33 */ 33 */
34 abstract class AbstractDartSdk implements DartSdk { 34 abstract class AbstractDartSdk implements DartSdk {
35 /** 35 /**
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 _analysisOptions = options; 82 _analysisOptions = options;
83 } 83 }
84 84
85 @override 85 @override
86 AnalysisContext get context { 86 AnalysisContext get context {
87 if (_analysisContext == null) { 87 if (_analysisContext == null) {
88 _analysisContext = new SdkAnalysisContext(_analysisOptions); 88 _analysisContext = new SdkAnalysisContext(_analysisOptions);
89 SourceFactory factory = new SourceFactory([new DartUriResolver(this)]); 89 SourceFactory factory = new SourceFactory([new DartUriResolver(this)]);
90 _analysisContext.sourceFactory = factory; 90 _analysisContext.sourceFactory = factory;
91 if (_useSummary) { 91 if (_useSummary) {
92 bool strongMode = _analysisOptions?.strongMode ?? false;
92 PackageBundle sdkBundle = getLinkedBundle(); 93 PackageBundle sdkBundle = getLinkedBundle();
93 if (sdkBundle != null) { 94 if (sdkBundle != null) {
94 SummaryDataStore dataStore = new SummaryDataStore([]); 95 _analysisContext.resultProvider = new SdkSummaryResultProvider(
95 dataStore.addBundle(null, sdkBundle); 96 _analysisContext, sdkBundle, strongMode);
96 _analysisContext.resultProvider =
97 new InputPackagesResultProvider(_analysisContext, dataStore);
98 } 97 }
99 } 98 }
100 } 99 }
101 return _analysisContext; 100 return _analysisContext;
102 } 101 }
103 102
104 @override 103 @override
105 List<SdkLibrary> get sdkLibraries => libraryMap.sdkLibraries; 104 List<SdkLibrary> get sdkLibraries => libraryMap.sdkLibraries;
106 105
107 /** 106 /**
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 SdkLibrariesReader_LibraryBuilder libraryBuilder = 890 SdkLibrariesReader_LibraryBuilder libraryBuilder =
892 new SdkLibrariesReader_LibraryBuilder(_useDart2jsPaths); 891 new SdkLibrariesReader_LibraryBuilder(_useDart2jsPaths);
893 // If any syntactic errors were found then don't try to visit the AST 892 // If any syntactic errors were found then don't try to visit the AST
894 // structure. 893 // structure.
895 if (!errorListener.errorReported) { 894 if (!errorListener.errorReported) {
896 unit.accept(libraryBuilder); 895 unit.accept(libraryBuilder);
897 } 896 }
898 return libraryBuilder.librariesMap; 897 return libraryBuilder.librariesMap;
899 } 898 }
900 } 899 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/dart/analysis/driver.dart ('k') | pkg/analyzer/lib/src/generated/sdk_io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698