提交 3d3a7e22 编写于 作者: I isidor

fixes #87745

上级 06bb703b
......@@ -34,6 +34,7 @@ import { IOpenerService } from 'vs/platform/opener/common/opener';
import { variableSetEmitter } from 'vs/workbench/contrib/debug/browser/variablesView';
import { CancellationTokenSource, CancellationToken } from 'vs/base/common/cancellation';
import { distinct } from 'vs/base/common/arrays';
import { INotificationService } from 'vs/platform/notification/common/notification';
export class DebugSession implements IDebugSession {
......@@ -74,7 +75,8 @@ export class DebugSession implements IDebugSession {
@IWorkspaceContextService private readonly workspaceContextService: IWorkspaceContextService,
@IProductService private readonly productService: IProductService,
@IExtensionHostDebugService private readonly extensionHostDebugService: IExtensionHostDebugService,
@IOpenerService private readonly openerService: IOpenerService
@IOpenerService private readonly openerService: IOpenerService,
@INotificationService private readonly notificationService: INotificationService
) {
this.id = generateUuid();
this._options = options || {};
......@@ -711,6 +713,7 @@ export class DebugSession implements IDebugSession {
await this.raw.configurationDone();
} catch (e) {
// Disconnect the debug session on configuration done error #10596
this.notificationService.error(e);
if (this.raw) {
this.raw.disconnect();
}
......
......@@ -623,13 +623,7 @@ export class RawDebugSession implements IDisposable {
}
});
}
}).then(res => {
if (typeof res.success === 'boolean' && res.success === false) {
return Promise.reject(this.handleErrorResponse(res));
}
return res as R;
}, err => Promise.reject(this.handleErrorResponse(err)));
}).then(undefined, err => Promise.reject(this.handleErrorResponse(err)));
}
private handleErrorResponse(errorResponse: DebugProtocol.Response): Error {
......
......@@ -30,7 +30,7 @@ suite('Debug - ANSI Handling', () => {
*/
setup(() => {
model = new DebugModel([], [], [], [], [], <any>{ isDirty: (e: any) => false });
session = new DebugSession({ resolved: { name, type: 'node', request: 'launch' }, unresolved: undefined }, undefined!, model, undefined, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, NullOpenerService);
session = new DebugSession({ resolved: { name, type: 'node', request: 'launch' }, unresolved: undefined }, undefined!, model, undefined, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, NullOpenerService, undefined!);
const instantiationService: TestInstantiationService = <TestInstantiationService>workbenchInstantiationService();
linkDetector = instantiationService.createInstance(LinkDetector);
......
......@@ -18,7 +18,7 @@ import { RawDebugSession } from 'vs/workbench/contrib/debug/browser/rawDebugSess
import { timeout } from 'vs/base/common/async';
function createMockSession(model: DebugModel, name = 'mockSession', options?: IDebugSessionOptions): DebugSession {
return new DebugSession({ resolved: { name, type: 'node', request: 'launch' }, unresolved: undefined }, undefined!, model, options, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, NullOpenerService);
return new DebugSession({ resolved: { name, type: 'node', request: 'launch' }, unresolved: undefined }, undefined!, model, options, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, NullOpenerService, undefined!);
}
suite('Debug - Model', () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册