本文整理汇总了Java中com.intellij.psi.PsiClass.EMPTY_ARRAY属性的典型用法代码示例。如果您正苦于以下问题:Java PsiClass.EMPTY_ARRAY属性的具体用法?Java PsiClass.EMPTY_ARRAY怎么用?Java PsiClass.EMPTY_ARRAY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.psi.PsiClass
的用法示例。
在下文中一共展示了PsiClass.EMPTY_ARRAY属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findClasses
@Override
public PsiClass[] findClasses( String fqn, GlobalSearchScope globalSearchScope )
{
//System.out.println( "PsiClass[] findClasses() : " + fqn + " : " + globalSearchScope );
if( DumbService.getInstance( globalSearchScope.getProject() ).isDumb() )
{
// skip processing during index rebuild
return PsiClass.EMPTY_ARRAY;
}
List<PsiClass> psiClasses = new ArrayList<>();
List<ManModule> modules = findModules( globalSearchScope );
for( ManModule m : modules )
{
PsiClass psiClass = ManifoldPsiClassCache.instance().getPsiClass( globalSearchScope, m, fqn );
if( psiClass != null )
{
psiClasses.add( psiClass );
}
}
return psiClasses.toArray( new PsiClass[psiClasses.size()] );
}
示例2: getClasses
@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);
}
}
示例3: findClasses
@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);
}
}
示例4: getClasses
@Override
public PsiClass[] getClasses( PsiPackage psiPackage, GlobalSearchScope scope )
{
//System.out.println( "getClasses() : " + psiPackage + " : " + scope );
if( DumbService.getInstance( scope.getProject() ).isDumb() )
{
// skip processing during index rebuild
return PsiClass.EMPTY_ARRAY;
}
List<ManModule> modules = findModules( scope );
String parentPackage = psiPackage.getQualifiedName();
Set<PsiClass> children = new HashSet<>();
for( ManModule mm : modules )
{
for( ITypeManifold sp : mm.getTypeManifolds() )
{
if( sp.getProducerKind() == Supplemental )
{
continue;
}
Collection<TypeName> typeNames = sp.getTypeNames( parentPackage );
for( TypeName child : typeNames )
{
if( child.kind == TypeName.Kind.TYPE )
{
PsiClass psiClass = ManifoldPsiClassCache.instance().getPsiClass( scope, mm, child.name );
if( psiClass != null )
{
children.add( psiClass );
}
}
}
}
}
if( !children.isEmpty() )
{
return children.toArray( new PsiClass[children.size()] );
}
return super.getClasses( psiPackage, scope );
}