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

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

Issue 2498133002: Connect analyzer's AnalysisError object to front_end's CompilationError. (Closed)
Patch Set: Created 4 years, 1 month 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/lib/src/source/source_resource.dart
diff --git a/pkg/analyzer/lib/src/source/source_resource.dart b/pkg/analyzer/lib/src/source/source_resource.dart
index 63b906cb3c884cbfc89ea4bf170fce82acc9cb49..b7fb2d0b76f193f94760a9680ec9579ca9663c62 100644
--- a/pkg/analyzer/lib/src/source/source_resource.dart
+++ b/pkg/analyzer/lib/src/source/source_resource.dart
@@ -9,6 +9,7 @@ import 'dart:collection';
import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:source_span/source_span.dart' as source_span;
/**
* A function that can translate the contents of files on disk as they are read.
@@ -35,6 +36,8 @@ class FileSource 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.
*/
@@ -119,6 +122,10 @@ class FileSource extends Source {
String get shortName => file.shortName;
@override
+ source_span.SourceFile get sourceFile => _sourceFile ??=
+ new source_span.SourceFile(file.readAsStringSync(), url: uri);
+
+ @override
UriKind get uriKind => UriKind.fromScheme(uri.scheme);
@override

Powered by Google App Engine
This is Rietveld 408576698