Skip to content

Commit

Permalink
debug: do not store breakpoints activated, it should only be a tempor…
Browse files Browse the repository at this point in the history
…arty state
  • Loading branch information
isidorn committed Aug 28, 2019
1 parent 7f94be7 commit 20e24e8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
9 changes: 1 addition & 8 deletions src/vs/workbench/contrib/debug/browser/debugService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ import { isCodeEditor } from 'vs/editor/browser/editorBrowser';
import { CancellationTokenSource } from 'vs/base/common/cancellation';

const DEBUG_BREAKPOINTS_KEY = 'debug.breakpoint';
const DEBUG_BREAKPOINTS_ACTIVATED_KEY = 'debug.breakpointactivated';
const DEBUG_FUNCTION_BREAKPOINTS_KEY = 'debug.functionbreakpoint';
const DEBUG_DATA_BREAKPOINTS_KEY = 'debug.databreakpoint';
const DEBUG_EXCEPTION_BREAKPOINTS_KEY = 'debug.exceptionbreakpoint';
Expand Down Expand Up @@ -129,7 +128,7 @@ export class DebugService implements IDebugService {
this.debugState = CONTEXT_DEBUG_STATE.bindTo(contextKeyService);
this.inDebugMode = CONTEXT_IN_DEBUG_MODE.bindTo(contextKeyService);

this.model = new DebugModel(this.loadBreakpoints(), this.storageService.getBoolean(DEBUG_BREAKPOINTS_ACTIVATED_KEY, StorageScope.WORKSPACE, true), this.loadFunctionBreakpoints(),
this.model = new DebugModel(this.loadBreakpoints(), this.loadFunctionBreakpoints(),
this.loadExceptionBreakpoints(), this.loadDataBreakpoints(), this.loadWatchExpressions(), this.textFileService);
this.toDispose.push(this.model);

Expand Down Expand Up @@ -901,12 +900,6 @@ export class DebugService implements IDebugService {

setBreakpointsActivated(activated: boolean): Promise<void> {
this.model.setBreakpointsActivated(activated);
if (activated) {
this.storageService.store(DEBUG_BREAKPOINTS_ACTIVATED_KEY, 'false', StorageScope.WORKSPACE);
} else {
this.storageService.remove(DEBUG_BREAKPOINTS_ACTIVATED_KEY, StorageScope.WORKSPACE);
}

return this.sendAllBreakpoints();
}

Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/debug/common/debugModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -797,13 +797,13 @@ export class DebugModel implements IDebugModel {
private toDispose: lifecycle.IDisposable[];
private schedulers = new Map<string, RunOnceScheduler>();
private breakpointsSessionId: string | undefined;
private breakpointsActivated = true;
private readonly _onDidChangeBreakpoints: Emitter<IBreakpointsChangeEvent | undefined>;
private readonly _onDidChangeCallStack: Emitter<void>;
private readonly _onDidChangeWatchExpressions: Emitter<IExpression | undefined>;

constructor(
private breakpoints: Breakpoint[],
private breakpointsActivated: boolean,
private functionBreakpoints: FunctionBreakpoint[],
private exceptionBreakpoints: ExceptionBreakpoint[],
private dataBreakopints: DataBreakpoint[],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ suite('Debug - Model', () => {
let rawSession: MockRawSession;

setup(() => {
model = new DebugModel([], true, [], [], [], [], <any>{ isDirty: (e: any) => false });
model = new DebugModel([], [], [], [], [], <any>{ isDirty: (e: any) => false });
rawSession = new MockRawSession();
});

Expand Down

0 comments on commit 20e24e8

Please sign in to comment.