@@ -39,17 +39,26 @@ export function activate(context: vscode.ExtensionContext) {
39
39
rtlDebugger . session ! . runSimulation ( ) ;
40
40
}
41
41
} ) ) ;
42
- context . subscriptions . push ( vscode . commands . registerCommand ( 'rtlDebugger.runSimulationUntil' , ( ) => {
43
- inputTime ( { prompt : 'Enter the requested simulation time.' } ) . then ( ( untilTime ) => {
44
- if ( untilTime !== undefined ) {
45
- rtlDebugger . session ! . runSimulation ( { untilTime } ) ;
46
- }
47
- } ) ;
42
+ context . subscriptions . push ( vscode . commands . registerCommand ( 'rtlDebugger.runSimulationUntil' , async ( ) => {
43
+ const untilTime = await inputTime ( { prompt : 'Enter the time to simulate until.' } ) ;
44
+ if ( untilTime !== undefined ) {
45
+ rtlDebugger . session ! . runSimulation ( { untilTime } ) ;
46
+ }
48
47
} ) ) ;
49
48
context . subscriptions . push ( vscode . commands . registerCommand ( 'rtlDebugger.stepBackward' , ( ) =>
50
49
rtlDebugger . session ! . stepBackward ( ) ) ) ;
51
50
context . subscriptions . push ( vscode . commands . registerCommand ( 'rtlDebugger.stepForward' , ( ) =>
52
51
rtlDebugger . session ! . stepForward ( ) ) ) ;
52
+ context . subscriptions . push ( vscode . commands . registerCommand ( 'rtlDebugger.goToTime' , async ( ) => {
53
+ const goToTime = await inputTime ( { prompt : 'Enter the time to examine the state at.' } ) ;
54
+ if ( goToTime !== undefined ) {
55
+ if ( rtlDebugger . session ! . simulationStatus . latestTime . lessThan ( goToTime ) ) {
56
+ vscode . window . showErrorMessage ( `The simulation has not advanced to ${ goToTime } yet.` ) ;
57
+ } else {
58
+ rtlDebugger . session ! . timeCursor = goToTime ;
59
+ }
60
+ }
61
+ } ) ) ;
53
62
54
63
context . subscriptions . push ( vscode . commands . registerCommand ( 'rtlDebugger.setRadix.2' , ( treeItem ) =>
55
64
globalVariableOptions . update ( treeItem . designation . variable . cxxrtlIdentifier , { radix : 2 } ) ) ) ;
0 commit comments