support to launch debuggee from EH

This commit is contained in:
André Weinand
2018-04-12 00:55:44 +02:00
parent 5346c5e928
commit b578dc2bd1
9 changed files with 365 additions and 40 deletions

View File

@@ -6,7 +6,7 @@
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import uri from 'vs/base/common/uri';
import { IDebugService, IConfig, IDebugConfigurationProvider, IBreakpoint, IFunctionBreakpoint, IBreakpointData, IAdapterExecutable } from 'vs/workbench/parts/debug/common/debug';
import { IDebugService, IConfig, IDebugConfigurationProvider, IBreakpoint, IFunctionBreakpoint, IBreakpointData, IAdapterExecutable, ITerminalLauncher, ITerminalSettings } from 'vs/workbench/parts/debug/common/debug';
import { TPromise } from 'vs/base/common/winjs.base';
import {
ExtHostContext, ExtHostDebugServiceShape, MainThreadDebugServiceShape, DebugSessionUUID, MainContext,
@@ -54,7 +54,7 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape {
this._debugAdapters = new Map<number, ExtensionHostDebugAdapter>();
// register a default DA provider
// register a default EH DA provider
debugService.getConfigurationManager().registerDebugAdapterProvider('*', {
createDebugAdapter: (debugType, adapterInfo) => {
const handle = this._debugAdaptersHandleCounter++;
@@ -63,6 +63,9 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape {
return da;
}
});
// register a default EH terminal launcher
debugService.getConfigurationManager().registerEHTerminalLauncher(new ExtensionHostTerminalLauncher(this._proxy));
}
public dispose(): void {
@@ -281,3 +284,13 @@ class ExtensionHostDebugAdapter extends AbstractDebugAdapter {
return this._proxy.$stopDASession(this._handle);
}
}
class ExtensionHostTerminalLauncher implements ITerminalLauncher {
constructor(private _proxy: ExtHostDebugServiceShape) {
}
runInTerminal(args: DebugProtocol.RunInTerminalRequestArguments, config: ITerminalSettings): TPromise<void> {
return this._proxy.$runInTerminal(args, config);
}
}