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

Side by Side Diff: runtime/observatory/lib/src/debugger/debugger_location.dart

Issue 1387413003: Trim a line on the right before determining max breakpoint column (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of debugger; 5 part of debugger;
6 6
7 class DebuggerLocation { 7 class DebuggerLocation {
8 DebuggerLocation.file(this.script, this.line, this.col); 8 DebuggerLocation.file(this.script, this.line, this.col);
9 DebuggerLocation.func(this.function); 9 DebuggerLocation.func(this.function);
10 DebuggerLocation.error(this.errorMessage); 10 DebuggerLocation.error(this.errorMessage);
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 413
414 } else { 414 } else {
415 // Complete the column. 415 // Complete the column.
416 int lineNum = int.parse(lineStr); 416 int lineNum = int.parse(lineStr);
417 var scriptLine = script.getLine(lineNum); 417 var scriptLine = script.getLine(lineNum);
418 if (!scriptLine.possibleBpt) { 418 if (!scriptLine.possibleBpt) {
419 return []; 419 return [];
420 } 420 }
421 var sharedPrefix = '${script.name}:${lineStr}:'; 421 var sharedPrefix = '${script.name}:${lineStr}:';
422 List completions = []; 422 List completions = [];
423 int maxCol = scriptLine.text.runes.length; 423 int maxCol = scriptLine.text.trimRight().runes.length;
424 for (int i = 1; i <= maxCol; i++) { 424 for (int i = 1; i <= maxCol; i++) {
425 var currentColStr = i.toString(); 425 var currentColStr = i.toString();
426 if (currentColStr.startsWith(colStr)) { 426 if (currentColStr.startsWith(colStr)) {
427 completions.add('${sharedPrefix}${currentColStr} '); 427 completions.add('${sharedPrefix}${currentColStr} ');
428 } 428 }
429 } 429 }
430 return completions; 430 return completions;
431 } 431 }
432 } 432 }
433 } 433 }
(...skipping 11 matching lines...) Expand all
445 return 'invalid source location (${errorMessage})'; 445 return 'invalid source location (${errorMessage})';
446 } 446 }
447 447
448 Script script; 448 Script script;
449 int line; 449 int line;
450 int col; 450 int col;
451 ServiceFunction function; 451 ServiceFunction function;
452 String errorMessage; 452 String errorMessage;
453 bool get valid => (errorMessage == null); 453 bool get valid => (errorMessage == null);
454 } 454 }
OLDNEW
« 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