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

Unified Diff: pkg/analyzer/lib/src/generated/sdk_io.dart

Issue 1843473002: Sort analyzer sources (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Remove generated file and fix misplaced comments Created 4 years, 9 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 | « pkg/analyzer/lib/src/generated/scanner.dart ('k') | pkg/analyzer/lib/src/generated/type_system.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/sdk_io.dart
diff --git a/pkg/analyzer/lib/src/generated/sdk_io.dart b/pkg/analyzer/lib/src/generated/sdk_io.dart
index 411a2e67f29666f16637b84a1c37fbb52455ed77..9bf52bf372fa44727b56b0e327fb129ba89ce2b0 100644
--- a/pkg/analyzer/lib/src/generated/sdk_io.dart
+++ b/pkg/analyzer/lib/src/generated/sdk_io.dart
@@ -533,6 +533,30 @@ class DirectoryBasedDartSdk implements DartSdk {
SdkLibrary getSdkLibrary(String dartUri) => _libraryMap.getLibrary(dartUri);
/**
+ * Return the [PackageBundle] for this SDK, if it exists, or `null` otherwise.
+ * This method should not be used outside of `analyzer` and `analyzer_cli`
+ * packages.
+ */
+ PackageBundle getSummarySdkBundle() {
+ String rootPath = directory.getAbsolutePath();
+ bool strongMode = _analysisOptions?.strongMode ?? false;
+ String name = strongMode ? 'strong.sum' : 'spec.sum';
+ String path = pathos.join(rootPath, 'lib', '_internal', name);
+ try {
+ File file = new File(path);
+ if (file.existsSync()) {
+ List<int> bytes = file.readAsBytesSync();
+ return new PackageBundle.fromBuffer(bytes);
+ }
+ } catch (exception, stackTrace) {
+ AnalysisEngine.instance.logger.logError(
+ 'Failed to load SDK analysis summary from $path',
+ new CaughtException(exception, stackTrace));
+ }
+ return null;
+ }
+
+ /**
* Read all of the configuration files to initialize the library maps. The
* flag [useDart2jsPaths] is `true` if the dart2js path should be used when it
* is available. Return the initialized library map.
@@ -568,30 +592,6 @@ class DirectoryBasedDartSdk implements DartSdk {
return source;
}
- /**
- * Return the [PackageBundle] for this SDK, if it exists, or `null` otherwise.
- * This method should not be used outside of `analyzer` and `analyzer_cli`
- * packages.
- */
- PackageBundle getSummarySdkBundle() {
- String rootPath = directory.getAbsolutePath();
- bool strongMode = _analysisOptions?.strongMode ?? false;
- String name = strongMode ? 'strong.sum' : 'spec.sum';
- String path = pathos.join(rootPath, 'lib', '_internal', name);
- try {
- File file = new File(path);
- if (file.existsSync()) {
- List<int> bytes = file.readAsBytesSync();
- return new PackageBundle.fromBuffer(bytes);
- }
- } catch (exception, stackTrace) {
- AnalysisEngine.instance.logger.logError(
- 'Failed to load SDK analysis summary from $path',
- new CaughtException(exception, stackTrace));
- }
- return null;
- }
-
FileBasedSource _mapDartUri(String dartUri) {
String libraryName;
String relativePath;
« no previous file with comments | « pkg/analyzer/lib/src/generated/scanner.dart ('k') | pkg/analyzer/lib/src/generated/type_system.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698