Search in sources :

Example 1 with KtEnumEntry

use of org.jetbrains.kotlin.psi.KtEnumEntry in project kotlin by JetBrains.

the class JavaElementFinder method findClassesAndObjects.

// Finds explicitly declared classes and objects, not package classes
// Also DefaultImpls classes of interfaces
private void findClassesAndObjects(FqName qualifiedName, GlobalSearchScope scope, List<PsiClass> answer) {
    findInterfaceDefaultImpls(qualifiedName, scope, answer);
    Collection<KtClassOrObject> classOrObjectDeclarations = lightClassGenerationSupport.findClassOrObjectDeclarations(qualifiedName, scope);
    for (KtClassOrObject declaration : classOrObjectDeclarations) {
        if (!(declaration instanceof KtEnumEntry)) {
            PsiClass lightClass = toLightClass(declaration);
            if (lightClass != null) {
                answer.add(lightClass);
            }
        }
    }
}
Also used : KtClassOrObject(org.jetbrains.kotlin.psi.KtClassOrObject) KtEnumEntry(org.jetbrains.kotlin.psi.KtEnumEntry)

Example 2 with KtEnumEntry

use of org.jetbrains.kotlin.psi.KtEnumEntry in project kotlin by JetBrains.

the class KtClassElementType method createStub.

@Override
public KotlinClassStub createStub(@NotNull KtClass psi, StubElement parentStub) {
    FqName fqName = ResolveSessionUtils.safeFqNameForLazyResolve(psi);
    boolean isEnumEntry = psi instanceof KtEnumEntry;
    List<String> superNames = KtPsiUtilKt.getSuperNames(psi);
    return new KotlinClassStubImpl(getStubType(isEnumEntry), parentStub, StringRef.fromString(fqName != null ? fqName.asString() : null), StringRef.fromString(psi.getName()), Utils.INSTANCE.wrapStrings(superNames), psi.isInterface(), isEnumEntry, psi.isLocal(), psi.isTopLevel());
}
Also used : FqName(org.jetbrains.kotlin.name.FqName) KotlinClassStubImpl(org.jetbrains.kotlin.psi.stubs.impl.KotlinClassStubImpl) KtEnumEntry(org.jetbrains.kotlin.psi.KtEnumEntry)

Aggregations

KtEnumEntry (org.jetbrains.kotlin.psi.KtEnumEntry)2 FqName (org.jetbrains.kotlin.name.FqName)1 KtClassOrObject (org.jetbrains.kotlin.psi.KtClassOrObject)1 KotlinClassStubImpl (org.jetbrains.kotlin.psi.stubs.impl.KotlinClassStubImpl)1