-
-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reduce "search everywhere" route target to be unique
- Loading branch information
Showing
1 changed file
with
12 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,9 @@ | |
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
/** | ||
* @author Daniel Espendiller <[email protected]> | ||
*/ | ||
|
@@ -46,6 +49,8 @@ public void processElementsWithName(@NotNull String name, @NotNull Processor<? s | |
return; | ||
} | ||
|
||
Set<PsiElement> targets = new HashSet<>(); | ||
|
||
for (Pair<Route, PsiElement> entry : RouteHelper.getMethodsForPathWithPlaceholderMatchRoutes(project, name)) { | ||
Route route = entry.getFirst(); | ||
|
||
|
@@ -54,8 +59,14 @@ public void processElementsWithName(@NotNull String name, @NotNull Processor<? s | |
continue; | ||
} | ||
|
||
PsiElement second = entry.getSecond(); | ||
if (targets.contains(second)) { | ||
continue; | ||
} | ||
|
||
targets.add(second); | ||
processor.process((NavigationItemPresentableOverwrite.create( | ||
entry.getSecond(), | ||
second, | ||
route.getPathPresentable(), | ||
Symfony2Icons.ROUTE, | ||
"Symfony Route", | ||
|