Skip to content

Commit 862b445

Browse files
authored
Add enable hot code replace settings. (#137)
1 parent 99a1b97 commit 862b445

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/DebugSettings.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public final class DebugSettings {
2424
public boolean showStaticVariables = true;
2525
public boolean showQualifiedNames = false;
2626
public boolean showHex = false;
27+
public boolean enableHotCodeReplace = false;
2728
public String logLevel;
2829

2930
public static DebugSettings getCurrent() {

com.microsoft.java.debug.plugin/src/main/java/com/microsoft/java/debug/plugin/internal/JavaHotCodeReplaceProvider.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656

5757
import com.microsoft.java.debug.core.Configuration;
5858
import com.microsoft.java.debug.core.DebugException;
59+
import com.microsoft.java.debug.core.DebugSettings;
5960
import com.microsoft.java.debug.core.DebugUtility;
6061
import com.microsoft.java.debug.core.IDebugSession;
6162
import com.microsoft.java.debug.core.StackFrameUtility;
@@ -289,8 +290,10 @@ public HotCodeReplaceEvent(EventType eventType, String message) {
289290

290291
@Override
291292
public void initialize(IDebugAdapterContext context, Map<String, Object> options) {
292-
// Listen to the built file events.
293-
ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_BUILD);
293+
if (DebugSettings.getCurrent().enableHotCodeReplace) {
294+
// Listen to the built file events.
295+
ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_BUILD);
296+
}
294297
this.context = context;
295298
currentDebugSession = context.getDebugSession();
296299

0 commit comments

Comments
 (0)