Skip to content

Commit 19efeb1

Browse files
committed
reduce "search everywhere" route target to be unique
1 parent b8cbd6c commit 19efeb1

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/main/java/fr/adrienbrault/idea/symfony2plugin/navigation/RouteUrlMatcherSymbolContributor.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
import org.jetbrains.annotations.NotNull;
1818
import org.jetbrains.annotations.Nullable;
1919

20+
import java.util.HashSet;
21+
import java.util.Set;
22+
2023
/**
2124
* @author Daniel Espendiller <daniel@espendiller.net>
2225
*/
@@ -46,6 +49,8 @@ public void processElementsWithName(@NotNull String name, @NotNull Processor<? s
4649
return;
4750
}
4851

52+
Set<PsiElement> targets = new HashSet<>();
53+
4954
for (Pair<Route, PsiElement> entry : RouteHelper.getMethodsForPathWithPlaceholderMatchRoutes(project, name)) {
5055
Route route = entry.getFirst();
5156

@@ -54,8 +59,14 @@ public void processElementsWithName(@NotNull String name, @NotNull Processor<? s
5459
continue;
5560
}
5661

62+
PsiElement second = entry.getSecond();
63+
if (targets.contains(second)) {
64+
continue;
65+
}
66+
67+
targets.add(second);
5768
processor.process((NavigationItemPresentableOverwrite.create(
58-
entry.getSecond(),
69+
second,
5970
route.getPathPresentable(),
6071
Symfony2Icons.ROUTE,
6172
"Symfony Route",

0 commit comments

Comments
 (0)