Skip to content

Commit

Permalink
IEP-1311 Ensure that the our runActionHandler only works on our confi…
Browse files Browse the repository at this point in the history
…gurations (#1034)

* fix: ensure runActionHandler to execute only on our configs

* fix: fixing empty execution with no project configs
  • Loading branch information
sigmaaa authored Sep 23, 2024
1 parent 8718d5d commit 8c45066
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 super.execute(event);
}

ILaunchMode launchMode = launchBarManager.getActiveLaunchMode();
if (launchMode == null)
{
Expand All @@ -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<String> suitableDescNames = findSuitableDescNames(projectName,
IDFLaunchConstants.DEBUG_LAUNCH_CONFIG_TYPE);
Expand All @@ -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<String> suitableDescNames = findSuitableDescNames(projectName,
IDFLaunchConstants.RUN_LAUNCH_CONFIG_TYPE);
Expand Down

0 comments on commit 8c45066

Please sign in to comment.