From 6e3073cf861d8f59490c578319f971f0a1136751 Mon Sep 17 00:00:00 2001 From: Jinbo Wang Date: Thu, 23 Nov 2017 10:08:21 +0800 Subject: [PATCH 1/4] Define launchInTerminal config in launch.json Signed-off-by: Jinbo Wang --- package.json | 16 ++++++++++++++++ src/configurationProvider.ts | 1 + 2 files changed, 17 insertions(+) diff --git a/package.json b/package.json index f7cfc2fc..80bf01e0 100644 --- a/package.json +++ b/package.json @@ -111,6 +111,21 @@ "type": "object", "description": "The extra environment variables for the program.", "default": {} + }, + "console": { + "type": "string", + "enum": [ + "internalConsole", + "integratedTerminal", + "externalTerminal" + ], + "enumDescriptions": [ + "VS Code Debug Console (which doesn't support to read input from a program)", + "VS Code's integrated terminal", + "external terminal that can be configured via user settings" + ], + "description": "Where to launch the program.", + "default": "internalConsole" } } }, @@ -159,6 +174,7 @@ "name": "Debug (Launch)", "request": "launch", "cwd": "^\"\\${workspaceFolder}\"", + "console": "internalConsole", "mainClass": "", "args": "" } diff --git a/src/configurationProvider.ts b/src/configurationProvider.ts index 70a6a1c5..91c9aa69 100644 --- a/src/configurationProvider.ts +++ b/src/configurationProvider.ts @@ -44,6 +44,7 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration request: "launch", // tslint:disable-next-line cwd: "${workspaceFolder}", + console: "internalConsole", mainClass: item.mainClass, projectName: item.projectName, args: "", From c58e3a49849c9976e5cfe0c5db39cdcfc85bf8db Mon Sep 17 00:00:00 2001 From: Jinbo Wang Date: Mon, 27 Nov 2017 13:32:46 +0800 Subject: [PATCH 2/4] Support stopOnEntry and launchInTerminal in launch.json Signed-off-by: Jinbo Wang --- README.md | 5 +++++ package.json | 6 ++++++ src/configurationProvider.ts | 4 +--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 649dff09..d72f9389 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,11 @@ Please also check the documentation of [Language Support for Java by Red Hat](ht - `projectName` - The preferred project in which the debugger searches for classes. There could be duplicated class names in different projects. This setting also works when the debugger looks for the specified main class when launching a program. - `cwd` - The working directory of the program. - `env` - The extra environment variables for the program. +- `stopOnEntry` - Automatically stop program after launch. +- `console` - Where to launch the program. Defaults to `internalConsole`. + - `internalConsole` - VS Code Debug Console (which doesn't support to read input from a program) + - `integratedTerminal` - VS Code's integrated terminal + - `externalTerminal` - external terminal that can be configured via user settings ### Attach diff --git a/package.json b/package.json index 80bf01e0..4c959683 100644 --- a/package.json +++ b/package.json @@ -112,6 +112,11 @@ "description": "The extra environment variables for the program.", "default": {} }, + "stopOnEntry": { + "type": "boolean", + "description": "Automatically stop program after launch.", + "default": true + }, "console": { "type": "string", "enum": [ @@ -175,6 +180,7 @@ "request": "launch", "cwd": "^\"\\${workspaceFolder}\"", "console": "internalConsole", + "stopOnEntry": false, "mainClass": "", "args": "" } diff --git a/src/configurationProvider.ts b/src/configurationProvider.ts index 91c9aa69..48bdc2c1 100644 --- a/src/configurationProvider.ts +++ b/src/configurationProvider.ts @@ -45,6 +45,7 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration // tslint:disable-next-line cwd: "${workspaceFolder}", console: "internalConsole", + stopOnEntry: false, mainClass: item.mainClass, projectName: item.projectName, args: "", @@ -107,9 +108,6 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration config.request = "launch"; } - // Workaround bug https://github.com/Microsoft/vscode-java-debug/issues/145 - config.stopOnEntry = false; - if (config.request === "launch") { if (!config.mainClass) { const res = (await resolveMainClass()); From a36fb68f60c0030f3ea753559e09ac47395c4340 Mon Sep 17 00:00:00 2001 From: Jinbo Wang Date: Tue, 28 Nov 2017 11:31:53 +0800 Subject: [PATCH 3/4] Fix review comments --- README.md | 4 ++-- package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d72f9389..a9ca374b 100644 --- a/README.md +++ b/README.md @@ -58,9 +58,9 @@ Please also check the documentation of [Language Support for Java by Red Hat](ht - `env` - The extra environment variables for the program. - `stopOnEntry` - Automatically stop program after launch. - `console` - Where to launch the program. Defaults to `internalConsole`. - - `internalConsole` - VS Code Debug Console (which doesn't support to read input from a program) + - `internalConsole` - VS Code Debug Console (which doesn't support reading input from a program) - `integratedTerminal` - VS Code's integrated terminal - - `externalTerminal` - external terminal that can be configured via user settings + - `externalTerminal` - External terminal that can be configured via user settings ### Attach diff --git a/package.json b/package.json index 4c959683..8a003a16 100644 --- a/package.json +++ b/package.json @@ -125,9 +125,9 @@ "externalTerminal" ], "enumDescriptions": [ - "VS Code Debug Console (which doesn't support to read input from a program)", + "VS Code Debug Console (which doesn't support reading input from a program)", "VS Code's integrated terminal", - "external terminal that can be configured via user settings" + "External terminal that can be configured via user settings" ], "description": "Where to launch the program.", "default": "internalConsole" From 77ec007aef8d91e5bce3fe91885307ac70609365 Mon Sep 17 00:00:00 2001 From: Jinbo Wang Date: Wed, 29 Nov 2017 20:24:45 +0800 Subject: [PATCH 4/4] fix review comments --- README.md | 10 +++++----- package.json | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a9ca374b..8eee55df 100644 --- a/README.md +++ b/README.md @@ -56,11 +56,11 @@ Please also check the documentation of [Language Support for Java by Red Hat](ht - `projectName` - The preferred project in which the debugger searches for classes. There could be duplicated class names in different projects. This setting also works when the debugger looks for the specified main class when launching a program. - `cwd` - The working directory of the program. - `env` - The extra environment variables for the program. -- `stopOnEntry` - Automatically stop program after launch. -- `console` - Where to launch the program. Defaults to `internalConsole`. - - `internalConsole` - VS Code Debug Console (which doesn't support reading input from a program) - - `integratedTerminal` - VS Code's integrated terminal - - `externalTerminal` - External terminal that can be configured via user settings +- `stopOnEntry` - Automatically pause the program after launching. +- `console` - The specified console to launch the program. Defaults to `internalConsole`. + - `internalConsole` - VS Code debug console (input stream not supported). + - `integratedTerminal` - VS Code integrated terminal. + - `externalTerminal` - External terminal that can be configured in user settings. ### Attach diff --git a/package.json b/package.json index bfecaf25..c455ff06 100644 --- a/package.json +++ b/package.json @@ -114,22 +114,22 @@ }, "stopOnEntry": { "type": "boolean", - "description": "Automatically stop program after launch.", + "description": "Automatically pause the program after launching.", "default": true }, "console": { "type": "string", "enum": [ "internalConsole", - "integratedTerminal", - "externalTerminal" + "integratedTerminal", + "externalTerminal" ], "enumDescriptions": [ - "VS Code Debug Console (which doesn't support reading input from a program)", - "VS Code's integrated terminal", - "External terminal that can be configured via user settings" + "VS Code debug console (input stream not supported).", + "VS Code integrated terminal.", + "External terminal that can be configured in user settings." ], - "description": "Where to launch the program.", + "description": "The specified console to launch the program.", "default": "internalConsole" } }