let debugContentProvider support sessions

This commit is contained in:
Andre Weinand
2017-07-10 13:16:58 +02:00
parent 8efcb4e909
commit ce177da9e1
5 changed files with 39 additions and 14 deletions

View File

@@ -5,7 +5,7 @@
'use strict';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { IDebugService, IProcess, IConfig } from 'vs/workbench/parts/debug/common/debug';
import { IDebugService, IConfig } from 'vs/workbench/parts/debug/common/debug';
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
import { TPromise } from 'vs/base/common/winjs.base';
import { ExtHostContext, ExtHostDebugServiceShape, MainThreadDebugServiceShape, DebugSessionUUID } from '../node/extHost.protocol';
@@ -57,7 +57,7 @@ export class MainThreadDebugService extends MainThreadDebugServiceShape {
}
public $customDebugAdapterRequest(sessionId: DebugSessionUUID, request: string, args: any): TPromise<any> {
const process = this._findProcessByUUID(sessionId);
const process = this.debugService.findProcessByUUID(sessionId);
if (process) {
return process.session.custom(request, args).then(response => {
if (response.success) {
@@ -69,13 +69,4 @@ export class MainThreadDebugService extends MainThreadDebugServiceShape {
}
return TPromise.wrapError(new Error('debug session not found'));
}
private _findProcessByUUID(processId: DebugSessionUUID): IProcess | null {
const processes = this.debugService.getModel().getProcesses();
const result = processes.filter(process => process.getId() === processId);
if (result.length > 0) {
return result[0]; // there can only be one
}
return null;
}
}