Index: pkg/analyzer/lib/src/dart/sdk/sdk.dart |
diff --git a/pkg/analyzer/lib/src/dart/sdk/sdk.dart b/pkg/analyzer/lib/src/dart/sdk/sdk.dart |
index 338a560677125f89e4fd56c48d3743aa6b4736d6..554376fbeb5d898ba4ad1f35674fe2a0f4408a56 100644 |
--- a/pkg/analyzer/lib/src/dart/sdk/sdk.dart |
+++ b/pkg/analyzer/lib/src/dart/sdk/sdk.dart |
@@ -119,6 +119,20 @@ abstract class AbstractDartSdk implements DartSdk { |
_useSummary = use; |
} |
+ /** |
+ * Add the extensions from one or more sdk extension files to this sdk. The |
+ * [extensions] should be a table mapping the names of extensions to the paths |
+ * where those extensions can be found. |
+ */ |
+ void addExtensions(Map<String, String> extensions) { |
+ extensions.forEach((String uri, String path) { |
+ String shortName = uri.substring(uri.indexOf(':') + 1); |
+ SdkLibraryImpl library = new SdkLibraryImpl(shortName); |
+ library.path = path; |
+ libraryMap.setLibrary(uri, library); |
+ }); |
+ } |
+ |
@override |
Source fromFileUri(Uri uri) { |
File file = |