提交 5f25c245 编写于 作者: I isidor

debugService.onDidEndProcess

上级 2431dca3
......@@ -432,6 +432,11 @@ export interface IDebugService {
*/
onDidChangeState: Event<State>;
/**
* Allows to register on end process events.
*/
onDidEndProcess: Event<IProcess>;
/**
* Gets the current configuration manager.
*/
......
......@@ -68,6 +68,7 @@ export class DebugService implements debug.IDebugService {
private sessionStates: Map<string, debug.State>;
private _onDidChangeState: Emitter<debug.State>;
private _onDidEndProcess: Emitter<debug.IProcess>;
private model: Model;
private viewModel: ViewModel;
private configurationManager: ConfigurationManager;
......@@ -107,6 +108,7 @@ export class DebugService implements debug.IDebugService {
this.toDisposeOnSessionEnd = new Map<string, lifecycle.IDisposable[]>();
this.breakpointsToSendOnResourceSaved = new Set<string>();
this._onDidChangeState = new Emitter<debug.State>();
this._onDidEndProcess = new Emitter<debug.IProcess>();
this.sessionStates = new Map<string, debug.State>();
this.configurationManager = this.instantiationService.createInstance(ConfigurationManager);
......@@ -482,6 +484,10 @@ export class DebugService implements debug.IDebugService {
return this._onDidChangeState.event;
}
public get onDidEndProcess(): Event<debug.IProcess> {
return this._onDidEndProcess.event;
}
private updateStateAndEmit(sessionId?: string, newState?: debug.State): void {
if (sessionId) {
if (newState === debug.State.Inactive) {
......@@ -959,6 +965,9 @@ export class DebugService implements debug.IDebugService {
});
this.model.removeProcess(session.getId());
if (process) {
this._onDidEndProcess.fire(process);
}
this.toDisposeOnSessionEnd.set(session.getId(), lifecycle.dispose(this.toDisposeOnSessionEnd.get(session.getId())));
const focusedProcess = this.viewModel.focusedProcess;
......
......@@ -15,6 +15,10 @@ export class MockDebugService implements debug.IDebugService {
return null;
}
public get onDidEndProcess(): Event<debug.IProcess> {
return null;
}
public get onDidChangeState(): Event<debug.State> {
return null;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册