mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-18816 Use PyResolveContext#noImplicits() instead of defaultContext()
where resolving of implicit attributes is actually not required. Originally, defaultContext() was intended to be only for "Navigate to Definition".
This commit is contained in:
@@ -58,7 +58,7 @@ public class PyGlobalUndefinedInspection extends PyInspection {
|
||||
final PyTargetExpression[] globals = node.getGlobals();
|
||||
|
||||
for (PyTargetExpression global : globals) {
|
||||
final PyResolveContext resolveContext = PyResolveContext.defaultContext().withTypeEvalContext(myTypeEvalContext);
|
||||
final PyResolveContext resolveContext = PyResolveContext.noImplicits().withTypeEvalContext(myTypeEvalContext);
|
||||
if (global.getReference(resolveContext).resolve() == global) {
|
||||
registerProblem(global, PyBundle.message("INSP.NAME.global.$0.undefined", global.getName()));
|
||||
}
|
||||
|
||||
@@ -398,7 +398,7 @@ public class PyNamedParameterImpl extends PyBaseElementImpl<PyNamedParameterStub
|
||||
public void visitPyTargetExpression(PyTargetExpression node) {
|
||||
if (parameterWasReassigned.get()) return;
|
||||
|
||||
final PyResolveContext resolveContext = PyResolveContext.defaultContext().withTypeEvalContext(context);
|
||||
final PyResolveContext resolveContext = PyResolveContext.noImplicits().withTypeEvalContext(context);
|
||||
if (node.getReference(resolveContext).isReferenceTo(PyNamedParameterImpl.this)) {
|
||||
parameterWasReassigned.set(true);
|
||||
}
|
||||
|
||||
+1
-1
@@ -136,7 +136,7 @@ class InstanceFieldsManager extends FieldsManager {
|
||||
@Override
|
||||
protected boolean applyNotNull(@NotNull final PyTargetExpression input) {
|
||||
final TypeEvalContext typeEvalContext = TypeEvalContext.userInitiated(input.getProject(), null);
|
||||
final PyResolveContext context = PyResolveContext.defaultContext().withTypeEvalContext(typeEvalContext);
|
||||
final PyResolveContext context = PyResolveContext.noImplicits().withTypeEvalContext(typeEvalContext);
|
||||
return input.getReference(context).resolve() instanceof PyTargetExpression;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -190,7 +190,7 @@ class PropertiesManager extends MembersManager<PyElement> {
|
||||
final PsiReference reference;
|
||||
if (node instanceof PyReferenceOwner) {
|
||||
final TypeEvalContext context = TypeEvalContext.userInitiated(node.getProject(), null);
|
||||
reference = ((PyReferenceOwner)node).getReference(PyResolveContext.defaultContext().withTypeEvalContext(context));
|
||||
reference = ((PyReferenceOwner)node).getReference(PyResolveContext.noImplicits().withTypeEvalContext(context));
|
||||
}
|
||||
else {
|
||||
reference = node.getReference();
|
||||
|
||||
Reference in New Issue
Block a user