diff --git a/README.md b/README.md index 649dff09..8eee55df 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 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 86735bda..c455ff06 100644 --- a/package.json +++ b/package.json @@ -111,6 +111,26 @@ "type": "object", "description": "The extra environment variables for the program.", "default": {} + }, + "stopOnEntry": { + "type": "boolean", + "description": "Automatically pause the program after launching.", + "default": true + }, + "console": { + "type": "string", + "enum": [ + "internalConsole", + "integratedTerminal", + "externalTerminal" + ], + "enumDescriptions": [ + "VS Code debug console (input stream not supported).", + "VS Code integrated terminal.", + "External terminal that can be configured in user settings." + ], + "description": "The specified console to launch the program.", + "default": "internalConsole" } } }, @@ -159,6 +179,8 @@ "name": "Debug (Launch)", "request": "launch", "cwd": "^\"\\${workspaceFolder}\"", + "console": "internalConsole", + "stopOnEntry": false, "mainClass": "", "args": "" } diff --git a/src/configurationProvider.ts b/src/configurationProvider.ts index ce322ce1..7ec94e30 100644 --- a/src/configurationProvider.ts +++ b/src/configurationProvider.ts @@ -44,6 +44,8 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration request: "launch", // tslint:disable-next-line cwd: "${workspaceFolder}", + console: "internalConsole", + stopOnEntry: false, mainClass: item.mainClass, projectName: item.projectName, args: "", @@ -108,9 +110,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(folder ? folder.uri : undefined));