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

Unified Diff: lib/src/summary.dart

Issue 1023893004: Pass through context information in error messages (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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 | « lib/runtime/messages_widget.js ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/summary.dart
diff --git a/lib/src/summary.dart b/lib/src/summary.dart
index f5c8ab6918d903fef192e6f469a98a2a4eb4c03d..2e341295fc618223890ef53f766f1cc188129c98 100644
--- a/lib/src/summary.dart
+++ b/lib/src/summary.dart
@@ -152,17 +152,27 @@ class MessageSummary implements Summary {
'level': level,
'message': message,
'url': '${span.sourceUrl}',
- 'start': span.start.offset,
- 'end': span.end.offset,
+ 'start': [span.start.offset, span.start.line, span.start.column],
+ 'end': [span.end.offset, span.end.line, span.end.column],
'text': span.text,
+ 'contextLine': span is SourceSpanContext
+ ? (span as SourceSpanContext).contextLine
Siggi Cherem (dart-lang) 2015/03/23 22:01:44 it's frustrating that here we are required to put
vsm 2015/03/23 22:11:34 You could file a type promo bug on this.
Siggi Cherem (dart-lang) 2015/03/26 22:20:18 We chatted offline: turns out this is a legitimate
+ : null,
};
void accept(SummaryVisitor visitor) => visitor.visitMessage(this);
static MessageSummary parse(Map json) {
- var start = new SourceLocation(json['start'], sourceUrl: json['url']);
- var end = new SourceLocation(json['end'], sourceUrl: json['url']);
- var span = new SourceSpanBase(start, end, json['text']);
+ var start = new SourceLocation(json['start'][0],
+ sourceUrl: json['url'],
+ line: json['start'][1],
+ column: json['start'][2]);
+ var end = new SourceLocation(json['end'][0],
+ sourceUrl: json['url'], line: json['end'][1], column: json['end'][2]);
+ var context = json['contextLine'];
+ var span = context != null
+ ? new SourceSpanWithContext(start, end, json['text'], context)
+ : new SourceSpanBase(start, end, json['text']);
return new MessageSummary(
json['kind'], json['level'], span, json['message']);
}
« no previous file with comments | « lib/runtime/messages_widget.js ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698