Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing fields in ExceptionBreakpoint toJSON so they are restored correctly #173160

Merged
merged 1 commit into from Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/vs/workbench/contrib/debug/common/debugModel.ts
Expand Up @@ -1079,8 +1079,10 @@ export class ExceptionBreakpoint extends BaseBreakpoint implements IExceptionBre
result.label = this.label;
result.enabled = this.enabled;
result.supportsCondition = this.supportsCondition;
result.conditionDescription = this.conditionDescription;
result.condition = this.condition;
result.fallback = this.fallback;
result.description = this.description;

return result;
}
Expand Down
19 changes: 19 additions & 0 deletions src/vs/workbench/contrib/debug/test/common/debugModel.test.ts
@@ -0,0 +1,19 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import * as assert from 'assert';
import { ExceptionBreakpoint } from 'vs/workbench/contrib/debug/common/debugModel';

suite('DebugModel', () => {
suite('ExceptionBreakpoint', () => {
test('Restored matches new', () => {
const ebp = new ExceptionBreakpoint('id', 'label', true, true, 'condition', 'description', 'condition description', false);
const strigified = JSON.stringify(ebp);
const parsed = JSON.parse(strigified);
const newEbp = new ExceptionBreakpoint(parsed.filter, parsed.label, parsed.enabled, parsed.supportsCondition, parsed.condition, parsed.description, parsed.conditionDescription, !!parsed.fallback);
assert.ok(ebp.matches(newEbp));
});
});
});