mirror of
https://github.com/Microsoft/vscode
synced 2024-09-18 01:58:27 +00:00
Merge pull request #7367 from edumunoz/edumunoz/fix-leaking-bp-runcursor
Fixes #7366 Remove leaked breakpoint after stopping with run-to-cursor
This commit is contained in:
commit
7b336621fd
|
@ -257,11 +257,6 @@ export interface IRawDebugSession {
|
||||||
|
|
||||||
custom(request: string, args: any): TPromise<DebugProtocol.Response>;
|
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>;
|
onDidEvent: Event<DebugProtocol.Event>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -557,11 +557,13 @@ export class RunToCursorAction extends EditorAction {
|
||||||
const lineNumber = this.editor.getPosition().lineNumber;
|
const lineNumber = this.editor.getPosition().lineNumber;
|
||||||
const uri = this.editor.getModel().uri;
|
const uri = this.editor.getModel().uri;
|
||||||
|
|
||||||
const oneTimeListener = this.debugService.getActiveSession().onDidStop(() => {
|
const oneTimeListener = this.debugService.getActiveSession().onDidEvent(event => {
|
||||||
|
if (event.event === 'stopped' || event.event === 'exit') {
|
||||||
const toRemove = this.debugService.getModel().getBreakpoints()
|
const toRemove = this.debugService.getModel().getBreakpoints()
|
||||||
.filter(bp => bp.lineNumber === lineNumber && bp.source.uri.toString() === uri.toString()).pop();
|
.filter(bp => bp.lineNumber === lineNumber && bp.source.uri.toString() === uri.toString()).pop();
|
||||||
this.debugService.removeBreakpoints(toRemove.getId());
|
this.debugService.removeBreakpoints(toRemove.getId());
|
||||||
oneTimeListener.dispose();
|
oneTimeListener.dispose();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return this.debugService.addBreakpoints([{ uri, lineNumber }]).then(() => {
|
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> {
|
public get onDidEvent(): Event<DebugProtocol.Event> {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue