| 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 'observatory_element.dart'; | 9 import 'observatory_element.dart'; |
| 10 import 'package:observatory/cli.dart'; | 10 import 'package:observatory/cli.dart'; |
| (...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 "Switching to isolate ${candidate.number} '${candidate.name}'"); | 798 "Switching to isolate ${candidate.number} '${candidate.name}'"); |
| 799 debugger.isolate = candidate; | 799 debugger.isolate = candidate; |
| 800 } | 800 } |
| 801 } | 801 } |
| 802 return new Future.value(null); | 802 return new Future.value(null); |
| 803 } | 803 } |
| 804 | 804 |
| 805 Future<List<String>> complete(List<String> args) { | 805 Future<List<String>> complete(List<String> args) { |
| 806 if (args.length != 1) { | 806 if (args.length != 1) { |
| 807 return new Future.value([args.join('')]); | 807 return new Future.value([args.join('')]); |
| 808 } | 808 } |
| 809 var isolates = debugger.vm.isolates.toList(); | |
| 810 isolates.sort((a, b) => a.startTime.compareTo(b.startTime)); | |
| 811 var result = []; | 809 var result = []; |
| 812 for (var isolate in isolates) { | 810 for (var isolate in debugger.vm.isolates) { |
| 813 var str = isolate.number.toString(); | 811 var str = isolate.number.toString(); |
| 814 if (str.startsWith(args[0])) { | 812 if (str.startsWith(args[0])) { |
| 815 result.add('$str '); | 813 result.add('$str '); |
| 816 } | 814 } |
| 817 } | 815 } |
| 818 for (var isolate in isolates) { | 816 for (var isolate in debugger.vm.isolates) { |
| 819 if (isolate.name.startsWith(args[0])) { | 817 if (isolate.name.startsWith(args[0])) { |
| 820 result.add('${isolate.name} '); | 818 result.add('${isolate.name} '); |
| 821 } | 819 } |
| 822 } | 820 } |
| 823 return new Future.value(result); | 821 return new Future.value(result); |
| 824 } | 822 } |
| 825 String helpShort = 'Switch the current isolate'; | 823 String helpShort = 'Switch the current isolate'; |
| 826 | 824 |
| 827 String helpLong = | 825 String helpLong = |
| 828 'Switch the current isolate.\n' | 826 'Switch the current isolate.\n' |
| 829 '\n' | 827 '\n' |
| 830 'Syntax: isolate <number>\n' | 828 'Syntax: isolate <number>\n' |
| 831 ' isolate <name>\n'; | 829 ' isolate <name>\n'; |
| 832 } | 830 } |
| 833 | 831 |
| 834 class IsolateListCommand extends DebuggerCommand { | 832 class IsolateListCommand extends DebuggerCommand { |
| 835 IsolateListCommand(Debugger debugger) : super(debugger, 'list', []); | 833 IsolateListCommand(Debugger debugger) : super(debugger, 'list', []); |
| 836 | 834 |
| 837 Future run(List<String> args) { | 835 Future run(List<String> args) { |
| 838 if (debugger.vm == null) { | 836 if (debugger.vm == null) { |
| 839 debugger.console.print( | 837 debugger.console.print( |
| 840 "Internal error: vm has not been set"); | 838 "Internal error: vm has not been set"); |
| 841 return new Future.value(null); | 839 return new Future.value(null); |
| 842 } | 840 } |
| 843 var isolates = debugger.vm.isolates.toList(); | 841 for (var isolate in debugger.vm.isolates) { |
| 844 isolates.sort((a, b) => a.startTime.compareTo(b.startTime)); | |
| 845 for (var isolate in isolates) { | |
| 846 String current = (isolate == debugger.isolate ? ' *' : ''); | 842 String current = (isolate == debugger.isolate ? ' *' : ''); |
| 847 debugger.console.print( | 843 debugger.console.print( |
| 848 "Isolate ${isolate.number} '${isolate.name}'${current}"); | 844 "Isolate ${isolate.number} '${isolate.name}'${current}"); |
| 849 } | 845 } |
| 850 return new Future.value(null); | 846 return new Future.value(null); |
| 851 } | 847 } |
| 852 | 848 |
| 853 String helpShort = 'List all isolates'; | 849 String helpShort = 'List all isolates'; |
| 854 | 850 |
| 855 String helpLong = | 851 String helpLong = |
| (...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2007 } | 2003 } |
| 2008 }); | 2004 }); |
| 2009 } | 2005 } |
| 2010 | 2006 |
| 2011 void focus() { | 2007 void focus() { |
| 2012 $['textBox'].focus(); | 2008 $['textBox'].focus(); |
| 2013 } | 2009 } |
| 2014 | 2010 |
| 2015 DebuggerInputElement.created() : super.created(); | 2011 DebuggerInputElement.created() : super.created(); |
| 2016 } | 2012 } |
| OLD | NEW |