new proposed API stopDebugging; see #101883

This commit is contained in:
Andre Weinand
2020-07-09 10:49:05 +02:00
parent 5de084ce73
commit 673e35d278
5 changed files with 39 additions and 0 deletions

View File

@@ -270,6 +270,18 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb
return Promise.reject(new Error('debug session not found'));
}
public $stopDebugging(sessionId: DebugSessionUUID | undefined): Promise<void> {
if (sessionId) {
const session = this.debugService.getModel().getSession(sessionId, true);
if (session) {
return this.debugService.stopSession(session);
}
} else { // stop all
return this.debugService.stopSession(undefined);
}
return Promise.reject(new Error('debug session not found'));
}
public $appendDebugConsole(value: string): void {
// Use warning as severity to get the orange color for messages coming from the debug extension
const session = this.debugService.getViewModel().focusedSession;