Skip to content
Merged
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
21 changes: 13 additions & 8 deletions src/configurationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,19 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
await updateDebugSettings();
}

// trigger build workspace
try {
const buildResult = await vscode.commands.executeCommand(commands.JAVA_BUILD_WORKSPACE);
console.log(buildResult);
} catch (err) {
vscode.window.showErrorMessage("Build failed, please fix build error first.");
return config;
}
// Fix issue: https://github.com/Microsoft/vscode-java-debug/issues/146.
// A bug in java launguage support extension causes the compilation task continue to clean and
// generate files after the command returned and the debuggee will report
// "Could not find or load main class" error when it find the required class file is not in the classpath,
// the commented code will be uncommented when java launguage support extension version 0.14.0 release comes out.
// the bug is fixed at https://github.com/redhat-developer/vscode-java/commit/d7cb375874665b826377c072a914623f03362f4d
// try {
// const buildResult = await vscode.commands.executeCommand(commands.JAVA_BUILD_WORKSPACE);
// console.log(buildResult);
// } catch (err) {
// vscode.window.showErrorMessage("Build failed, please fix build error first.");
// return config;
// }

if (Object.keys(config).length === 0) { // No launch.json in current workspace.
// check whether it is opened as a folder
Expand Down