| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |