Skip to content

Commit 8d0f73a

Browse files
committed
default debug config options
1 parent 9b435a2 commit 8d0f73a

5 files changed

Lines changed: 38 additions & 10 deletions

File tree

package.json

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,9 @@
161161
"default": false
162162
},
163163
"console": {
164-
"enum": [ "internalConsole", "integratedTerminal", "externalTerminal" ],
164+
"enum": [ "none", "integratedTerminal", "externalTerminal" ],
165165
"description": "Where to launch the debug target: internal console, integrated terminal, or external terminal.",
166-
"default": "internalConsole"
166+
"default": "none"
167167
},
168168
"cwd": {
169169
"type": "string",
@@ -276,13 +276,26 @@
276276
]
277277
},
278278
{
279-
"name": "Python Console App",
279+
"name": "Python Integrated Console App",
280280
"type": "python",
281281
"request": "launch",
282282
"stopOnEntry": true,
283283
"pythonPath": "${config.python.pythonPath}",
284284
"program": "${file}",
285-
"externalConsole": true,
285+
"console": "integratedTerminal",
286+
"debugOptions": [
287+
"WaitOnAbnormalExit",
288+
"WaitOnNormalExit"
289+
]
290+
},
291+
{
292+
"name": "Python External Console App",
293+
"type": "python",
294+
"request": "launch",
295+
"stopOnEntry": true,
296+
"pythonPath": "${config.python.pythonPath}",
297+
"program": "${file}",
298+
"console": "externalTerminal",
286299
"debugOptions": [
287300
"WaitOnAbnormalExit",
288301
"WaitOnNormalExit"
@@ -306,6 +319,21 @@
306319
"DjangoDebugging"
307320
]
308321
},
322+
{
323+
"name": "Flask",
324+
"type": "python",
325+
"request": "launch",
326+
"stopOnEntry": true,
327+
"pythonPath": "${config.python.pythonPath}",
328+
"program": "${workspaceRoot}/run.py",
329+
"args": [
330+
],
331+
"debugOptions": [
332+
"WaitOnAbnormalExit",
333+
"WaitOnNormalExit",
334+
"RedirectOutput"
335+
]
336+
},
309337
{
310338
"name": "Watson",
311339
"type": "python",
@@ -325,7 +353,7 @@
325353
]
326354
},
327355
{
328-
"name": "Attach",
356+
"name": "Attach (Remote Debug)",
329357
"type": "python",
330358
"request": "attach",
331359
"localRoot": "${workspaceRoot}",

src/client/debugger/Common/Contracts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export interface LaunchRequestArguments extends DebugProtocol.LaunchRequestArgum
5353
debugOptions?: string[];
5454
env?: Object;
5555
exceptionHandling?: ExceptionHandling;
56-
console?: "internalConsole" | "integratedTerminal" | "externalTerminal";
56+
console?: "none" | "integratedTerminal" | "externalTerminal";
5757
}
5858

5959
export interface AttachRequestArguments extends DebugProtocol.AttachRequestArguments {

src/client/debugger/DebugClients/LocalDebugClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export class LocalDebugClient extends DebugClient {
105105
let launcherArgs = this.buildLauncherArguments();
106106

107107
let args = [ptVSToolsFilePath, processCwd, dbgServer.port.toString(), "34806ad9-833a-4524-8cd6-18ca4aa74f14"].concat(launcherArgs);
108-
if (this.args.externalConsole === true) {
108+
if (this.args.console === 'externalTerminal') {
109109
const isSudo = Array.isArray(this.args.debugOptions) && this.args.debugOptions.some(opt => opt === 'Sudo');
110110
open({ wait: false, app: [pythonPath].concat(args), cwd: processCwd, env: environmentVariables, sudo: isSudo }).then(proc => {
111111
this.pyProc = proc;

src/client/debugger/DebugClients/NonDebugClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export class NonDebugClient extends DebugClient {
7777
let launcherArgs = this.buildLauncherArguments();
7878

7979
let args = launcherArgs;
80-
if (this.args.externalConsole === true) {
80+
if (this.args.console === 'externalTerminal') {
8181
open({ wait: false, app: [pythonPath].concat(args), cwd: processCwd, env: environmentVariables }).then(proc => {
8282
this.pyProc = proc;
8383
this.pyProc.on('exit', () => {

src/client/debugger/Main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export class PythonDebugger extends DebugSession {
142142
this.sendResponse(this.entryResponse);
143143
this.debuggerLoadedPromiseResolve();
144144
if (!this.launchArgs.console) {
145-
this.launchArgs.console = this.launchArgs.externalConsole === true ? 'externalTerminal' : 'internalConsole';
145+
this.launchArgs.console = this.launchArgs.externalConsole === true ? 'externalTerminal' : 'none';
146146
}
147147
if (this.launchArgs && this.launchArgs.stopOnEntry === true) {
148148
this.sendEvent(new StoppedEvent("entry", pyThread.Id));
@@ -179,7 +179,7 @@ export class PythonDebugger extends DebugSession {
179179
return this.sendErrorResponse(response, 2001, `File does not exist. "${args.program}"`);
180180
}
181181
this.sendEvent(new TelemetryEvent(telemetryContracts.Debugger.Load, {
182-
Debug_ExternalConsole: args.externalConsole === true ? "true" : "false",
182+
Debug_Console: args.console,
183183
Debug_DebugOptions: args.debugOptions.join(","),
184184
Debug_DJango: args.debugOptions.indexOf("DjangoDebugging") >= 0 ? "true" : "false",
185185
Debug_HasEnvVaraibles: args.env && typeof args.env === "object" ? "true" : "false"

0 commit comments

Comments
 (0)