From fe82bfeac6c5dba82e342842a6902d7f51f33e5f Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Wed, 6 Nov 2024 13:21:00 +0200 Subject: [PATCH 1/2] fix: Make it less likely to trigger multiple compiles See https://youtrack.jetbrains.com/issue/JBR-7850/Calling-compile-from-a-save-action-can-trigger-another-save-action --- .../com/vaadin/plugin/actions/VaadinCompileOnSaveAction.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/kotlin/com/vaadin/plugin/actions/VaadinCompileOnSaveAction.kt b/src/main/kotlin/com/vaadin/plugin/actions/VaadinCompileOnSaveAction.kt index 63f5911..3a7e1d1 100644 --- a/src/main/kotlin/com/vaadin/plugin/actions/VaadinCompileOnSaveAction.kt +++ b/src/main/kotlin/com/vaadin/plugin/actions/VaadinCompileOnSaveAction.kt @@ -50,6 +50,7 @@ class VaadinCompileOnSaveAction : ActionsOnSaveFileDocumentManagerListener.Actio val session = DebuggerManagerEx.getInstanceEx(project).context.debuggerSession if (session != null) { ReadAction.run { + Thread.sleep(1); HotSwapUI.getInstance(project).compileAndReload(session, *javaFiles.toTypedArray()) } } From 6784bea5e8bcdea907577e2841fec16fde0daca7 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Wed, 6 Nov 2024 13:25:45 +0200 Subject: [PATCH 2/2] format --- .../com/vaadin/plugin/actions/VaadinCompileOnSaveAction.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/vaadin/plugin/actions/VaadinCompileOnSaveAction.kt b/src/main/kotlin/com/vaadin/plugin/actions/VaadinCompileOnSaveAction.kt index 3a7e1d1..ef7c9e5 100644 --- a/src/main/kotlin/com/vaadin/plugin/actions/VaadinCompileOnSaveAction.kt +++ b/src/main/kotlin/com/vaadin/plugin/actions/VaadinCompileOnSaveAction.kt @@ -50,7 +50,7 @@ class VaadinCompileOnSaveAction : ActionsOnSaveFileDocumentManagerListener.Actio val session = DebuggerManagerEx.getInstanceEx(project).context.debuggerSession if (session != null) { ReadAction.run { - Thread.sleep(1); + Thread.sleep(1) HotSwapUI.getInstance(project).compileAndReload(session, *javaFiles.toTypedArray()) } }