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

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

Issue 1131423002: Clean up many generated constructors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Comment change Created 5 years, 7 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/sdk_io.dart ('k') | pkg/analyzer/lib/src/generated/source_io.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
*
« no previous file with comments | « pkg/analyzer/lib/src/generated/sdk_io.dart ('k') | pkg/analyzer/lib/src/generated/source_io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698