mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-16412 Properly import named tuples for their use in type hints
For that I introduced a new method -- getElement() in PyType that allows to find out the element that can be used to reference this type according to PEP 484 perspective, e.g. a target assignment for TypeVar's and NamedTuples and PSI class themselves for class types. Also, class object types for named tuples are wrapped in typing.Type[] as expected.
This commit is contained in:
committed by
Andrey Vlasovskikh
parent
d1ae008593
commit
af64e90b62
+20
@@ -231,6 +231,26 @@ public class PyAnnotateVariableTypeIntentionTest extends PyIntentionTestCase {
|
||||
doAnnotationTest();
|
||||
}
|
||||
|
||||
public void testAnnotationTypingNamedTupleInOtherFile() {
|
||||
doMultiFileAnnotationTest();
|
||||
}
|
||||
|
||||
public void testAnnotationTypingNamedTupleClassInOtherFile() {
|
||||
doMultiFileAnnotationTest();
|
||||
}
|
||||
|
||||
public void testAnnotationTypingNamedTupleDirectInheritorInOtherFile() {
|
||||
doMultiFileAnnotationTest();
|
||||
}
|
||||
|
||||
public void testAnnotationCollectionsNamedTupleInOtherFile() {
|
||||
doMultiFileAnnotationTest();
|
||||
}
|
||||
|
||||
public void testAnnotationCollectionsNamedTupleClassInOtherFile() {
|
||||
doMultiFileAnnotationTest();
|
||||
}
|
||||
|
||||
public void testConflictWithAnnotationFunctionTypeIntention() {
|
||||
doTest(LanguageLevel.PYTHON36);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user