Skip to content
Merged
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
3 changes: 3 additions & 0 deletions Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* [Modify the settings.json (User Setting)](#modify-the-settingsjson-user-setting)
* java.debug.settings.console
* java.debug.settings.forceBuildBeforeLaunch
* java.debug.settings.onBuildFailureProceed
* java.debug.settings.hotCodeReplace
* java.debug.settings.enableRunDebugCodeLens
* [FAQ](#faq)
Expand Down Expand Up @@ -329,6 +330,8 @@ In some cases, you may want to start your program with the external builder and

- `java.debug.settings.forceBuildBeforeLaunch` - Force building the workspace before launching java program, defaults to `true`. Sometimes you may be bothered with the message *"Build failed, do you want to continue?"*, you could disable this setting to suppress the message.

- `java.debug.settings.onBuildFailureProceed` - Sometimes you may be bothered with the message *"Build failed, do you want to continue?"*, you could use this setting to suppress the message and proceed.

- `java.debug.settings.hotCodeReplace` - Reload the changed Java classes during debugging, defaults to `manual`. It supports `manual`, `auto`, `never`.
- `manual` - Click the toolbar to apply the changes.
![hcr](https://user-images.githubusercontent.com/14052197/67256313-f5697600-f4b8-11e9-9db6-54540b6350ad.png)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ Please also check the documentation of [Language Support for Java by Red Hat](ht
- never - Never apply the changes.
- `java.debug.settings.enableRunDebugCodeLens`: enable the code lens provider for the run and debug buttons over main entry points, defaults to `true`.
- `java.debug.settings.forceBuildBeforeLaunch`: force building the workspace before launching java program, defaults to `true`.
- `java.debug.settings.onBuildFailureProceed`: Force to proceed when build fails, defaults to false.
- `java.debug.settings.console`: The specified console to launch Java program, defaults to `integratedTerminal`. If you want to customize the console for a specific debug session, please modify the 'console' config in launch.json.
- `internalConsole` - VS Code debug console (input stream not supported).
- `integratedTerminal` - VS Code integrated terminal.
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,11 @@
"description": "%java.debugger.configuration.forceBuildBeforeLaunch%",
"default": true
},
"java.debug.settings.onBuildFailureProceed": {
"type": "boolean",
"description": "%java.debugger.configuration.onBuildFailureProceed%",
"default": false
},
"java.debug.settings.console": {
"type": "string",
"enum": [
Expand Down
1 change: 1 addition & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"java.debugger.configuration.hotCodeReplace.description": "Reload the changed Java classes during debugging. Make sure 'java.autobuild.enabled' is not disabled.",
"java.debugger.configuration.enableRunDebugCodeLens.description": "Enable the run and debug code lens providers over main methods.",
"java.debugger.configuration.forceBuildBeforeLaunch": "Force building the workspace before launching java program.",
"java.debugger.configuration.onBuildFailureProceed": "Force to proceed when build fails",
"java.debugger.configuration.console": "The specified console to launch Java program. If you want to customize the console for a specific debug session, please modify the 'console' config in launch.json.",
"java.debugger.configuration.exceptionBreakpoint.skipClasses": "Skip the specified classes when breaking on exception. You could use the built-in variables such as '$JDK' and '$Libraries' to skip a group of classes, or add a specific class name expression, e.g. java.*, *.Foo",
"java.debugger.configuration.jdwp.limitOfVariablesPerJdwpRequest.description": "The maximum number of variables or fields that can be requested in one JDWP request. The higher the value, the less frequently debuggee will be requested when expanding the variable view. Also a large number can cause JDWP request timeout.",
Expand Down
10 changes: 8 additions & 2 deletions src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import * as commands from "./commands";
import * as lsPlugin from "./languageServerPlugin";
import * as utility from "./utility";

const JAVA_DEBUG_CONFIGURATION = "java.debug.settings";
const ON_BUILD_FAILURE_PROCEED = "onBuildFailureProceed";

export async function buildWorkspace(): Promise<boolean> {
const buildResult = await instrumentOperation("build", async (operationId: string) => {
let error;
Expand All @@ -32,6 +35,9 @@ export async function buildWorkspace(): Promise<boolean> {
}

async function handleBuildFailure(operationId: string, err: any): Promise<boolean> {
const configuration = vscode.workspace.getConfiguration(JAVA_DEBUG_CONFIGURATION);
const onBuildFailureProceed = configuration.get<boolean>(ON_BUILD_FAILURE_PROCEED);

if (err instanceof utility.JavaExtensionNotEnabledError) {
utility.guideToInstallJavaExtension();
return false;
Expand All @@ -47,8 +53,8 @@ async function handleBuildFailure(operationId: string, err: any): Promise<boolea
vscode.commands.executeCommand("workbench.actions.view.problems");
}

const ans = await vscode.window.showErrorMessage("Build failed, do you want to continue?",
"Proceed", "Fix...", "Cancel");
const ans = onBuildFailureProceed ? "Proceed" : (await vscode.window.showErrorMessage("Build failed, do you want to continue?",
"Proceed", "Fix...", "Cancel"));
sendInfo(operationId, {
operationName: "build",
choiceForBuildError: ans || "esc",
Expand Down