提交 1035cd04 编写于 作者: I isidor

debug: clear breakpoint soure raw source reference on debug session end

上级 5884fe2b
......@@ -312,8 +312,6 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
private loadBreakpoints(): debug.IBreakpoint[] {
try {
return JSON.parse(this.storageService.get(DEBUG_BREAKPOINTS_KEY, StorageScope.WORKSPACE, '[]')).map((breakpoint: any) => {
// Source reference changes across sessions, so we do not use it to persist the source.
delete breakpoint.source.raw.sourceReference;
return new model.Breakpoint(new Source(breakpoint.source.raw ? breakpoint.source.raw : { path: uri.parse(breakpoint.source.uri).fsPath, name: breakpoint.source.name }),
breakpoint.desiredLineNumber || breakpoint.lineNumber, breakpoint.enabled, breakpoint.condition);
});
......@@ -631,8 +629,12 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
this.setStateAndEmit(debug.State.Inactive);
// set breakpoints back to unverified since the session ended.
// source reference changes across sessions, so we do not use it to persist the source.
const data: {[id: string]: { line: number, verified: boolean } } = { };
this.model.getBreakpoints().forEach(bp => data[bp.getId()] = { line: bp.lineNumber, verified: false });
this.model.getBreakpoints().forEach(bp => {
delete bp.source.raw.sourceReference;
data[bp.getId()] = { line: bp.lineNumber, verified: false };
});
this.model.updateBreakpoints(data);
this.inDebugMode.reset();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册