Search in sources :

Example 1 with PyResolveProcessor

use of com.jetbrains.python.psi.resolve.PyResolveProcessor in project intellij-community by JetBrains.

the class PyClassTypeImpl method resolveInner.

@NotNull
private static List<? extends RatedResolveResult> resolveInner(@NotNull PyClass cls, boolean isDefinition, @NotNull String name, @Nullable PyExpression location) {
    final PyResolveProcessor processor = new PyResolveProcessor(name);
    final Collection<PsiElement> result;
    if (!isDefinition && !cls.processInstanceLevelDeclarations(processor, location)) {
        result = processor.getElements();
    } else {
        cls.processClassLevelDeclarations(processor);
        result = processor.getElements();
    }
    return ContainerUtil.map(result, element -> new RatedResolveResult(RatedResolveResult.RATE_NORMAL, element));
}
Also used : PyResolveProcessor(com.jetbrains.python.psi.resolve.PyResolveProcessor) RatedResolveResult(com.jetbrains.python.psi.resolve.RatedResolveResult) PsiElement(com.intellij.psi.PsiElement) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

PsiElement (com.intellij.psi.PsiElement)1 PyResolveProcessor (com.jetbrains.python.psi.resolve.PyResolveProcessor)1 RatedResolveResult (com.jetbrains.python.psi.resolve.RatedResolveResult)1 NotNull (org.jetbrains.annotations.NotNull)1