Comparable (final @NotNull PsiElement element, final @NotNull ProximityLocation location) { final Module elementModule = ModuleUtil.findModuleForPsiElement(element); if (location.getPositionModule() == elementModule) { return 2; } if (elementModule != null) { return 1; // in project => still not bad } return 0; }