remove obsolete Tracker API

This commit is contained in:
Andre Weinand
2018-12-14 13:53:17 +01:00
parent 63a98dde9c
commit ac39335c81
6 changed files with 11 additions and 53 deletions

View File

@@ -248,10 +248,6 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
console.error('DebugConfigurationProvider.debugAdapterExecutable is deprecated and will be removed soon; please use DebugAdapterDescriptorFactory.createDebugAdapterDescriptor instead.');
}
if (provider.provideDebugAdapterTracker) {
// console.error('DebugConfigurationProvider.provideDebugAdapterTracker is deprecated and will be removed soon; please use DebugAdapterTrackerFactory.createDebugAdapterTracker instead.');
}
let handle = this._configProviderHandleCounter++;
this._configProviders.push({ type, handle, provider });
@@ -259,7 +255,6 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
!!provider.provideDebugConfigurations,
!!provider.resolveDebugConfiguration,
!!provider.debugAdapterExecutable, // TODO@AW: deprecated
!!provider.provideDebugAdapterTracker, // TODO@AW: deprecated
handle);
return new Disposable(() => {
@@ -694,16 +689,10 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
const config = session.configuration;
const type = config.type;
const promises1 = this._configProviders
.filter(tuple => tuple.provider.provideDebugAdapterTracker && (tuple.type === type || tuple.type === '*'))
.map(tuple => asPromise(() => tuple.provider.provideDebugAdapterTracker(session, session.workspaceFolder, session.configuration, CancellationToken.None)).then(p => p).catch(err => null));
const promises2 = this._trackerFactories
const promises = this._trackerFactories
.filter(tuple => tuple.type === type || tuple.type === '*')
.map(tuple => asPromise(() => tuple.factory.createDebugAdapterTracker(session)).then(p => p).catch(err => null));
const promises = promises1.concat(promises2);
return Promise.race([
Promise.all(promises).then(trackers => {
trackers = trackers.filter(t => t); // filter null
@@ -934,27 +923,27 @@ class MultiTracker implements vscode.DebugAdapterTracker {
}
onWillStartSession(): void {
this.trackers.forEach(t => t.onWillStartSession ? t.onWillStartSession() : (t.startDebugAdapter ? t.startDebugAdapter() : undefined));
this.trackers.forEach(t => t.onWillStartSession ? t.onWillStartSession() : undefined);
}
onWillReceiveMessage(message: any): void {
this.trackers.forEach(t => t.onWillReceiveMessage ? t.onWillReceiveMessage(message) : (t.toDebugAdapter ? t.toDebugAdapter(message) : undefined));
this.trackers.forEach(t => t.onWillReceiveMessage ? t.onWillReceiveMessage(message) : undefined);
}
onDidSendMessage(message: any): void {
this.trackers.forEach(t => t.onDidSendMessage ? t.onDidSendMessage(message) : (t.fromDebugAdapter ? t.fromDebugAdapter(message) : undefined));
this.trackers.forEach(t => t.onDidSendMessage ? t.onDidSendMessage(message) : undefined);
}
onWillStopSession(): void {
this.trackers.forEach(t => t.onWillStopSession ? t.onWillStopSession() : (t.stopDebugAdapter ? t.stopDebugAdapter() : undefined));
this.trackers.forEach(t => t.onWillStopSession ? t.onWillStopSession() : undefined);
}
onError(error: Error): void {
this.trackers.forEach(t => t.onError ? t.onError(error) : (t.debugAdapterError ? t.debugAdapterError(error) : undefined));
this.trackers.forEach(t => t.onError ? t.onError(error) : undefined);
}
onExit(code: number, signal: string): void {
this.trackers.forEach(t => t.onExit ? t.onExit(code, signal) : (t.debugAdapterExit ? t.debugAdapterExit(code, signal) : undefined));
this.trackers.forEach(t => t.onExit ? t.onExit(code, signal) : undefined);
}
}