mirror of
https://github.com/Microsoft/vscode
synced 2024-10-02 17:32:41 +00:00
debug: shut down debug sessions if an extension host goes away (#187169)
Fixes #184552
This commit is contained in:
parent
078d0fd6e3
commit
ccbcba53e6
|
@ -3,7 +3,7 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { DisposableStore, toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { URI as uri, UriComponents } from 'vs/base/common/uri';
|
||||
import { IDebugService, IConfig, IDebugConfigurationProvider, IBreakpoint, IFunctionBreakpoint, IBreakpointData, IDebugAdapter, IDebugAdapterDescriptorFactory, IDebugSession, IDebugAdapterFactory, IDataBreakpoint, IDebugSessionOptions, IInstructionBreakpoint, DebugConfigurationProviderTriggerKind } from 'vs/workbench/contrib/debug/common/debug';
|
||||
import {
|
||||
|
@ -50,6 +50,11 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb
|
|||
this._toDispose.add(debugService.getViewModel().onDidFocusSession(session => {
|
||||
this._proxy.$acceptDebugSessionActiveChanged(this.getSessionDto(session));
|
||||
}));
|
||||
this._toDispose.add(toDisposable(() => {
|
||||
for (const [handle, da] of this._debugAdapters) {
|
||||
da.fireError(handle, new Error('Extension host shut down'));
|
||||
}
|
||||
}));
|
||||
|
||||
this._debugAdapters = new Map();
|
||||
this._debugConfigurationProviders = new Map();
|
||||
|
|
|
@ -573,7 +573,8 @@ export class RawDebugSession implements IDisposable {
|
|||
args.suspendDebuggee = suspendDebuggee;
|
||||
}
|
||||
|
||||
await this.send('disconnect', args, undefined, 2000);
|
||||
// if there's an error, the DA is probably already gone, so give it a much shorter timeout.
|
||||
await this.send('disconnect', args, undefined, error ? 200 : 2000);
|
||||
} catch (e) {
|
||||
// Catch the potential 'disconnect' error - no need to show it to the user since the adapter is shutting down
|
||||
} finally {
|
||||
|
|
Loading…
Reference in a new issue