Java 类com.intellij.psi.WeighingService 实例源码

项目:intellij-ce-playground    文件:PsiProximityComparator.java   
@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));
}
项目:tools-idea    文件:PsiProximityComparator.java   
@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));
}
项目:consulo    文件:PsiProximityComparator.java   
@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));
}