Set<PsiClass> (@NotNull PsiClass psiClass, @NotNull RegistrationType registrationType) { final Project project = psiClass.getProject(); final PsiFile psiFile = psiClass.getContainingFile(); assert psiFile != null; final VirtualFile virtualFile = psiFile.getVirtualFile(); if (virtualFile == null) return null; final Module module = ModuleUtilCore.findModuleForFile(virtualFile, project); if (module == null) return null; final RegistrationTypeFinder finder = new RegistrationTypeFinder(psiClass, registrationType); if (PsiUtil.isIdeaProject(project)) { return checkIdeaProject(project, finder); } final Set<PsiClass> pluginModuleResults = checkModule(module, finder); if (pluginModuleResults != null) { return pluginModuleResults; } final List<Module> candidateModules = PluginModuleType.getCandidateModules(module); candidateModules.remove(module); // already checked for (Module candidateModule : candidateModules) { Set<PsiClass> types = checkModule(candidateModule, finder); if (types != null) return types; } return null; }