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

Unified Diff: pkg/analyzer/lib/src/string_source.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/string_source.dart
diff --git a/pkg/analyzer/lib/src/string_source.dart b/pkg/analyzer/lib/src/string_source.dart
index ce0c08777749b715cc38db44610380199cdc896a..987e8985ea0ccd3686ad6c1e491a274b35313b46 100644
--- a/pkg/analyzer/lib/src/string_source.dart
+++ b/pkg/analyzer/lib/src/string_source.dart
@@ -6,6 +6,7 @@ library analyzer.src.string_source;
import 'package:analyzer/src/generated/engine.dart' show TimestampedData;
import 'package:analyzer/src/generated/source.dart';
+import 'package:source_span/source_span.dart' as source_span;
/**
* An implementation of [Source] that's based on an in-memory Dart string.
@@ -16,6 +17,8 @@ class StringSource extends Source {
*/
final String _contents;
+ source_span.SourceFile _sourceFile;
+
@override
final String fullName;
@@ -47,6 +50,10 @@ class StringSource extends Source {
String get shortName => fullName;
@override
+ source_span.SourceFile get sourceFile =>
+ _sourceFile ??= new source_span.SourceFile(_contents, url: uri);
+
+ @override
UriKind get uriKind => UriKind.FILE_URI;
/**

Powered by Google App Engine
This is Rietveld 408576698