Skip to content

Commit fcf6c22

Browse files
committed
Revert "debug: do not send terminate to EH debugging"
This reverts commit 7df1ed4.
1 parent fea0ee3 commit fcf6c22

2 files changed

Lines changed: 6 additions & 9 deletions

File tree

src/vs/workbench/parts/debug/electron-browser/debugSession.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ export class Session implements ISession {
234234
}
235235

236236
return dbgr.getCustomTelemetryService().then(customTelemetryService => {
237-
this._raw = this.instantiationService.createInstance(RawDebugSession, this.id, this._configuration.resolved, dbgr, customTelemetryService, this.root);
237+
this._raw = this.instantiationService.createInstance(RawDebugSession, this.id, this._configuration.resolved.debugServer, dbgr, customTelemetryService, this.root);
238238
this.registerListeners();
239239

240240
return this._raw.initialize({

src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
1616
import { INotificationService } from 'vs/platform/notification/common/notification';
1717
import { formatPII } from 'vs/workbench/parts/debug/common/debugUtils';
1818
import { SocketDebugAdapter } from 'vs/workbench/parts/debug/node/debugAdapter';
19-
import { DebugEvent, IRawSession, IDebugAdapter, IConfig } from 'vs/workbench/parts/debug/common/debug';
19+
import { DebugEvent, IRawSession, IDebugAdapter } from 'vs/workbench/parts/debug/common/debug';
2020
import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation';
21-
import { equalsIgnoreCase } from 'vs/base/common/strings';
2221

2322
export interface SessionExitedEvent extends DebugEvent {
2423
body: {
@@ -48,8 +47,7 @@ export class RawDebugSession implements IRawSession {
4847
private cancellationTokens: CancellationTokenSource[];
4948
private _capabilities: DebugProtocol.Capabilities;
5049
private allThreadsContinued: boolean;
51-
private debugServerPort: number;
52-
private isAttach: boolean;
50+
private isAttached: boolean;
5351

5452
private readonly _onDidInitialize: Emitter<DebugProtocol.InitializedEvent>;
5553
private readonly _onDidStop: Emitter<DebugProtocol.StoppedEvent>;
@@ -66,7 +64,7 @@ export class RawDebugSession implements IRawSession {
6664

6765
constructor(
6866
private sessionId: string,
69-
configuration: IConfig,
67+
private debugServerPort: number,
7068
private _debugger: Debugger,
7169
public customTelemetryService: ITelemetryService,
7270
private root: IWorkspaceFolder,
@@ -78,8 +76,6 @@ export class RawDebugSession implements IRawSession {
7876
this.readyForBreakpoints = false;
7977
this.allThreadsContinued = true;
8078
this.cancellationTokens = [];
81-
this.debugServerPort = configuration.debugServer;
82-
this.isAttach = configuration.request === 'attach' || equalsIgnoreCase(configuration.type, 'extensionHost');
8379

8480
this._onDidInitialize = new Emitter<DebugProtocol.InitializedEvent>();
8581
this._onDidStop = new Emitter<DebugProtocol.StoppedEvent>();
@@ -292,6 +288,7 @@ export class RawDebugSession implements IRawSession {
292288
}
293289

294290
public attach(args: DebugProtocol.AttachRequestArguments): TPromise<DebugProtocol.AttachResponse> {
291+
this.isAttached = true;
295292
return this.send('attach', args).then(response => this.readCapabilities(response));
296293
}
297294

@@ -350,7 +347,7 @@ export class RawDebugSession implements IRawSession {
350347
}
351348

352349
public terminate(restart = false): TPromise<DebugProtocol.TerminateResponse> {
353-
if (this.capabilities.supportsTerminateRequest && !this.terminated && !this.isAttach) {
350+
if (this.capabilities.supportsTerminateRequest && !this.terminated && !this.isAttached) {
354351
this.terminated = true;
355352
return this.send('terminate', { restart });
356353
}

0 commit comments

Comments
 (0)