PY-16412 Detect presence of type annotations for variables purely syntactically

Namely, if there is any PEP 526 variable type annotation or a comment
that starts with "# type:", don't suggest the intention regardless
of whether the type hint itself is well-formed, properly resolved, etc.
This commit is contained in:
Mikhail Golubev
2018-02-05 21:41:59 +03:00
committed by Andrey Vlasovskikh
parent b0c00f3a89
commit af24ba5f20
5 changed files with 94 additions and 3 deletions
@@ -38,6 +38,18 @@ public class PyAnnotateVariableTypeIntentionTest extends PyIntentionTestCase {
doNegativeTest();
}
public void testNotSuggestedForLocalAssignmentTargetWithUnresolvedAnnotation() {
doNegativeTest();
}
public void testNotSuggestedForLocalAssignmentTargetWithUnresolvedTypeComment() {
doNegativeTest();
}
public void testNotSuggestedForLocalAssignmentTargetWithUnresolvedAheadOfTimeAnnotation() {
doNegativeTest();
}
public void testAnnotationLocalSimpleAssignmentTarget() {
doTestAnnotation();
}