mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-14 09:12:22 +07:00
Instead, parse them as usual and later report in the dedicated AssignTargetAnnotator and TypeAnnotationTargetAnnotator. This way, a PsiError element appearing in the PSI tree of a type declaration statement doesn't cause PyAstTypeDeclarationStatement.getTarget nullability contract violation. GitOrigin-RevId: a3e90088cfac7938c398d4d293a72dbd127a2cd0
30 lines
1017 B
Plaintext
30 lines
1017 B
Plaintext
PyFile:VariableAnnotationRecoveryAwaitExpressionAsTarget.py
|
|
PyFunction('f')
|
|
PsiElement(Py:ASYNC_KEYWORD)('async')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(Py:DEF_KEYWORD)('def')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(Py:IDENTIFIER)('f')
|
|
PyParameterList
|
|
PsiElement(Py:LPAR)('(')
|
|
PsiElement(Py:RPAR)(')')
|
|
PsiElement(Py:COLON)(':')
|
|
PsiWhiteSpace('\n ')
|
|
PyStatementList
|
|
PyTypeDeclarationStatement
|
|
PyPrefixExpression
|
|
PsiElement(Py:AWAIT_KEYWORD)('await')
|
|
PsiWhiteSpace(' ')
|
|
PyCallExpression: foo
|
|
PyTargetExpression: foo
|
|
PsiElement(Py:IDENTIFIER)('foo')
|
|
PyArgumentList
|
|
PsiElement(Py:LPAR)('(')
|
|
PyNumericLiteralExpression
|
|
PsiElement(Py:INTEGER_LITERAL)('42')
|
|
PsiElement(Py:RPAR)(')')
|
|
PyAnnotation
|
|
PsiElement(Py:COLON)(':')
|
|
PsiWhiteSpace(' ')
|
|
PyReferenceExpression: int
|
|
PsiElement(Py:IDENTIFIER)('int') |