use of com.jetbrains.python.psi.stubs.PyTargetExpressionStub in project intellij-community by JetBrains.
the class PyStdlibTypeProvider method getNamedTupleType.
@Nullable
private static PyType getNamedTupleType(@NotNull PsiElement referenceTarget, @NotNull TypeEvalContext context, @Nullable PsiElement anchor) {
if (referenceTarget instanceof PyTargetExpression) {
final PyTargetExpression target = (PyTargetExpression) referenceTarget;
final PyTargetExpressionStub stub = target.getStub();
if (stub != null) {
return getNamedTupleTypeFromStub(target, stub.getCustomStub(PyNamedTupleStub.class), 1);
} else {
return getNamedTupleTypeFromAST(target, context, 1);
}
} else if (referenceTarget instanceof PyFunction && anchor instanceof PyCallExpression) {
return getNamedTupleTypeFromAST((PyCallExpression) anchor, context, 2);
}
return null;
}
Aggregations