07d35d305e
Fix a problem where deleting last import directive via "optimize imports" could lead to incorrect psi structure resulting in CCE, see EA-64291 New imports are inserted at the head (after package directive if present) of the file (before any comments) if no imports were present Add test for inserting import to file where a first statement is a comment Drop code dealing with non-existing import list in ImportInsertHelperImpl AbstractQuickFixTest: check for unexpected actions before changes to the file are made as it relies on the first line having specific format
310 lines
11 KiB
Plaintext
Vendored
310 lines
11 KiB
Plaintext
Vendored
JetFile: lambdaRecovery.kt
|
|
PACKAGE_DIRECTIVE
|
|
<empty list>
|
|
IMPORT_LIST
|
|
<empty list>
|
|
FUN
|
|
PsiElement(fun)('fun')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(IDENTIFIER)('foo')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('bar')
|
|
PsiWhiteSpace(' ')
|
|
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
|
|
PsiElement(AT)('@')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(IDENTIFIER)('ann')
|
|
PsiWhiteSpace(' ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
BLOCK
|
|
CALL_EXPRESSION
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('print')
|
|
VALUE_ARGUMENT_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_ARGUMENT
|
|
INTEGER_CONSTANT
|
|
PsiElement(INTEGER_LITERAL)('1')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n ')
|
|
CALL_EXPRESSION
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('bar')
|
|
PsiWhiteSpace(' ')
|
|
FUNCTION_LITERAL_ARGUMENT
|
|
ANNOTATED_EXPRESSION
|
|
PsiErrorElement:Expected annotation identifier after '@'
|
|
PsiElement(AT)('@')
|
|
PsiWhiteSpace(' ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
BLOCK
|
|
CALL_EXPRESSION
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('print')
|
|
VALUE_ARGUMENT_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_ARGUMENT
|
|
INTEGER_CONSTANT
|
|
PsiElement(INTEGER_LITERAL)('1')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n ')
|
|
CALL_EXPRESSION
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('bar')
|
|
PsiWhiteSpace(' ')
|
|
FUNCTION_LITERAL_ARGUMENT
|
|
ANNOTATED_EXPRESSION
|
|
PsiErrorElement:Expected annotation identifier after '@'
|
|
PsiElement(AT)('@')
|
|
PsiWhiteSpace(' ')
|
|
ANNOTATION
|
|
PsiElement(LBRACKET)('[')
|
|
ANNOTATION_ENTRY
|
|
CONSTRUCTOR_CALLEE
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('ann')
|
|
PsiElement(RBRACKET)(']')
|
|
PsiWhiteSpace(' ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
BLOCK
|
|
CALL_EXPRESSION
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('print')
|
|
VALUE_ARGUMENT_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_ARGUMENT
|
|
INTEGER_CONSTANT
|
|
PsiElement(INTEGER_LITERAL)('2')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n ')
|
|
CALL_EXPRESSION
|
|
ARRAY_ACCESS_EXPRESSION
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('bar')
|
|
PsiWhiteSpace(' ')
|
|
INDICES
|
|
PsiElement(LBRACKET)('[')
|
|
PsiErrorElement:Expecting an index element
|
|
<empty list>
|
|
PsiElement(RBRACKET)(']')
|
|
PsiWhiteSpace(' ')
|
|
FUNCTION_LITERAL_ARGUMENT
|
|
ANNOTATED_EXPRESSION
|
|
PsiErrorElement:Expected annotation identifier after '@'
|
|
PsiElement(AT)('@')
|
|
PsiWhiteSpace(' ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
BLOCK
|
|
CALL_EXPRESSION
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('print')
|
|
VALUE_ARGUMENT_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_ARGUMENT
|
|
INTEGER_CONSTANT
|
|
PsiElement(INTEGER_LITERAL)('2')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n ')
|
|
CALL_EXPRESSION
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('bar')
|
|
VALUE_ARGUMENT_LIST
|
|
PsiElement(LPAR)('(')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
FUNCTION_LITERAL_ARGUMENT
|
|
ANNOTATED_EXPRESSION
|
|
PsiErrorElement:Expected annotation identifier after '@'
|
|
PsiElement(AT)('@')
|
|
PsiWhiteSpace(' ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
BLOCK
|
|
CALL_EXPRESSION
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('print')
|
|
VALUE_ARGUMENT_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_ARGUMENT
|
|
INTEGER_CONSTANT
|
|
PsiElement(INTEGER_LITERAL)('1')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n ')
|
|
CALL_EXPRESSION
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('bar')
|
|
VALUE_ARGUMENT_LIST
|
|
PsiElement(LPAR)('(')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
FUNCTION_LITERAL_ARGUMENT
|
|
ANNOTATED_EXPRESSION
|
|
ANNOTATION
|
|
PsiElement(LBRACKET)('[')
|
|
PsiErrorElement:Expecting a list of annotations
|
|
<empty list>
|
|
PsiElement(RBRACKET)(']')
|
|
PsiWhiteSpace(' ')
|
|
PsiErrorElement:Expected annotation identifier after '@'
|
|
PsiElement(AT)('@')
|
|
PsiWhiteSpace(' ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
BLOCK
|
|
CALL_EXPRESSION
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('print')
|
|
VALUE_ARGUMENT_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_ARGUMENT
|
|
INTEGER_CONSTANT
|
|
PsiElement(INTEGER_LITERAL)('2')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n ')
|
|
CALL_EXPRESSION
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('bar')
|
|
VALUE_ARGUMENT_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_ARGUMENT
|
|
ANNOTATED_EXPRESSION
|
|
PsiErrorElement:Expected annotation identifier after '@'
|
|
PsiElement(AT)('@')
|
|
PsiWhiteSpace(' ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
VALUE_PARAMETER_LIST
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('param')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(ARROW)('->')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('param')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace('\n\n ')
|
|
CALL_EXPRESSION
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('bar')
|
|
VALUE_ARGUMENT_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_ARGUMENT
|
|
ANNOTATED_EXPRESSION
|
|
PsiErrorElement:Expected annotation identifier after '@'
|
|
PsiElement(AT)('@')
|
|
PsiWhiteSpace(' ')
|
|
CALL_EXPRESSION
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('ann')
|
|
PsiWhiteSpace(' ')
|
|
FUNCTION_LITERAL_ARGUMENT
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
VALUE_PARAMETER_LIST
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('param')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(ARROW)('->')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('param')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace('\n\n ')
|
|
IF
|
|
PsiElement(if)('if')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(LPAR)('(')
|
|
CONDITION
|
|
BOOLEAN_CONSTANT
|
|
PsiElement(true)('true')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
THEN
|
|
ANNOTATED_EXPRESSION
|
|
PsiErrorElement:Expected annotation identifier after '@'
|
|
PsiElement(AT)('@')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(else)('else')
|
|
PsiWhiteSpace(' ')
|
|
ELSE
|
|
ANNOTATED_EXPRESSION
|
|
ANNOTATION
|
|
PsiElement(LBRACKET)('[')
|
|
ANNOTATION_ENTRY
|
|
CONSTRUCTOR_CALLEE
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('ann')
|
|
PsiElement(RBRACKET)(']')
|
|
PsiWhiteSpace(' ')
|
|
PsiErrorElement:Expected annotation identifier after '@'
|
|
PsiElement(AT)('@')
|
|
PsiWhiteSpace(' ')
|
|
CALL_EXPRESSION
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('ann')
|
|
PsiWhiteSpace(' ')
|
|
FUNCTION_LITERAL_ARGUMENT
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n\n ')
|
|
BLOCK
|
|
<empty list>
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n')
|
|
PsiElement(RBRACE)('}')
|