Allow debug adapters to customize the behavior of 'restart'

fixes #14189
This commit is contained in:
isidor 2016-11-14 15:48:44 +01:00
parent e6c42e9ffc
commit 2dd13b4c44

View file

@ -774,13 +774,21 @@ export class DebugService implements debug.IDebugService {
}
public restartProcess(process: debug.IProcess): TPromise<any> {
return process ? process.session.disconnect(true).then(() =>
if (!process) {
return this.createProcess(this.viewModel.selectedConfigurationName);
}
if (process.session.configuration.capabilities.supportsRestartRequest) {
return process.session.custom('restart', null);
}
return process.session.disconnect(true).then(() =>
new TPromise<void>((c, e) => {
setTimeout(() => {
this.createProcess(process.name).then(() => c(null), err => e(err));
}, 300);
})
) : this.createProcess(this.viewModel.selectedConfigurationName);
);
}
private onSessionEnd(session: RawDebugSession): void {