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

Unified Diff: lib/runtime/messages_widget.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 | « no previous file | lib/runtime/messages_widget.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/messages_widget.dart
diff --git a/lib/runtime/messages_widget.dart b/lib/runtime/messages_widget.dart
index 4c4d24882d24e97bdfa9e00dea8cf73921540158..469eddab21978e09e1fcd590af23774ba915b426 100644
--- a/lib/runtime/messages_widget.dart
+++ b/lib/runtime/messages_widget.dart
@@ -55,7 +55,19 @@ void displayMessages(String data) {
if (span != null) {
sb.write('<div class="location">'
' <span class="location">${span.start.toolString}</span></div>'
- ' <span class="text">${_escape(span.text)}</span></div></div>');
+ ' <span class="text">');
+ if (span is SourceSpanWithContext) {
+ var context = span.context;
+ var text = span.text;
+ sb.write(_escape(context.substring(0, span.start.column)));
+ sb.write('<span class="$level">');
+ sb.write(_escape(span.text));
+ sb.write('</span>');
+ sb.write(_escape(context.substring(span.end.column)));
+ } else {
+ sb.write(_escape(span.text));
+ }
+ sb.write('</span></div></div>');
}
sb.write('</div>');
« no previous file with comments | « no previous file | lib/runtime/messages_widget.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698