Skip to content

Commit 8b29b5e

Browse files
Fix the case HCR button doesn't take effect if auto build is temporarily enabled (#588)
Signed-off-by: Jinbo Wang <[email protected]>
1 parent 574c440 commit 8b29b5e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/extension.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,12 @@ function initializeExtension(operationId: string, context: vscode.ExtensionConte
5656
"Yes", "No");
5757
if (ans === "Yes") {
5858
await autobuildConfig.update("enabled", true);
59-
} else {
60-
return;
59+
// Force an incremental build to avoid auto build is not finishing during HCR.
60+
try {
61+
await vscode.commands.executeCommand(commands.JAVA_BUILD_WORKSPACE, false)
62+
} catch (err) {
63+
// do nothing.
64+
}
6165
}
6266
}
6367

0 commit comments

Comments
 (0)