mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
Fixes #7366 Remove leaked breakpoint after stopping with run-to-cursor
This commit is contained in:
parent
9b767f947d
commit
d377857bcb
|
@ -257,11 +257,6 @@ export interface IRawDebugSession {
|
|||
|
||||
custom(request: string, args: any): TPromise<DebugProtocol.Response>;
|
||||
|
||||
/**
|
||||
* Allows to register on each debug session stop event.
|
||||
*/
|
||||
onDidStop: Event<DebugProtocol.StoppedEvent>;
|
||||
|
||||
onDidEvent: Event<DebugProtocol.Event>;
|
||||
}
|
||||
|
||||
|
|
|
@ -557,11 +557,13 @@ export class RunToCursorAction extends EditorAction {
|
|||
const lineNumber = this.editor.getPosition().lineNumber;
|
||||
const uri = this.editor.getModel().uri;
|
||||
|
||||
const oneTimeListener = this.debugService.getActiveSession().onDidStop(() => {
|
||||
const toRemove = this.debugService.getModel().getBreakpoints()
|
||||
.filter(bp => bp.lineNumber === lineNumber && bp.source.uri.toString() === uri.toString()).pop();
|
||||
this.debugService.removeBreakpoints(toRemove.getId());
|
||||
oneTimeListener.dispose();
|
||||
const oneTimeListener = this.debugService.getActiveSession().onDidEvent(event => {
|
||||
if (event.event === 'stopped' || event.event === 'exit') {
|
||||
const toRemove = this.debugService.getModel().getBreakpoints()
|
||||
.filter(bp => bp.lineNumber === lineNumber && bp.source.uri.toString() === uri.toString()).pop();
|
||||
this.debugService.removeBreakpoints(toRemove.getId());
|
||||
oneTimeListener.dispose();
|
||||
}
|
||||
});
|
||||
|
||||
return this.debugService.addBreakpoints([{ uri, lineNumber }]).then(() => {
|
||||
|
|
|
@ -135,10 +135,6 @@ class MockRawSession implements debug.IRawDebugSession {
|
|||
};
|
||||
}
|
||||
|
||||
public get onDidStop(): Event<DebugProtocol.StoppedEvent> {
|
||||
return null;
|
||||
}
|
||||
|
||||
public get onDidEvent(): Event<DebugProtocol.Event> {
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue