提交 9825637f 编写于 作者: I isidor

debug: simplify reacting to exit events

上级 64067a6b
......@@ -167,7 +167,7 @@ export class DebugService implements debug.IDebugService {
(<RawDebugSession>session.raw).attach(session.configuration);
});
} else {
this.onRawSessionEnd(raw);
raw.disconnect().done(undefined, errors.onUnexpectedError);
this.doCreateSession(session.raw.root, { resolved: session.configuration, unresolved: session.unresolvedConfiguration }, session.getId());
}
......@@ -175,7 +175,7 @@ export class DebugService implements debug.IDebugService {
}
if (broadcast.channel === EXTENSION_TERMINATE_BROADCAST_CHANNEL) {
this.onRawSessionEnd(raw);
raw.disconnect().done(undefined, errors.onUnexpectedError);
return;
}
......@@ -285,8 +285,6 @@ export class DebugService implements debug.IDebugService {
}
private registerSessionListeners(session: debug.ISession, raw: RawDebugSession): void {
this.toDisposeOnSessionEnd.get(raw.getId()).push(raw);
this.toDisposeOnSessionEnd.get(raw.getId()).push(raw.onDidInitialize(event => {
aria.status(nls.localize('debuggingStarted', "Debugging started."));
const sendConfigurationDone = () => {
......@@ -447,7 +445,7 @@ export class DebugService implements debug.IDebugService {
});
}
if (session && session.getId() === event.sessionId) {
this.onRawSessionEnd(raw);
this.onExitAdapter(raw);
}
}));
......@@ -1172,7 +1170,7 @@ export class DebugService implements debug.IDebugService {
return undefined;
}
private onRawSessionEnd(raw: RawDebugSession): void {
private onExitAdapter(raw: RawDebugSession): void {
const breakpoints = this.model.getBreakpoints();
const session = this.model.getSessions().filter(p => p.getId() === raw.getId()).pop();
/* __GDPR__
......
......@@ -354,7 +354,7 @@ export class RawDebugSession implements debug.IRawSession {
if (this.debugAdapter && !this.disconnected) {
// point of no return: from now on don't report any errors
this.disconnected = true;
return this.send('disconnect', { restart: restart }, false).then(() => this.stopServer(), () => this.stopServer());
return this.send('disconnect', { restart }, false).then(() => this.stopServer(), () => this.stopServer());
}
return TPromise.as(null);
......@@ -513,8 +513,4 @@ export class RawDebugSession implements debug.IRawSession {
}
this._onDidExitAdapter.fire({ sessionId: this.getId() });
}
public dispose(): void {
this.disconnect().done(null, errors.onUnexpectedError);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册