Skip to content

Commit

Permalink
Merge pull request #2252 from Haehnchen/feature/2248-unique-targets
Browse files Browse the repository at this point in the history
#2248 translation targets from different provider must be unique
  • Loading branch information
Haehnchen authored Nov 28, 2023
2 parents 356ebcb + aaac2c7 commit 5d2d946
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ public static PsiElement[] getTranslationPsiElements(@NotNull Project project, @
return Arrays.stream(getTranslationProviders())
.map(translationProvider -> translationProvider.getTranslationTargets(project, translationKey, domain))
.flatMap(Collection::stream)
.collect(Collectors.toSet())
.stream()
.map(element -> new TranslationKeyTargetFakePsiNavigationItem(ProjectUtil.getProjectDir(project), element))
.sorted(Comparator.comparingInt(TranslationKeyTargetFakePsiNavigationItem::getWeight))
.toArray(PsiElement[]::new);
Expand Down

0 comments on commit 5d2d946

Please sign in to comment.