OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library debugger_page_element; | 5 library debugger_page_element; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:html'; | 8 import 'dart:html'; |
9 import 'dart:math'; | 9 import 'dart:math'; |
10 import 'observatory_element.dart'; | 10 import 'observatory_element.dart'; |
(...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1717 | 1717 |
1718 Future<String> complete(String line) { | 1718 Future<String> complete(String line) { |
1719 return cmd.completeCommand(line).then((completions) { | 1719 return cmd.completeCommand(line).then((completions) { |
1720 if (completions.length == 0) { | 1720 if (completions.length == 0) { |
1721 // No completions. Leave the line alone. | 1721 // No completions. Leave the line alone. |
1722 return line; | 1722 return line; |
1723 } else if (completions.length == 1) { | 1723 } else if (completions.length == 1) { |
1724 // Unambiguous completion. | 1724 // Unambiguous completion. |
1725 return completions[0]; | 1725 return completions[0]; |
1726 } else { | 1726 } else { |
1727 // Ambigous completion. | 1727 // Ambiguous completion. |
1728 completions = completions.map((s) => s.trimRight()).toList(); | 1728 completions = completions.map((s) => s.trimRight()).toList(); |
1729 console.printBold(completions.toString()); | 1729 console.printBold(completions.toString()); |
1730 return _foldCompletions(completions); | 1730 return _foldCompletions(completions); |
1731 } | 1731 } |
1732 }); | 1732 }); |
1733 } | 1733 } |
1734 | 1734 |
1735 // TODO(turnidge): Implement real command line history. | 1735 // TODO(turnidge): Implement real command line history. |
1736 String lastCommand; | 1736 String lastCommand; |
1737 | 1737 |
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2568 } | 2568 } |
2569 }); | 2569 }); |
2570 } | 2570 } |
2571 | 2571 |
2572 void focus() { | 2572 void focus() { |
2573 $['textBox'].focus(); | 2573 $['textBox'].focus(); |
2574 } | 2574 } |
2575 | 2575 |
2576 DebuggerInputElement.created() : super.created(); | 2576 DebuggerInputElement.created() : super.created(); |
2577 } | 2577 } |
OLD | NEW |