mirror of
https://github.com/Microsoft/vscode
synced 2024-10-30 06:38:23 +00:00
Allow debug adapters to customize the behavior of 'restart'
fixes #14189
This commit is contained in:
parent
e6c42e9ffc
commit
2dd13b4c44
1 changed files with 10 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue