Merge from vscode de81ccf04849309f843db21130c806a5783678f7 (#4738)

This commit is contained in:
Anthony Dresser
2019-03-28 13:06:16 -07:00
committed by GitHub
parent cc2951265e
commit e6785ffe95
77 changed files with 562 additions and 835 deletions

View File

@@ -149,7 +149,19 @@ export function registerCommands(): void {
primary: KeyCode.F6,
when: CONTEXT_DEBUG_STATE.isEqualTo('running'),
handler: (accessor: ServicesAccessor, _: string, thread: IThread | undefined) => {
getThreadAndRun(accessor, thread, thread => thread.pause());
const debugService = accessor.get(IDebugService);
if (!(thread instanceof Thread)) {
thread = debugService.getViewModel().focusedThread;
if (!thread) {
const session = debugService.getViewModel().focusedSession;
const threads = session && session.getAllThreads();
thread = threads && threads.length ? threads[0] : undefined;
}
}
if (thread) {
thread.pause().then(undefined, onUnexpectedError);
}
}
});