mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 03:54:24 +01:00
Debug API: add registerDebugAdapterTracker
This commit is contained in:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user