本文整理匯總了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 );
}