mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
regression with moving future import to the top, test for extended completion (PY-23475)
GitOrigin-RevId: 218984c89d2229b6a32947650f46df4f1c3aecef
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0d5f27c47d
commit
aaaf2828d9
+4
@@ -217,6 +217,10 @@ public class AddImportHelper {
|
||||
seeker = feeler;
|
||||
}
|
||||
else if (isAssignmentToModuleLevelDunderName(feeler)) {
|
||||
if (priority == ImportPriority.FUTURE) {
|
||||
seeker = feeler;
|
||||
break;
|
||||
}
|
||||
feeler = feeler.getNextSibling();
|
||||
seeker = feeler;
|
||||
skippedOverStatements = true;
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
"""Module docstring"""
|
||||
|
||||
__author__ = "aknizev"
|
||||
|
||||
from src import foo
|
||||
|
||||
foo()
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
"""Module docstring"""
|
||||
|
||||
__author__ = "aknizev"
|
||||
|
||||
|
||||
foo<caret>
|
||||
@@ -0,0 +1,2 @@
|
||||
def foo():
|
||||
pass
|
||||
@@ -0,0 +1,6 @@
|
||||
"""Module docstring"""
|
||||
|
||||
__author__ = "akniazev"
|
||||
|
||||
<warning descr="from __future__ imports must occur at the beginning of the file"><caret>from __future__ import absolute_import</warning>
|
||||
import collections
|
||||
@@ -0,0 +1,7 @@
|
||||
"""Module docstring"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
__author__ = "akniazev"
|
||||
|
||||
import collections
|
||||
@@ -96,6 +96,11 @@ public class PyClassNameCompletionTest extends PyTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
// PY-23475
|
||||
public void testImportAddedAfterModuleLevelDunder() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
// PY-20976
|
||||
public void testOrderingLexicographicalBaseline() {
|
||||
doTestCompletionOrder("a.foo", "b.foo");
|
||||
|
||||
@@ -186,6 +186,11 @@ public class PyQuickFixTest extends PyTestCase {
|
||||
doInspectionTest(PyFromFutureImportInspection.class, PyBundle.message("QFIX.move.from.future.import"), true, true);
|
||||
}
|
||||
|
||||
// PY-23475
|
||||
public void testMoveFromFutureImportAboveModuleLevelDunder() {
|
||||
doInspectionTest(PyFromFutureImportInspection.class, PyBundle.message("QFIX.move.from.future.import"), true, true);
|
||||
}
|
||||
|
||||
public void testComparisonWithNone() {
|
||||
doInspectionTest(PyComparisonWithNoneInspection.class, PyBundle.message("QFIX.replace.equality"), true, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user