提交 f00b1134 编写于 作者: I isidor

debug polish: remove debugService.setBreakpointsForModel

上级 57db1cf6
......@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import nls = require('vs/nls');
import { TPromise } from 'vs/base/common/winjs.base';
import objects = require('vs/base/common/objects');
import lifecycle = require('vs/base/common/lifecycle');
import editorcommon = require('vs/editor/common/editorCommon');
......@@ -223,7 +224,12 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
}
modelData.dirty = !!this.debugService.getActiveSession();
this.debugService.setBreakpointsForModel(modelUrl, data);
const toRemove = this.debugService.getModel().getBreakpoints()
.filter(bp => bp.source.uri.toString() === modelUrl.toString());
TPromise.join(toRemove.map(bp => this.debugService.removeBreakpoints(bp.getId()))).then(() => {
this.debugService.addBreakpoints(data);
});
}
private onBreakpointsChange(): void {
......
......@@ -304,7 +304,6 @@ export interface IDebugService {
/**
* General breakpoints manipulation.
*/
setBreakpointsForModel(modelUri: uri, rawData: IRawBreakpoint[]): void;
addBreakpoints(rawBreakpoints: IRawBreakpoint[]): TPromise<void[]>;
enableOrDisableAllBreakpoints(enabled: boolean): TPromise<void>;
toggleEnablement(element: IEnablement): TPromise<void>;
......
......@@ -426,12 +426,6 @@ export class DebugService implements debug.IDebugService {
}
}
public setBreakpointsForModel(modelUri: uri, rawData: debug.IRawBreakpoint[]): void {
this.model.removeBreakpoints(
this.model.getBreakpoints().filter(bp => bp.source.uri.toString() === modelUri.toString()));
this.model.addBreakpoints(rawData);
}
public enableOrDisableAllBreakpoints(enabled: boolean): TPromise<void>{
this.model.enableOrDisableAllBreakpoints(enabled);
return this.sendAllBreakpoints();
......
......@@ -37,8 +37,6 @@ export class MockDebugService implements debug.IDebugService {
return TPromise.as(null);
}
public setBreakpointsForModel(modelUri: uri, rawData: debug.IRawBreakpoint[]): void {}
public addBreakpoints(rawBreakpoints: debug.IRawBreakpoint[]): TPromise<void[]> {
return TPromise.as(null);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册