From 4f60f95e3f7923f3c0af845f3aa4e9ffa73100d8 Mon Sep 17 00:00:00 2001 From: Denys Almazov Date: Wed, 21 Aug 2024 13:00:12 +0300 Subject: [PATCH 1/2] fix: ensure runActionHandler to execute only on our configs --- .../idf/ui/handlers/RunActionHandler.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/handlers/RunActionHandler.java b/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/handlers/RunActionHandler.java index dd87f1e17..32bb81e5c 100644 --- a/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/handlers/RunActionHandler.java +++ b/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/handlers/RunActionHandler.java @@ -48,12 +48,23 @@ public Object execute(ExecutionEvent event) throws ExecutionException { ILaunchBarManager launchBarManager = UIPlugin.getService(ILaunchBarManager.class); new StopLaunchBuildHandler().stop(); + ILaunchConfiguration config = launchBarManager.getActiveLaunchConfiguration(); if (config == null) { return Status.OK_STATUS; } + boolean isEspLaunchConfig = config.getType().getIdentifier() + .contentEquals(IDFLaunchConstants.RUN_LAUNCH_CONFIG_TYPE); + boolean isEspDebugConfig = config.getType().getIdentifier() + .contentEquals(IDFLaunchConstants.DEBUG_LAUNCH_CONFIG_TYPE); + + if (!isEspLaunchConfig && !isEspDebugConfig) + { + return Status.OK_STATUS; + } + ILaunchMode launchMode = launchBarManager.getActiveLaunchMode(); if (launchMode == null) { @@ -74,8 +85,7 @@ public Object execute(ExecutionEvent event) throws ExecutionException } return Status.CANCEL_STATUS; } - if (launchMode.getIdentifier().equals(ILaunchManager.DEBUG_MODE) - && config.getType().getIdentifier().contentEquals(IDFLaunchConstants.RUN_LAUNCH_CONFIG_TYPE)) + if (launchMode.getIdentifier().equals(ILaunchManager.DEBUG_MODE) && isEspLaunchConfig) { List suitableDescNames = findSuitableDescNames(projectName, IDFLaunchConstants.DEBUG_LAUNCH_CONFIG_TYPE); @@ -86,8 +96,7 @@ public Object execute(ExecutionEvent event) throws ExecutionException } returnCode = runActionBasedOnDescCount(launchBarManager, suitableDescNames); } - else if (launchMode.getIdentifier().equals(ILaunchManager.RUN_MODE) - && config.getType().getIdentifier().contentEquals(IDFLaunchConstants.DEBUG_LAUNCH_CONFIG_TYPE)) + else if (launchMode.getIdentifier().equals(ILaunchManager.RUN_MODE) && isEspDebugConfig) { List suitableDescNames = findSuitableDescNames(projectName, IDFLaunchConstants.RUN_LAUNCH_CONFIG_TYPE); From 808c794bc344861a9838334111e5a40b549a32bd Mon Sep 17 00:00:00 2001 From: Denys Almazov Date: Thu, 12 Sep 2024 16:55:49 +0300 Subject: [PATCH 2/2] fix: fixing empty execution with no project configs --- .../src/com/espressif/idf/ui/handlers/RunActionHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/handlers/RunActionHandler.java b/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/handlers/RunActionHandler.java index 32bb81e5c..2aa14522b 100644 --- a/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/handlers/RunActionHandler.java +++ b/bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/handlers/RunActionHandler.java @@ -62,7 +62,7 @@ public Object execute(ExecutionEvent event) throws ExecutionException if (!isEspLaunchConfig && !isEspDebugConfig) { - return Status.OK_STATUS; + return super.execute(event); } ILaunchMode launchMode = launchBarManager.getActiveLaunchMode();