Skip to content

Commit fcc0eca

Browse files
Enable HCR when autobuild is disabled (#1296)
1 parent ece7544 commit fcc0eca

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

src/extension.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -188,17 +188,14 @@ async function applyHCR(hcrStatusBar: NotificationBar) {
188188

189189
const autobuildConfig: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("java.autobuild");
190190
if (!autobuildConfig.enabled) {
191-
const ans = await vscode.window.showWarningMessage(
192-
"The hot code replace feature requires you to enable the autobuild flag, do you want to enable it?",
193-
"Yes", "No");
194-
if (ans === "Yes") {
195-
await autobuildConfig.update("enabled", true);
196-
// Force an incremental build to avoid auto build is not finishing during HCR.
197-
try {
198-
await commands.executeJavaExtensionCommand(commands.JAVA_BUILD_WORKSPACE, false);
199-
} catch (err) {
200-
// do nothing.
201-
}
191+
// If autobuild is disabled, force an incremental build before HCR.
192+
try {
193+
hcrStatusBar.show("$(sync~spin)Compiling...");
194+
await commands.executeJavaExtensionCommand(commands.JAVA_BUILD_WORKSPACE, JSON.stringify({
195+
isFullBuild: false
196+
}));
197+
} catch (err) {
198+
// do nothing.
202199
}
203200
}
204201

0 commit comments

Comments
 (0)