Index: pkg/analyzer/lib/src/generated/source.dart |
diff --git a/pkg/analyzer/lib/src/generated/source.dart b/pkg/analyzer/lib/src/generated/source.dart |
index 0f87040e2830f0ef5a0031a7771f24309a3bf8b9..8e423795f13765cea13811c7e17834ec9f18eb9c 100644 |
--- a/pkg/analyzer/lib/src/generated/source.dart |
+++ b/pkg/analyzer/lib/src/generated/source.dart |
@@ -99,6 +99,24 @@ class ContentCache { |
} |
} |
+class CustomUriResolver extends UriResolver { |
+ final Map<String, String> _urlMappings; |
+ |
+ CustomUriResolver(this._urlMappings); |
+ |
+ @override |
+ Source resolveAbsolute(Uri uri) { |
+ String mapping = _urlMappings[uri.toString()]; |
+ if (mapping == null) return null; |
+ |
+ Uri fileUri = new Uri.file(mapping); |
+ if (!fileUri.isAbsolute) return null; |
+ |
+ JavaFile javaFile = new JavaFile.fromUri(fileUri); |
+ return new FileBasedSource(javaFile); |
+ } |
+} |
+ |
/** |
* Instances of the class `DartUriResolver` resolve `dart` URI's. |
*/ |
@@ -159,24 +177,6 @@ class DartUriResolver extends UriResolver { |
static bool isDartUri(Uri uri) => DART_SCHEME == uri.scheme; |
} |
-class CustomUriResolver extends UriResolver { |
- final Map<String, String> _urlMappings; |
- |
- CustomUriResolver(this._urlMappings); |
- |
- @override |
- Source resolveAbsolute(Uri uri) { |
- String mapping = _urlMappings[uri.toString()]; |
- if (mapping == null) return null; |
- |
- Uri fileUri = new Uri.file(mapping); |
- if (!fileUri.isAbsolute) return null; |
- |
- JavaFile javaFile = new JavaFile.fromUri(fileUri); |
- return new FileBasedSource.con1(javaFile); |
- } |
-} |
- |
/** |
* Instances of the class `LineInfo` encapsulate information about line and column information |
* within a source file. |
@@ -428,9 +428,6 @@ abstract class Source implements AnalysisTarget { |
*/ |
String get encoding; |
- @override |
- Source get source => this; |
- |
/** |
* Return the full (long) version of the name that can be displayed to the user to denote this |
* source. For example, for a source representing a file this would typically be the absolute path |
@@ -478,6 +475,9 @@ abstract class Source implements AnalysisTarget { |
*/ |
String get shortName; |
+ @override |
+ Source get source => this; |
+ |
/** |
* Return the URI from which this source was originally derived. |
* |