Search in sources :

Example 1 with FileLocalResolver

use of com.intellij.psi.impl.source.FileLocalResolver in project intellij-community by JetBrains.

the class JavaFunctionalExpressionIndex method createChainStart.

@Nullable
private static ReferenceChainLink createChainStart(FileLocalResolver resolver, LighterASTNode expr, boolean isCall, String referenceName) {
    if (!isCall) {
        FileLocalResolver.LightResolveResult result = resolver.resolveLocally(expr);
        if (result == FileLocalResolver.LightResolveResult.UNKNOWN)
            return null;
        LighterASTNode target = result.getTarget();
        if (target != null) {
            String typeName = resolver.getShortClassTypeName(target);
            return typeName != null ? new ReferenceChainLink(typeName, false, -1) : null;
        }
    }
    return new ReferenceChainLink(referenceName, isCall, getArgCount(resolver.getLightTree(), expr));
}
Also used : LighterASTNode(com.intellij.lang.LighterASTNode) FileLocalResolver(com.intellij.psi.impl.source.FileLocalResolver) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

LighterASTNode (com.intellij.lang.LighterASTNode)1 FileLocalResolver (com.intellij.psi.impl.source.FileLocalResolver)1 Nullable (org.jetbrains.annotations.Nullable)1