Search in sources :

Example 16 with NameHint

use of com.intellij.psi.scope.NameHint in project intellij-community by JetBrains.

the class JavaDummyHolder method processDeclarations.

@Override
public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @NotNull ResolveState state, PsiElement lastParent, @NotNull PsiElement place) {
    ElementClassHint classHint = processor.getHint(ElementClassHint.KEY);
    if (classHint == null || classHint.shouldProcess(ElementClassHint.DeclarationKind.CLASS)) {
        final NameHint nameHint = processor.getHint(NameHint.KEY);
        final String name = nameHint != null ? nameHint.getName(state) : null;
        //"pseudo-imports"
        if (name != null) {
            PsiClass imported = myPseudoImports.get(name);
            if (imported != null) {
                if (!processor.execute(imported, state))
                    return false;
            }
        } else {
            for (PsiClass aClass : myPseudoImports.values()) {
                if (!processor.execute(aClass, state))
                    return false;
            }
        }
        if (getContext() == null) {
            if (!JavaResolveUtil.processImplicitlyImportedPackages(processor, state, place, getManager()))
                return false;
        }
    }
    return true;
}
Also used : ElementClassHint(com.intellij.psi.scope.ElementClassHint) NameHint(com.intellij.psi.scope.NameHint)

Aggregations

NameHint (com.intellij.psi.scope.NameHint)16 ElementClassHint (com.intellij.psi.scope.ElementClassHint)10 THashSet (gnu.trove.THashSet)2 GrTypeDefinition (org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrTypeDefinition)2 GrImportStatement (org.jetbrains.plugins.groovy.lang.psi.api.toplevel.imports.GrImportStatement)2 PsiDataBindingResourceItem (com.android.tools.idea.res.PsiDataBindingResourceItem)1 Module (com.intellij.openapi.module.Module)1 LanguageLevel (com.intellij.pom.java.LanguageLevel)1 CandidateInfo (com.intellij.psi.infos.CandidateInfo)1 GlobalSearchScope (com.intellij.psi.search.GlobalSearchScope)1 IElementType (com.intellij.psi.tree.IElementType)1 Set (java.util.Set)1 GrModifierList (org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.modifiers.GrModifierList)1 GrAnnotation (org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.modifiers.annotation.GrAnnotation)1 GrReferenceList (org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrReferenceList)1 GrTypeDefinitionBody (org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrTypeDefinitionBody)1 GrGdkMethod (org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrGdkMethod)1 GrCodeReferenceElement (org.jetbrains.plugins.groovy.lang.psi.api.types.GrCodeReferenceElement)1 GroovyScriptClass (org.jetbrains.plugins.groovy.lang.psi.impl.synthetic.GroovyScriptClass)1