mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
fixed PY-11495 Create function: do not propose quick-fix for unresolved parts of fqn
This commit is contained in:
@@ -476,7 +476,8 @@ public class PyUnresolvedReferencesInspection extends PyInspection {
|
||||
}
|
||||
addAddSelfFix(node, refex, actions);
|
||||
PyCallExpression callExpression = PsiTreeUtil.getParentOfType(element, PyCallExpression.class);
|
||||
if (callExpression != null) {
|
||||
if (callExpression != null && (!(callExpression.getCallee() instanceof PyQualifiedExpression) ||
|
||||
((PyQualifiedExpression)callExpression.getCallee()).getQualifier() == null)) {
|
||||
actions.add(new UnresolvedRefCreateFunctionQuickFix(callExpression, refex));
|
||||
}
|
||||
PyFunction parentFunction = PsiTreeUtil.getParentOfType(element, PyFunction.class);
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<error descr="Unresolved reference 'my_ref'">my_<caret>ref</error>.do_smth(1, 2)
|
||||
@@ -266,6 +266,14 @@ public class PyQuickFixTest extends PyTestCase {
|
||||
PyBundle.message("QFIX.unresolved.reference.create.function.$0", "ref"), true, true);
|
||||
}
|
||||
|
||||
public void testUnresolvedRefNoCreateFunction() {
|
||||
myFixture.enableInspections(PyUnresolvedReferencesInspection.class);
|
||||
myFixture.configureByFile("UnresolvedRefNoCreateFunction.py");
|
||||
myFixture.checkHighlighting(true, false, false);
|
||||
final IntentionAction intentionAction = myFixture.getAvailableIntention(PyBundle.message("QFIX.unresolved.reference.create.function.$0", "ref"));
|
||||
assertNull(intentionAction);
|
||||
}
|
||||
|
||||
public void testReplaceNotEqOperator() {
|
||||
doInspectionTest("ReplaceNotEqOperator.py", PyCompatibilityInspection.class,
|
||||
PyBundle.message("INTN.replace.noteq.operator"), true, true);
|
||||
|
||||
Reference in New Issue
Block a user