debug: shut down debug sessions if an extension host goes away (#187169)

Fixes #184552
This commit is contained in:
Connor Peet
2023-07-06 20:04:59 +02:00
committed by GitHub
parent 078d0fd6e3
commit ccbcba53e6
2 changed files with 8 additions and 2 deletions
@@ -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();