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

Unified Diff: dart/site/try/src/editor.dart

Issue 140933003: Create a DOM node for each token to ensure more precise diagnostics. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/site/try/src/editor.dart
diff --git a/dart/site/try/src/editor.dart b/dart/site/try/src/editor.dart
index e8ae9e80dd89fac5ca3a3725e5ade689be369db4..885295de9c167a69860620832964cdb048f71f0c 100644
--- a/dart/site/try/src/editor.dart
+++ b/dart/site/try/src/editor.dart
@@ -241,8 +241,9 @@ addDiagnostic(String kind, String message, int begin, int end) {
anchorOffset = selection.anchorOffset;
Node marker = new Text("");
node.replaceWith(marker);
- // TODO(ahe): Don't highlight everything in the node. Find
- // the relevant token.
+ // TODO(ahe): Don't highlight everything in the node. Find the
+ // relevant token (works for now as we create a node for each token,
+ // which is probably not great for performance).
if (kind == 'error') {
marker.replaceWith(diagnostic(node, error(message)));
} else if (kind == 'warning') {
@@ -301,7 +302,7 @@ Decoration getDecoration(Token token) {
isMalformedInput = true;
return new DiagnosticDecoration('error', tokenValue);
}
- return null;
+ return currentTheme.foreground;
}
diagnostic(text, tip) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698