@@ -60,8 +60,9 @@ export const DISCONNECT_LABEL = nls.localize('disconnect', "Disconnect");
60
60
export const STOP_LABEL = nls . localize ( 'stop' , "Stop" ) ;
61
61
export const CONTINUE_LABEL = nls . localize ( 'continueDebug' , "Continue" ) ;
62
62
63
- function getThreadAndRun ( accessor : ServicesAccessor , threadId : number | undefined , run : ( thread : IThread ) => Promise < void > ) : void {
63
+ function getThreadAndRun ( accessor : ServicesAccessor , threadIdArg : number | any , run : ( thread : IThread ) => Promise < void > ) : void {
64
64
const debugService = accessor . get ( IDebugService ) ;
65
+ const threadId = typeof threadIdArg === 'number' ? threadIdArg : undefined ;
65
66
let thread : IThread | undefined ;
66
67
if ( threadId ) {
67
68
debugService . getModel ( ) . getSessions ( ) . forEach ( s => {
@@ -119,21 +120,21 @@ export function registerCommands(): void {
119
120
120
121
CommandsRegistry . registerCommand ( {
121
122
id : REVERSE_CONTINUE_ID ,
122
- handler : ( accessor : ServicesAccessor , threadId : number | undefined ) => {
123
+ handler : ( accessor : ServicesAccessor , threadId : number | any ) => {
123
124
getThreadAndRun ( accessor , threadId , thread => thread . reverseContinue ( ) ) ;
124
125
}
125
126
} ) ;
126
127
127
128
CommandsRegistry . registerCommand ( {
128
129
id : STEP_BACK_ID ,
129
- handler : ( accessor : ServicesAccessor , threadId : number | undefined ) => {
130
+ handler : ( accessor : ServicesAccessor , threadId : number | any ) => {
130
131
getThreadAndRun ( accessor , threadId , thread => thread . stepBack ( ) ) ;
131
132
}
132
133
} ) ;
133
134
134
135
CommandsRegistry . registerCommand ( {
135
136
id : TERMINATE_THREAD_ID ,
136
- handler : ( accessor : ServicesAccessor , threadId : number | undefined ) => {
137
+ handler : ( accessor : ServicesAccessor , threadId : number | any ) => {
137
138
getThreadAndRun ( accessor , threadId , thread => thread . terminate ( ) ) ;
138
139
}
139
140
} ) ;
@@ -213,7 +214,7 @@ export function registerCommands(): void {
213
214
weight : KeybindingWeight . WorkbenchContrib ,
214
215
primary : KeyCode . F10 ,
215
216
when : CONTEXT_DEBUG_STATE . isEqualTo ( 'stopped' ) ,
216
- handler : ( accessor : ServicesAccessor , threadId : number ) => {
217
+ handler : ( accessor : ServicesAccessor , threadId : number | any ) => {
217
218
getThreadAndRun ( accessor , threadId , ( thread : IThread ) => thread . next ( ) ) ;
218
219
}
219
220
} ) ;
@@ -223,7 +224,7 @@ export function registerCommands(): void {
223
224
weight : KeybindingWeight . WorkbenchContrib + 10 , // Have a stronger weight to have priority over full screen when debugging
224
225
primary : KeyCode . F11 ,
225
226
when : CONTEXT_IN_DEBUG_MODE ,
226
- handler : ( accessor : ServicesAccessor , threadId : number ) => {
227
+ handler : ( accessor : ServicesAccessor , threadId : number | any ) => {
227
228
getThreadAndRun ( accessor , threadId , ( thread : IThread ) => thread . stepIn ( ) ) ;
228
229
}
229
230
} ) ;
@@ -233,7 +234,7 @@ export function registerCommands(): void {
233
234
weight : KeybindingWeight . WorkbenchContrib ,
234
235
primary : KeyMod . Shift | KeyCode . F11 ,
235
236
when : CONTEXT_DEBUG_STATE . isEqualTo ( 'stopped' ) ,
236
- handler : ( accessor : ServicesAccessor , threadId : number ) => {
237
+ handler : ( accessor : ServicesAccessor , threadId : number | any ) => {
237
238
getThreadAndRun ( accessor , threadId , ( thread : IThread ) => thread . stepOut ( ) ) ;
238
239
}
239
240
} ) ;
@@ -243,7 +244,7 @@ export function registerCommands(): void {
243
244
weight : KeybindingWeight . WorkbenchContrib ,
244
245
primary : KeyCode . F6 ,
245
246
when : CONTEXT_DEBUG_STATE . isEqualTo ( 'running' ) ,
246
- handler : ( accessor : ServicesAccessor , threadId : number ) => {
247
+ handler : ( accessor : ServicesAccessor , threadId : number | any ) => {
247
248
getThreadAndRun ( accessor , threadId , thread => thread . pause ( ) ) ;
248
249
}
249
250
} ) ;
@@ -292,7 +293,7 @@ export function registerCommands(): void {
292
293
weight : KeybindingWeight . WorkbenchContrib ,
293
294
primary : KeyCode . F5 ,
294
295
when : CONTEXT_IN_DEBUG_MODE ,
295
- handler : ( accessor : ServicesAccessor , threadId : number | undefined ) => {
296
+ handler : ( accessor : ServicesAccessor , threadId : number | any ) => {
296
297
getThreadAndRun ( accessor , threadId , thread => thread . continue ( ) ) ;
297
298
}
298
299
} ) ;
0 commit comments