support for debugAdapterExecutable; fixes #33801

This commit is contained in:
Andre Weinand
2018-01-29 14:27:48 +01:00
parent c0a5a09ab4
commit 81142e2cb5
10 changed files with 96 additions and 9 deletions

View File

@@ -263,7 +263,10 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
let handle = this.nextHandle();
this._handlers.set(handle, provider);
this._debugServiceProxy.$registerDebugConfigurationProvider(type, !!provider.provideDebugConfigurations, !!provider.resolveDebugConfiguration, handle);
this._debugServiceProxy.$registerDebugConfigurationProvider(type,
!!provider.provideDebugConfigurations,
!!provider.resolveDebugConfiguration,
!!provider.debugAdapterExecutable, handle);
return new Disposable(() => {
this._handlers.delete(handle);
@@ -293,6 +296,17 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
return asWinJsPromise(token => handler.resolveDebugConfiguration(this.getFolder(folderUri), debugConfiguration, token));
}
public $debugAdapterExecutable(handle: number, folderUri: UriComponents | undefined): TPromise<vscode.DebugAdapterExecutable> {
let handler = this._handlers.get(handle);
if (!handler) {
return TPromise.wrapError<vscode.DebugAdapterExecutable>(new Error('no handler found'));
}
if (!handler.debugAdapterExecutable) {
return TPromise.wrapError<vscode.DebugAdapterExecutable>(new Error('handler has no method debugAdapterExecutable'));
}
return asWinJsPromise(token => handler.debugAdapterExecutable(this.getFolder(folderUri), token));
}
public startDebugging(folder: vscode.WorkspaceFolder | undefined, nameOrConfig: string | vscode.DebugConfiguration): TPromise<boolean> {
return this._debugServiceProxy.$startDebugging(folder ? folder.uri : undefined, nameOrConfig);
}