Repository: microsoft/vscode (TypeScript)
Date: 2023-02-02 15:24:40+00:00
Task type: Bug Fix

Issue:
Breakpoint option "Uncaught Exceptions" is activated automatically
Type: <b>Bug</b>

## Behaviour
Expected:
If I uncheck the breakpoint option "Uncaught Exceptions", it should remain unchecked even after restarting vs code.
Actual:
The option is always activated again.

## Steps to reproduce:
* start vscode
* Uncheck "Uncaught Exceptions"
* Restart vs code
* Start debugging
* -> Option is checked again

_____________________

I originally posted this ticket for the vs code python extension. However, it seems to be a vs code problem: 
 https://github.com/microsoft/debugpy/issues/1174
_____________________
VS Code version: Code 1.74.3 (97dec172d3256f8ca4bfb2143f3f76b503ca0534, 2023-01-09T16:59:02.252Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Sandboxed: No

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-10875H CPU @ 2.30GHz (16 x 2304)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: disabled_off<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>skia_renderer: enabled_on<br>video_decode: enabled<br>video_encode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: disabled_off|
|Load (avg)|undefined|
|Memory (System)|31.64GB (22.80GB free)|
|Process Argv|. --enable-proposed-api genuitecllc.codetogether|
|Screen Reader|no|
|VM|0%|
</details><details><summary>Extensions (17)</summary>

Extension|Author (truncated)|Version
---|---|---
Bookmarks|ale|13.3.1
vscode-svgviewer|css|2.0.0
xml|Dot|2.5.1
vscode-todo-plus|fab|4.19.0
git-graph|mhu|1.30.0
autopep8|ms-|2022.2.0
isort|ms-|2022.8.0
pylint|ms-|2022.6.0
python|ms-|2022.20.2
vscode-pylance|ms-|2023.1.30
remote-ssh|ms-|0.94.0
remote-ssh-edit|ms-|0.84.0
remote-wsl|ms-|0.72.0
remote-explorer|ms-|0.0.3
d2|Ter|0.6.0
errorlens|use|3.6.0
vscode-icons|vsc|12.2.0


</details>
<!-- generated by issue reporter -->


Issue discussion:

Solution patch:
diff --git a/src/vs/workbench/contrib/debug/common/debugModel.ts b/src/vs/workbench/contrib/debug/common/debugModel.ts
--- a/src/vs/workbench/contrib/debug/common/debugModel.ts
+++ b/src/vs/workbench/contrib/debug/common/debugModel.ts
@@ -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;
 	}


Test patch:
diff --git a/src/vs/workbench/contrib/debug/test/common/debugModel.test.ts b/src/vs/workbench/contrib/debug/test/common/debugModel.test.ts
new file mode 100644
--- /dev/null
+++ b/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));
+		});
+	});
+});