mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Use better TypeEvalContext.codeAnalysis() instead of codeInsightFallback() for reference expressions (PY-15558)
For PyReferenceExpressionImpl we are sure that we are a part of an AST, not a stub, so we can use the current file as the anchor for a more powerful codeAnalysis() type evaluation context.
This commit is contained in:
@@ -60,7 +60,10 @@ public class PyReferenceExpressionImpl extends PyElementImpl implements PyRefere
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiPolyVariantReference getReference() {
|
||||
return getReference(PyResolveContext.defaultContext());
|
||||
//noinspection InstanceofIncompatibleInterface
|
||||
assert !(this instanceof StubBasedPsiElement);
|
||||
final TypeEvalContext context = TypeEvalContext.codeAnalysis(getProject(), getContainingFile());
|
||||
return getReference(PyResolveContext.defaultContext().withTypeEvalContext(context));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user