Skip to content

Commit

Permalink
fix: ensure runActionHandler to execute only on our configs
Browse files Browse the repository at this point in the history
  • Loading branch information
sigmaaa committed Sep 13, 2024
1 parent ac7f36b commit 4f60f95
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 Status.OK_STATUS;
}

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 4f60f95

Please sign in to comment.