Search in sources :

Example 6 with JSElementIndexingData

use of com.intellij.lang.javascript.psi.stubs.JSElementIndexingData in project intellij-plugins by JetBrains.

the class AngularIndexUtil method multiResolve.

public static void multiResolve(Project project, final StubIndexKey<String, JSImplicitElementProvider> index, final String lookupKey, final Processor<JSImplicitElement> processor) {
    final GlobalSearchScope scope = GlobalSearchScope.allScope(project);
    StubIndex.getInstance().processElements(index, lookupKey, project, scope, JSImplicitElementProvider.class, provider -> {
        final JSElementIndexingData indexingData = provider.getIndexingData();
        if (indexingData != null) {
            final Collection<JSImplicitElement> elements = indexingData.getImplicitElements();
            if (elements != null) {
                for (JSImplicitElement element : elements) {
                    if (element.getName().equals(lookupKey) && ((index != AngularDirectivesIndex.KEY && index != AngularDirectivesDocIndex.KEY) || AngularJSIndexingHandler.isAngularRestrictions(element.getTypeString()))) {
                        if (!processor.process(element))
                            return false;
                    }
                }
            }
        }
        return true;
    });
}
Also used : JSElementIndexingData(com.intellij.lang.javascript.psi.stubs.JSElementIndexingData) GlobalSearchScope(com.intellij.psi.search.GlobalSearchScope) JSImplicitElement(com.intellij.lang.javascript.psi.stubs.JSImplicitElement)

Aggregations

JSElementIndexingData (com.intellij.lang.javascript.psi.stubs.JSElementIndexingData)6 NotNull (org.jetbrains.annotations.NotNull)4 JSImplicitElement (com.intellij.lang.javascript.psi.stubs.JSImplicitElement)3 PsiElement (com.intellij.psi.PsiElement)3 Nullable (org.jetbrains.annotations.Nullable)3 ASTNode (com.intellij.lang.ASTNode)2 JSLiteralImplicitElementProvider (com.intellij.lang.javascript.psi.literal.JSLiteralImplicitElementProvider)2 JSElementIndexingDataImpl (com.intellij.lang.javascript.psi.stubs.impl.JSElementIndexingDataImpl)2 JSImplicitElementImpl (com.intellij.lang.javascript.psi.stubs.impl.JSImplicitElementImpl)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 FileViewProvider (com.intellij.psi.FileViewProvider)2 GlobalSearchScope (com.intellij.psi.search.GlobalSearchScope)2 LightVirtualFile (com.intellij.testFramework.LightVirtualFile)2 JSDocTokenTypes (com.intellij.lang.javascript.JSDocTokenTypes)1 JSDocumentationUtils (com.intellij.lang.javascript.documentation.JSDocumentationUtils)1 FrameworkIndexingHandler (com.intellij.lang.javascript.index.FrameworkIndexingHandler)1 JSSymbolUtil (com.intellij.lang.javascript.index.JSSymbolUtil)1 JSLibraryUtil (com.intellij.lang.javascript.library.JSLibraryUtil)1 com.intellij.lang.javascript.psi (com.intellij.lang.javascript.psi)1 JSCallExpressionImpl (com.intellij.lang.javascript.psi.impl.JSCallExpressionImpl)1