Debug API: add registerDebugAdapterTracker

This commit is contained in:
Andre Weinand
2018-11-20 00:49:22 +01:00
parent 18656c9c13
commit 509f1233e4
4 changed files with 32 additions and 8 deletions

View File

@@ -230,7 +230,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
return this._debugServiceProxy.$startDebugging(folder ? folder.uri : undefined, nameOrConfig);
}
public registerDebugConfigurationProvider(extension: IExtensionDescription, type: string, provider: vscode.DebugConfigurationProvider): vscode.Disposable {
public registerDebugConfigurationProvider(type: string, provider: vscode.DebugConfigurationProvider): vscode.Disposable {
if (!provider) {
return new Disposable(() => { });
@@ -242,8 +242,9 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
this._debugServiceProxy.$registerDebugConfigurationProvider(type,
!!provider.provideDebugConfigurations,
!!provider.resolveDebugConfiguration,
!!provider.debugAdapterExecutable, // TODO@AW: legacy
!!provider.provideDebugAdapterTracker, handle);
!!provider.debugAdapterExecutable, // TODO@AW: deprecated
!!provider.provideDebugAdapterTracker, // TODO@AW: deprecated
handle);
return new Disposable(() => {
this._configProviders = this._configProviders.filter(p => p.provider !== provider); // remove
@@ -278,6 +279,17 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
});
}
public registerDebugAdapterTracker(debugType: string, callback: (session: vscode.DebugSession) => vscode.DebugAdapterTracker | undefined) {
const provider: vscode.DebugConfigurationProvider = {
provideDebugAdapterTracker(session: vscode.DebugSession) {
return callback(session);
}
};
return this.registerDebugConfigurationProvider(debugType, provider);
}
// RPC methods (ExtHostDebugServiceShape)
public $runInTerminal(args: DebugProtocol.RunInTerminalRequestArguments, config: ITerminalSettings): Thenable<number | undefined> {