mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 03:29:00 +01:00
let debugContentProvider support sessions
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user