Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,16 @@
"description": "Show return value of functions when stepping.",
"type": "boolean"
},
"steppingResumesAllThreads": {
"default": true,
"description": "If true, all threads are resumed while stepping. If false, only the thread being stepped is resumed.",
"type": "boolean"
},
"stopAllThreadsOnSuspend": {
"default": true,
"description": "If true, all threads are suspended when a breakpoint is hit or the program is paused. If false, only the thread that triggered the stop is suspended.",
"type": "boolean"
},
"subProcess": {
"default": false,
"description": "Whether to enable Sub Process debugging",
Expand Down Expand Up @@ -633,6 +643,16 @@
"description": "Show return value of functions when stepping.",
"type": "boolean"
},
"steppingResumesAllThreads": {
"default": true,
"description": "If true, all threads are resumed while stepping. If false, only the thread being stepped is resumed.",
"type": "boolean"
},
"stopAllThreadsOnSuspend": {
"default": true,
"description": "If true, all threads are suspended when a breakpoint is hit or the program is paused. If false, only the thread that triggered the stop is suspended.",
"type": "boolean"
},
"stopOnEntry": {
"default": false,
"description": "Automatically stop after launch.",
Expand Down
4 changes: 4 additions & 0 deletions src/extension/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ interface ICommonDebugArguments {
host?: string;
// Show return values of functions while stepping.
showReturnValue?: boolean;
// Resume all threads (true, the default) or only the stepping thread (false) during a step.
steppingResumesAllThreads?: boolean;
// Suspend all threads (true, the default) or only the stopping thread (false) on a breakpoint or pause.
stopAllThreadsOnSuspend?: boolean;
subProcess?: boolean;
// SystemExit codes (and/or inclusive ranges) that cause the debugger to break.
// An empty array disables breaking on SystemExit entirely.
Expand Down
29 changes: 29 additions & 0 deletions src/test/unittest/launchJsonSchema.unit.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

'use strict';

import { expect } from 'chai';
import * as fs from 'fs';
import * as path from 'path';

suite('Debugging - launch.json schema', () => {
const packageJsonPath = path.resolve(__dirname, '..', '..', '..', 'package.json');
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
const debuggerContribution = packageJson.contributes.debuggers.find((d: { type: string }) => d.type === 'debugpy');

['launch', 'attach'].forEach((request) => {
suite(`${request} configuration`, () => {
const properties = debuggerContribution.configurationAttributes[request].properties;

['steppingResumesAllThreads', 'stopAllThreadsOnSuspend'].forEach((option) => {
test(`${option} is declared as a boolean that defaults to true`, () => {
expect(properties).to.have.property(option);
expect(properties[option].type).to.equal('boolean');
expect(properties[option].default).to.equal(true);
expect(properties[option].description).to.be.a('string').that.is.not.empty;
});
});
});
});
});