Skip to content

Commit

Permalink
Deduplicate launch configs
Browse files Browse the repository at this point in the history
The same launch config might be returned by multiple
LaunchShortcutExtension and is then shown twice.

This simply filter items that where already seen to deduplicate such
entries.

Fix eclipse-platform#527
  • Loading branch information
laeubi committed Nov 30, 2023
1 parent eb9ddc9 commit c74bc29
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion debug/org.eclipse.debug.ui/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.debug.ui; singleton:=true
Bundle-Version: 3.18.300.qualifier
Bundle-Version: 3.18.400.qualifier
Bundle-Activator: org.eclipse.debug.internal.ui.DebugUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import org.eclipse.core.expressions.Expression;
import org.eclipse.core.expressions.IEvaluationContext;
Expand Down Expand Up @@ -280,9 +282,12 @@ protected void fillMenu(Menu menu) {
}
}
// now add collected launches
Set<ILaunchConfiguration> added = new HashSet<>();
for (Entry<LaunchShortcutExtension, ILaunchConfiguration[]> entry : launchConfigurations.entrySet()) {
for (ILaunchConfiguration configuration : entry.getValue()) {
populateMenuItem(fMode, entry.getKey(), menu, configuration, accelerator++, null);
if (added.add(configuration)) {
populateMenuItem(fMode, entry.getKey(), menu, configuration, accelerator++, null);
}
}
}

Expand Down

0 comments on commit c74bc29

Please sign in to comment.