Java 类com.intellij.psi.impl.light.LightClass 实例源码

项目:manifold-ij    文件:TestFinder.java   
@NotNull
@Override
public PsiClass[] getClasses(@NotNull PsiPackage psiPackage, @NotNull GlobalSearchScope scope) {
  String fqn = psiPackage.getQualifiedName();
  if (isShortCircuit(fqn)) {
    return PsiClass.EMPTY_ARRAY;
  }

  addShortCircuit(fqn);
  try {
    PsiClass[] classes = psiPackage.getClasses(scope);
    return Arrays.stream(classes).map(LightClass::new).toArray(PsiClass[]::new);
  } finally {
    removeShortCircuit(fqn);
  }
}
项目:manifold-ij    文件:TestFinder.java   
@Override
public PsiClass[] findClasses(String fqn, GlobalSearchScope scope) {
  if (isShortCircuit(fqn)) {
    return PsiClass.EMPTY_ARRAY;
  }

  addShortCircuit(fqn);
  try {
    PsiClass[] classes = JavaPsiFacade.getInstance(scope.getProject()).findClasses(fqn, scope);
    return Arrays.stream(classes).map(LightClass::new).toArray(PsiClass[]::new);
  } finally {
    removeShortCircuit(fqn);
  }
}
项目:manifold-ij    文件:TestFinder.java   
@Override
public PsiClass findClass(String fqn, GlobalSearchScope scope) {
  if (isShortCircuit(fqn)) {
    return null;
  }

  addShortCircuit(fqn);
  try {
    PsiClass cls = JavaPsiFacade.getInstance(scope.getProject()).findClass(fqn, scope);
    return cls == null ? null : new LightClass(cls);
  } finally {
    removeShortCircuit(fqn);
  }
}