提交 0d895b5b 编写于 作者: I isidor

debug: more async await

上级 491eb9bb
......@@ -367,8 +367,8 @@ export class FocusSessionAction extends AbstractDebugAction {
super(id, label, '', debugService, keybindingService);
}
run(session: IDebugSession): Promise<any> {
this.debugService.focusStackFrame(undefined, undefined, session, true);
async run(session: IDebugSession): Promise<any> {
await this.debugService.focusStackFrame(undefined, undefined, session, true);
const stackFrame = this.debugService.getViewModel().focusedStackFrame;
if (stackFrame) {
return stackFrame.openInEditor(this.editorService, true);
......
......@@ -727,9 +727,9 @@ export class DebugSession implements IDebugSession {
// Call fetch call stack twice, the first only return the top stack frame.
// Second retrieves the rest of the call stack. For performance reasons #25605
const promises = this.model.fetchCallStack(<Thread>thread);
const focus = () => {
const focus = async () => {
if (!event.body.preserveFocusHint && thread.getCallStack().length) {
this.debugService.focusStackFrame(undefined, thread);
await this.debugService.focusStackFrame(undefined, thread);
if (thread.stoppedDetails) {
if (this.configurationService.getValue<IDebugConfiguration>('debug').openDebug === 'openOnDebugBreak') {
this.viewletService.openViewlet(VIEWLET_ID);
......
......@@ -991,10 +991,10 @@ class SelectReplAction extends Action {
super(id, label);
}
run(session: IDebugSession): Promise<any> {
async run(session: IDebugSession): Promise<any> {
// If session is already the focused session we need to manualy update the tree since view model will not send a focused change event
if (session && session.state !== State.Inactive && session !== this.debugService.getViewModel().focusedSession) {
this.debugService.focusStackFrame(undefined, undefined, session, true);
await this.debugService.focusStackFrame(undefined, undefined, session, true);
} else {
this.replService.selectSession(session);
}
......
......@@ -732,7 +732,7 @@ export interface IDebugService {
/**
* Sets the focused stack frame and evaluates all expressions against the newly focused stack frame,
*/
focusStackFrame(focusedStackFrame: IStackFrame | undefined, thread?: IThread, session?: IDebugSession, explicit?: boolean): void;
focusStackFrame(focusedStackFrame: IStackFrame | undefined, thread?: IThread, session?: IDebugSession, explicit?: boolean): Promise<void>;
/**
* Adds new breakpoints to the model for the file specified with the uri. Notifies debug adapter of breakpoint changes.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册