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
515 lines
17 KiB
Plaintext
Vendored
515 lines
17 KiB
Plaintext
Vendored
JetFile: FunctionLiterals_ERR.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 ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace(' ')
|
|
VALUE_PARAMETER_LIST
|
|
<empty list>
|
|
PsiElement(ARROW)('->')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiErrorElement:Expecting ')'
|
|
<empty list>
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(ARROW)('->')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(COLON)(':')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
PsiErrorElement:Type expected
|
|
<empty list>
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(ARROW)('->')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(COLON)(':')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('A')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(COLON)(':')
|
|
PsiErrorElement:Expecting a type
|
|
<empty list>
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(ARROW)('->')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(COLON)(':')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('T')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(ARROW)('->')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
<empty list>
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiElement(COMMA)(',')
|
|
PsiErrorElement:Expecting a parameter declaration
|
|
<empty list>
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(ARROW)('->')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(COLON)(':')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('A')
|
|
PsiElement(COMMA)(',')
|
|
PsiWhiteSpace(' ')
|
|
PsiErrorElement:Expecting a parameter declaration
|
|
PsiElement(COMMA)(',')
|
|
PsiWhiteSpace(' ')
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(COLON)(':')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('B')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(ARROW)('->')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(COLON)(':')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('A')
|
|
PsiElement(COMMA)(',')
|
|
PsiWhiteSpace(' ')
|
|
PsiErrorElement:Expecting a parameter declaration
|
|
PsiElement(COMMA)(',')
|
|
PsiWhiteSpace(' ')
|
|
VALUE_PARAMETER
|
|
PsiErrorElement:Expecting parameter declaration
|
|
<empty list>
|
|
PsiElement(COMMA)(',')
|
|
PsiWhiteSpace(' ')
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(COLON)(':')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('T')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(ARROW)('->')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
BLOCK
|
|
DOT_QUALIFIED_EXPRESSION
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('T')
|
|
PsiElement(DOT)('.')
|
|
CALL_EXPRESSION
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('t')
|
|
VALUE_ARGUMENT_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_ARGUMENT
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
|
|
PsiElement(ARROW)('->')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
BLOCK
|
|
BINARY_EXPRESSION
|
|
DOT_QUALIFIED_EXPRESSION
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('T')
|
|
PsiElement(DOT)('.')
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('t')
|
|
PsiWhiteSpace(' ')
|
|
OPERATION_REFERENCE
|
|
PsiElement(MINUS)('-')
|
|
PARENTHESIZED
|
|
PsiElement(LPAR)('(')
|
|
BINARY_WITH_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiWhiteSpace(' ')
|
|
OPERATION_REFERENCE
|
|
PsiElement(COLON)(':')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('A')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
|
|
PsiElement(ARROW)('->')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
VALUE_PARAMETER_LIST
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(COLON)(':')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('b')
|
|
PsiElement(COMMA)(',')
|
|
PsiWhiteSpace(' ')
|
|
VALUE_PARAMETER
|
|
PsiErrorElement:Expecting parameter name
|
|
<empty list>
|
|
PsiElement(ARROW)('->')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('f')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
VALUE_PARAMETER_LIST
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(COLON)(':')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
PsiErrorElement:Type expected
|
|
<empty list>
|
|
PsiElement(COMMA)(',')
|
|
PsiWhiteSpace(' ')
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('c')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(ARROW)('->')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('f')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
VALUE_PARAMETER_LIST
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(COLON)(':')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
PsiErrorElement:Type expected
|
|
<empty list>
|
|
PsiElement(ARROW)('->')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('f')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
VALUE_PARAMETER_LIST
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiElement(COMMA)(',')
|
|
PsiWhiteSpace(' ')
|
|
VALUE_PARAMETER
|
|
PsiErrorElement:Expecting parameter name
|
|
<empty list>
|
|
PsiElement(ARROW)('->')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('f')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
BLOCK
|
|
BINARY_WITH_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiWhiteSpace(' ')
|
|
OPERATION_REFERENCE
|
|
PsiElement(COLON)(':')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('b')
|
|
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
|
|
PsiElement(COMMA)(',')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
BLOCK
|
|
BINARY_WITH_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiWhiteSpace(' ')
|
|
OPERATION_REFERENCE
|
|
PsiElement(COLON)(':')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
PsiErrorElement:Type expected
|
|
<empty list>
|
|
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
|
|
PsiElement(COMMA)(',')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('T')
|
|
PsiElement(DOT)('.')
|
|
VALUE_PARAMETER_LIST
|
|
PsiErrorElement:Expecting a parameter list in parentheses (...)
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiWhiteSpace(' ')
|
|
VALUE_PARAMETER
|
|
PsiErrorElement:Expecting parameter declaration
|
|
<empty list>
|
|
PsiElement(COLON)(':')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('b')
|
|
PsiErrorElement:Expecting ')'
|
|
<empty list>
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(ARROW)('->')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('f')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiElement(COMMA)(',')
|
|
PsiWhiteSpace(' ')
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('b')
|
|
PsiElement(RPAR)(')')
|
|
PsiErrorElement:An -> is expected
|
|
<empty list>
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
<empty list>
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('T')
|
|
PsiElement(DOT)('.')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiElement(COMMA)(',')
|
|
PsiWhiteSpace(' ')
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('b')
|
|
PsiElement(RPAR)(')')
|
|
PsiErrorElement:An -> is expected
|
|
<empty list>
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
<empty list>
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiElement(COLON)(':')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('Int')
|
|
PsiElement(COMMA)(',')
|
|
PsiErrorElement:Expecting a parameter declaration
|
|
<empty list>
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(RPAR)(')')
|
|
PsiErrorElement:An -> is expected
|
|
<empty list>
|
|
BLOCK
|
|
<empty list>
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n ')
|
|
FUNCTION_LITERAL_EXPRESSION
|
|
FUNCTION_LITERAL
|
|
PsiElement(LBRACE)('{')
|
|
VALUE_PARAMETER_LIST
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiElement(COMMA)(',')
|
|
PsiWhiteSpace(' ')
|
|
VALUE_PARAMETER
|
|
PsiErrorElement:Expecting parameter name
|
|
<empty list>
|
|
BLOCK
|
|
<empty list>
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n')
|
|
PsiElement(RBRACE)('}')
|