use of com.jetbrains.python.psi.PyCallExpression in project intellij-community by JetBrains.
the class PyResolveCalleeTest method resolveCallee.
@NotNull
private PyCallExpression.PyMarkedCallee resolveCallee() {
final PsiReference ref = myFixture.getReferenceAtCaretPosition("/resolve/callee/" + getTestName(false) + ".py");
final PyCallExpression call = PsiTreeUtil.getParentOfType(ref.getElement(), PyCallExpression.class);
final TypeEvalContext context = TypeEvalContext.codeAnalysis(myFixture.getProject(), myFixture.getFile());
final PyResolveContext resolveContext = PyResolveContext.noImplicits().withTypeEvalContext(context);
final List<PyCallExpression.PyMarkedCallee> callees = call.multiResolveCallee(resolveContext);
assertEquals(1, callees.size());
return callees.get(0);
}
use of com.jetbrains.python.psi.PyCallExpression in project intellij-community by JetBrains.
the class PySmartStepIntoHandler method addVariants.
private static void addVariants(Document document, int line, @Nullable PsiElement element, List<PySmartStepIntoVariant> variants, Set<PyCallExpression> visited) {
if (element == null)
return;
final PyCallExpression expression = PsiTreeUtil.getParentOfType(element, PyCallExpression.class);
if (expression != null && expression.getTextRange().getEndOffset() <= document.getLineEndOffset(line) && visited.add(expression)) {
addVariants(document, line, expression.getParent(), variants, visited);
PyExpression ref = expression.getCallee();
variants.add(new PySmartStepIntoVariant(ref));
}
}
Aggregations