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

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

Issue 23461019: New analyzer_experimental snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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/analyzer_experimental/lib/src/generated/sdk_io.dart
diff --git a/pkg/analyzer_experimental/lib/src/generated/sdk_io.dart b/pkg/analyzer_experimental/lib/src/generated/sdk_io.dart
index 47d9a8f61f313bfd964533f638fd91610a96f076..3509c831379e3a9e6c4b2fc8e8b80dcc86d8bfa4 100644
--- a/pkg/analyzer_experimental/lib/src/generated/sdk_io.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/sdk_io.dart
@@ -152,6 +152,22 @@ class DirectoryBasedDartSdk implements DartSdk {
}
/**
+ * Return the default Dart SDK, or `null` if the directory containing the default SDK cannot
+ * be determined (or does not exist).
+ *
+ * Added in order to test AnalysisContextImpl2.
+ *
+ * @return the default Dart SDK
+ */
+ static DirectoryBasedDartSdk get defaultSdk2 {
+ JavaFile sdkDirectory = defaultSdkDirectory;
+ if (sdkDirectory == null) {
+ return null;
+ }
+ return new DirectoryBasedDartSdk.con1(sdkDirectory, true);
+ }
+
+ /**
* Return the default directory for the Dart SDK, or `null` if the directory cannot be
* determined (or does not exist). The default directory is provided by a [System] property
* named `com.google.dart.sdk`, or, if the property is not defined, an environment variable
@@ -183,7 +199,32 @@ class DirectoryBasedDartSdk implements DartSdk {
this._sdkDirectory = sdkDirectory.getAbsoluteFile();
initializeSdk();
initializeLibraryMap();
- _analysisContext = new AnalysisContextImpl();
+ if (AnalysisEngine.instance.useExperimentalContext) {
+ _analysisContext = new AnalysisContextImpl2();
+ } else {
+ _analysisContext = new AnalysisContextImpl();
+ }
+ _analysisContext.sourceFactory = new SourceFactory.con2([new DartUriResolver(this)]);
+ List<String> uris = this.uris;
+ ChangeSet changeSet = new ChangeSet();
+ for (String uri in uris) {
+ changeSet.added(_analysisContext.sourceFactory.forUri(uri));
+ }
+ _analysisContext.applyChanges(changeSet);
+ }
+
+ /**
+ * Initialize a newly created SDK to represent the Dart SDK installed in the given directory.
+ *
+ * Added in order to test AnalysisContextImpl2.
+ *
+ * @param sdkDirectory the directory containing the SDK
+ */
+ DirectoryBasedDartSdk.con1(JavaFile sdkDirectory, bool ignored) {
+ this._sdkDirectory = sdkDirectory.getAbsoluteFile();
+ initializeSdk();
+ initializeLibraryMap();
+ _analysisContext = new AnalysisContextImpl2();
_analysisContext.sourceFactory = new SourceFactory.con2([new DartUriResolver(this)]);
List<String> uris = this.uris;
ChangeSet changeSet = new ChangeSet();

Powered by Google App Engine
This is Rietveld 408576698