Skip to content

Commit f8629dc

Browse files
committed
Add breakOnSystemExit setting to launch/attach schema
Exposes debugpy's breakOnSystemExit option (microsoft/debugpy#2017) in the extension's launch.json/attach configuration schema and TypeScript debug config types. Accepts an array of exit codes and/or inclusive {from,to} ranges to control which SystemExit codes cause the debugger to break. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 24c2d34b-15f0-45d2-bd59-8ee042269d20
1 parent 34aabdb commit f8629dc

2 files changed

Lines changed: 70 additions & 0 deletions

File tree

package.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,37 @@
186186
},
187187
"type": "object"
188188
},
189+
"breakOnSystemExit": {
190+
"description": "Controls which SystemExit exit codes cause the debugger to break. Accepts an array of exit codes and/or inclusive ranges. Set to an empty array to never break on SystemExit. When omitted, the debugger uses its default behavior (break on all non-zero exit codes, ignoring successful exits).",
191+
"type": "array",
192+
"items": {
193+
"oneOf": [
194+
{
195+
"type": "integer",
196+
"description": "A specific SystemExit code to break on."
197+
},
198+
{
199+
"type": "object",
200+
"additionalProperties": false,
201+
"description": "An inclusive range of SystemExit codes to break on.",
202+
"properties": {
203+
"from": {
204+
"type": "integer",
205+
"description": "Lower bound of the range (inclusive)."
206+
},
207+
"to": {
208+
"type": "integer",
209+
"description": "Upper bound of the range (inclusive)."
210+
}
211+
},
212+
"required": [
213+
"from",
214+
"to"
215+
]
216+
}
217+
]
218+
}
219+
},
189220
"connect": {
190221
"label": "Attach by connecting to debugpy over a socket.",
191222
"properties": {
@@ -405,6 +436,37 @@
405436
},
406437
"type": "object"
407438
},
439+
"breakOnSystemExit": {
440+
"description": "Controls which SystemExit exit codes cause the debugger to break. Accepts an array of exit codes and/or inclusive ranges. Set to an empty array to never break on SystemExit. When omitted, the debugger uses its default behavior (break on all non-zero exit codes, ignoring successful exits).",
441+
"type": "array",
442+
"items": {
443+
"oneOf": [
444+
{
445+
"type": "integer",
446+
"description": "A specific SystemExit code to break on."
447+
},
448+
{
449+
"type": "object",
450+
"additionalProperties": false,
451+
"description": "An inclusive range of SystemExit codes to break on.",
452+
"properties": {
453+
"from": {
454+
"type": "integer",
455+
"description": "Lower bound of the range (inclusive)."
456+
},
457+
"to": {
458+
"type": "integer",
459+
"description": "Upper bound of the range (inclusive)."
460+
}
461+
},
462+
"required": [
463+
"from",
464+
"to"
465+
]
466+
}
467+
]
468+
}
469+
},
408470
"console": {
409471
"default": "integratedTerminal",
410472
"description": "Where to launch the debug target: internal console, integrated terminal, or external terminal.",

src/extension/types.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ export type PathMapping = {
4343
remoteRoot: string;
4444
};
4545

46+
export type SystemExitRange = {
47+
from: number;
48+
to: number;
49+
};
50+
4651
type Connection = {
4752
host?: string;
4853
port?: number | string;
@@ -69,6 +74,9 @@ interface ICommonDebugArguments {
6974
// Show return values of functions while stepping.
7075
showReturnValue?: boolean;
7176
subProcess?: boolean;
77+
// SystemExit codes (and/or inclusive ranges) that cause the debugger to break.
78+
// An empty array disables breaking on SystemExit entirely.
79+
breakOnSystemExit?: (number | SystemExitRange)[];
7280
// An absolute path to local directory with source.
7381
pathMappings?: PathMapping[];
7482
}

0 commit comments

Comments
 (0)