@Nullable public static WeighingComparable<PsiElement, ProximityLocation> getProximity(final PsiElement element, final PsiElement context) { if (element == null) return null; if (element instanceof MetadataPsiElementBase) return null; final Module contextModule = context != null ? ModuleUtilCore.findModuleForPsiElement(context) : null; return WeighingService.weigh(WEIGHER_KEY, element, new ProximityLocation(context, contextModule)); }
@Nullable public static WeighingComparable<PsiElement, ProximityLocation> getProximity(final PsiElement element, final PsiElement context) { if (element == null) return null; if (element instanceof MetadataPsiElementBase) return null; final Module contextModule = context != null ? ModuleUtil.findModuleForPsiElement(context) : null; return WeighingService.weigh(WEIGHER_KEY, element, new ProximityLocation(context, contextModule)); }