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

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

Issue 866663003: Add a working command line debugger to Observatory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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
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 f129f71bf503b7b037b3326e7d42f4b490f36a9b..aef3fe3dde57d321ee2f8a107482a897802cf8a6 100644
--- a/runtime/observatory/lib/src/elements/script_inset.dart
+++ b/runtime/observatory/lib/src/elements/script_inset.dart
@@ -23,6 +23,7 @@ class ScriptInsetElement extends ObservatoryElement {
@published int endPos;
@observable int currentLine;
+ @observable int currentCol;
@observable int startLine;
@observable int endLine;
@observable bool linesReady = false;
@@ -34,6 +35,16 @@ class ScriptInsetElement extends ObservatoryElement {
return 'line-$line';
}
+ String clip(String line, int start, [int limit]) {
+ try {
+ return line.substring(start, limit);
+ } catch (_) {
+ // NOTE(turnidge): Sometimes polymer updates give us garbage
+ // starts and limits during page updates.
+ return "OOB";
+ }
+ }
+
MutationObserver _observer;
void _scrollToCurrentPos() {
@@ -108,6 +119,9 @@ class ScriptInsetElement extends ObservatoryElement {
currentLine = (currentPos != null
? script.tokenToLine(currentPos)
: null);
+ currentCol = (currentPos != null
+ ? (script.tokenToCol(currentPos) - 1) // make this 0-based.
+ : null);
endLine = (endPos != null
? script.tokenToLine(endPos)
: script.lines.length);
« no previous file with comments | « runtime/observatory/lib/src/elements/nav_bar.html ('k') | runtime/observatory/lib/src/elements/script_inset.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698