debug: restart should be sent to parent session

#118196
This commit is contained in:
isidor 2021-04-26 14:52:31 +02:00
parent 61472da358
commit 5d77401e47
No known key found for this signature in database
GPG key ID: F9280366A8370105

View file

@ -219,6 +219,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
when: CONTEXT_IN_DEBUG_MODE,
handler: async (accessor: ServicesAccessor, _: string, context: CallStackContext | unknown) => {
const debugService = accessor.get(IDebugService);
const configurationService = accessor.get(IConfigurationService);
let session: IDebugSession | undefined;
if (isSessionContext(context)) {
session = debugService.getModel().getSession(context.sessionId);
@ -230,6 +231,11 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
const { launch, name } = debugService.getConfigurationManager().selectedConfiguration;
await debugService.startDebugging(launch, name, { noDebug: false });
} else {
const showSubSessions = configurationService.getValue<IDebugConfiguration>('debug').showSubSessionsInToolBar;
// Stop should be sent to the root parent session
while (!showSubSessions && session && session.parentSession) {
session = session.parentSession;
}
session.removeReplExpressions();
await debugService.restartSession(session);
}