private static boolean addAliasingUsages(@NotNull PomTarget pomTarget, @NotNull final FindUsagesOptions options, @NotNull final Processor<UsageInfo> processor) { for (AliasingPsiTargetMapper aliasingPsiTargetMapper : Extensions.getExtensions(AliasingPsiTargetMapper.EP_NAME)) { for (final AliasingPsiTarget psiTarget : aliasingPsiTargetMapper.getTargets(pomTarget)) { boolean success = ReferencesSearch .search(new ReferencesSearch.SearchParameters(ApplicationManager.getApplication().runReadAction(new Computable<PsiElement>() { @Override public PsiElement compute() { return PomService.convertToPsi(psiTarget); } }), options.searchScope, false, options.fastTrack)) .forEach(new ReadActionProcessor<PsiReference>() { @Override public boolean processInReadAction(final PsiReference reference) { return addResult(reference, options, processor); } }); if (!success) return false; } } return true; }
private static boolean addAliasingUsages(@NotNull PomTarget pomTarget, @NotNull final Processor<UsageInfo> processor, @NotNull final FindUsagesOptions options) { for (AliasingPsiTargetMapper aliasingPsiTargetMapper : Extensions.getExtensions(AliasingPsiTargetMapper.EP_NAME)) { for (AliasingPsiTarget psiTarget : aliasingPsiTargetMapper.getTargets(pomTarget)) { boolean success = ReferencesSearch .search(new ReferencesSearch.SearchParameters(PomService.convertToPsi(psiTarget), options.searchScope, false, options.fastTrack)) .forEach(new ReadActionProcessor<PsiReference>() { @Override public boolean processInReadAction(final PsiReference reference) { return addResult(processor, reference, options); } }); if (!success) return false; } } return true; }
private static boolean addAliasingUsages(@NotNull PomTarget pomTarget, @NotNull final FindUsagesOptions options, @NotNull final Processor<UsageInfo> processor) { for(AliasingPsiTargetMapper aliasingPsiTargetMapper : Extensions.getExtensions(AliasingPsiTargetMapper.EP_NAME)) { for(final AliasingPsiTarget psiTarget : aliasingPsiTargetMapper.getTargets(pomTarget)) { boolean success = ReferencesSearch.search(new ReferencesSearch.SearchParameters(ReadAction.compute(() -> PomService.convertToPsi(psiTarget)), options.searchScope, false, options .fastTrack)).forEach(new ReadActionProcessor<PsiReference>() { @Override public boolean processInReadAction(final PsiReference reference) { return addResult(reference, options, processor); } }); if(!success) { return false; } } } return true; }