Index: pkg/analyzer/lib/src/generated/source_io.dart |
diff --git a/pkg/analyzer/lib/src/generated/source_io.dart b/pkg/analyzer/lib/src/generated/source_io.dart |
index 43dfb42947a6e0977e916b053dddcd9cda5b57b6..7a90a2a595b7a1bea9b2333477b49927d820eda4 100644 |
--- a/pkg/analyzer/lib/src/generated/source_io.dart |
+++ b/pkg/analyzer/lib/src/generated/source_io.dart |
@@ -11,6 +11,7 @@ import 'package:analyzer/src/generated/engine.dart'; |
import 'package:analyzer/src/generated/java_io.dart'; |
import 'package:analyzer/src/generated/source.dart'; |
import 'package:path/path.dart' as path; |
+import 'package:source_span/source_span.dart' as source_span; |
export 'package:analyzer/src/generated/source.dart'; |
@@ -146,6 +147,8 @@ class FileBasedSource extends Source { |
*/ |
static final Map<String, int> _idTable = new HashMap<String, int>(); |
+ source_span.SourceFile _sourceFile; |
+ |
/** |
* The URI from which this source was originally derived. |
*/ |
@@ -235,6 +238,10 @@ class FileBasedSource extends Source { |
String get shortName => file.getName(); |
@override |
+ source_span.SourceFile get sourceFile => _sourceFile ??= |
+ new source_span.SourceFile(file.readAsStringSync(), url: uri); |
Brian Wilkerson
2016/11/14 23:34:41
I haven't thought this through completely, but thi
|
+ |
+ @override |
UriKind get uriKind { |
String scheme = uri.scheme; |
return UriKind.fromScheme(scheme); |