From 1131e1fab88672b4066569068878ad3e97a9add2 Mon Sep 17 00:00:00 2001 From: Anton Kosyakov Date: Mon, 28 Jan 2019 13:36:23 +0000 Subject: [PATCH] [node-debug] fix #4176: fixes for `Toggle skipping this file` command Signed-off-by: Anton Kosyakov --- packages/debug/src/browser/model/debug-thread.tsx | 4 +++- packages/plugin-ext/src/api/plugin-api.ts | 2 +- packages/plugin-ext/src/plugin/node/debug/debug.ts | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/debug/src/browser/model/debug-thread.tsx b/packages/debug/src/browser/model/debug-thread.tsx index 097c5968b09db..a330fc4bde1c3 100644 --- a/packages/debug/src/browser/model/debug-thread.tsx +++ b/packages/debug/src/browser/model/debug-thread.tsx @@ -61,6 +61,9 @@ export class DebugThread extends DebugThreadData implements TreeElement { update(data: Partial): void { Object.assign(this, data); + if ('stoppedDetails' in data) { + this.clearFrames(); + } } clear(): void { @@ -68,7 +71,6 @@ export class DebugThread extends DebugThreadData implements TreeElement { raw: this.raw, stoppedDetails: undefined }); - this.clearFrames(); } continue(): Promise { diff --git a/packages/plugin-ext/src/api/plugin-api.ts b/packages/plugin-ext/src/api/plugin-api.ts index 630e3ffc895b1..bb747db589310 100644 --- a/packages/plugin-ext/src/api/plugin-api.ts +++ b/packages/plugin-ext/src/api/plugin-api.ts @@ -977,7 +977,7 @@ export interface DebugMain { $addBreakpoints(breakpoints: Breakpoint[]): Promise; $removeBreakpoints(breakpoints: Breakpoint[]): Promise; $startDebugging(folder: theia.WorkspaceFolder | undefined, nameOrConfiguration: string | theia.DebugConfiguration): Promise; - $customRequest(command: string, args?: any): Promise; + $customRequest(sessionId: string, command: string, args?: any): Promise; } export const PLUGIN_RPC_CONTEXT = { diff --git a/packages/plugin-ext/src/plugin/node/debug/debug.ts b/packages/plugin-ext/src/plugin/node/debug/debug.ts index d7a5760ddb333..a2d0308d3e174 100644 --- a/packages/plugin-ext/src/plugin/node/debug/debug.ts +++ b/packages/plugin-ext/src/plugin/node/debug/debug.ts @@ -172,8 +172,8 @@ export class DebugExtImpl implements DebugExt { } async $sessionDidChange(sessionId: string | undefined): Promise { - const activeDebugSession = sessionId ? this.sessions.get(sessionId) : undefined; - this.onDidChangeActiveDebugSessionEmitter.fire(activeDebugSession); + this.activeDebugSession = sessionId ? this.sessions.get(sessionId) : undefined; + this.onDidChangeActiveDebugSessionEmitter.fire(this.activeDebugSession); } async $breakpointsDidChange(all: Breakpoint[], added: Breakpoint[], removed: Breakpoint[], changed: Breakpoint[]): Promise { @@ -190,7 +190,7 @@ export class DebugExtImpl implements DebugExt { sessionId, debugConfiguration, communicationProvider, - (command: string, args?: any) => this.proxy.$customRequest(command, args)); + (command: string, args?: any) => this.proxy.$customRequest(sessionId, command, args)); this.sessions.set(sessionId, debugAdapterSession); const connection = await this.connectionExt!.ensureConnection(sessionId);