From 4bb0bb1f6d474de6b02ea17bf211e9698c7d5651 Mon Sep 17 00:00:00 2001 From: Maksim Zuev Date: Tue, 30 Jul 2024 16:00:10 +0200 Subject: [PATCH] [debugger] IJPL-158332 Add 'continue previous code' action GitOrigin-RevId: f5ab6e0ad3aa913594ce7d80b80a9650bf281ec2 --- .../intellij/debugger/ui/HotSwapProgressImpl.java | 13 ++++++++++++- .../messages/JavaDebuggerBundle.properties | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/HotSwapProgressImpl.java b/java/debugger/impl/src/com/intellij/debugger/ui/HotSwapProgressImpl.java index 927262402e7c..c9715ea5d91e 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/HotSwapProgressImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/HotSwapProgressImpl.java @@ -111,10 +111,12 @@ public final class HotSwapProgressImpl extends HotSwapProgress { NotificationType type) { Notification notification = NOTIFICATION_GROUP.createNotification(title, message, type); if (SoftReference.dereference(mySessionRef) != null) { - notification.addAction(new StopHotSwapNotificationAction(mySessionRef)); if (withRestart) { notification.addAction(new RestartHotSwapNotificationAction(mySessionRef)); } + notification.addAction(Registry.is("debugger.hotswap.floating.toolbar") + ? new ContinueDebugAction() + : new StopHotSwapNotificationAction(mySessionRef)); } notification.setImportant(false).notify(getProject()); } @@ -257,4 +259,13 @@ public final class HotSwapProgressImpl extends HotSwapProgress { } } } + + private static class ContinueDebugAction extends NotificationAction { + ContinueDebugAction() { super(JavaDebuggerBundle.message("status.hot.swap.completed.continue")); } + + @Override + public void actionPerformed(@NotNull AnActionEvent e, @NotNull Notification notification) { + notification.expire(); + } + } } diff --git a/java/debugger/openapi/resources/messages/JavaDebuggerBundle.properties b/java/debugger/openapi/resources/messages/JavaDebuggerBundle.properties index 4cdc4ccb0697..a54dc7b0e515 100644 --- a/java/debugger/openapi/resources/messages/JavaDebuggerBundle.properties +++ b/java/debugger/openapi/resources/messages/JavaDebuggerBundle.properties @@ -280,8 +280,9 @@ label.generic.debugger.parameters.patcher.configurable.transport=Transport: label.generic.debugger.parameters.patcher.configurable.shmem.address=Shared memory address: progress.hot.swap.title=Hot Swap status.hot.swap.completed.with.errors=Hot Swap failed -status.hot.swap.completed.restart=Restart debug session +status.hot.swap.completed.restart=Restart status.hot.swap.completed.stop=Stop debug session +status.hot.swap.completed.continue=Continue with previous code status.hot.swap.completed.with.warnings=Hot Swap completed with warnings label.generic.debugger.parameters.patcher.configurable.port=Port: status.hotswap.uptodate=Loaded classes are up to date. Nothing to reload.