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

Unified Diff: runtime/observatory/lib/src/elements/script_inset.dart

Issue 1302533003: Highlight the whole token when marking the current execution. Truncate call site annotations to one… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: top retainer Created 5 years, 4 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 | runtime/observatory/lib/src/service/object.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/elements/script_inset.dart
diff --git a/runtime/observatory/lib/src/elements/script_inset.dart b/runtime/observatory/lib/src/elements/script_inset.dart
index ee555cae32ec0dbc3d1e121a2804f685134d23d0..a7223c8c93d5c6a9b545fcb994d461f6e88af6f2 100644
--- a/runtime/observatory/lib/src/elements/script_inset.dart
+++ b/runtime/observatory/lib/src/elements/script_inset.dart
@@ -161,9 +161,12 @@ class CallSiteAnnotation extends Annotation {
CallSiteAnnotation(this.callSite) {
line = callSite.line;
columnStart = callSite.column - 1; // Call site is 1-origin.
- var tokenLength = callSite.name.length; // Approximate.
- if (callSite.name.startsWith("get:") ||
- callSite.name.startsWith("set:")) tokenLength -= 4;
+ var tokenLength = callSite.script.guessTokenLength(line, columnStart);
+ if (tokenLength == null) {
+ tokenLength = callSite.name.length; // Approximate.
+ if (callSite.name.startsWith("get:") ||
+ callSite.name.startsWith("set:")) tokenLength -= 4;
+ }
columnStop = columnStart + tokenLength;
}
@@ -475,7 +478,11 @@ class ScriptInsetElement extends ObservatoryElement {
var a = new CurrentExecutionAnnotation();
a.line = _currentLine;
a.columnStart = _currentCol;
- a.columnStop = _currentCol + 1;
+ var length = script.guessTokenLength(_currentLine, _currentCol);
+ if (length == null) {
+ length = 1;
+ }
+ a.columnStop = _currentCol + length;
annotations.add(a);
}
}
« no previous file with comments | « no previous file | runtime/observatory/lib/src/service/object.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698