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
377 lines
11 KiB
Plaintext
Vendored
377 lines
11 KiB
Plaintext
Vendored
JetFile: TryRecovery.kt
|
|
PACKAGE_DIRECTIVE
|
|
<empty list>
|
|
IMPORT_LIST
|
|
<empty list>
|
|
FUN
|
|
PsiElement(fun)('fun')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(IDENTIFIER)('testOpenParens')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
TRY
|
|
PsiElement(try)('try')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace(' ')
|
|
CATCH
|
|
PsiElement(catch)('catch')
|
|
PsiErrorElement:Expecting exception variable declaration
|
|
<empty list>
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n ')
|
|
TRY
|
|
PsiElement(try)('try')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace(' ')
|
|
CATCH
|
|
PsiElement(catch)('catch')
|
|
PsiWhiteSpace(' ')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
PsiErrorElement:Expecting exception variable declaration
|
|
<empty list>
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n ')
|
|
TRY
|
|
PsiElement(try)('try')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace(' ')
|
|
CATCH
|
|
PsiElement(catch)('catch')
|
|
PsiWhiteSpace(' ')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('e')
|
|
PsiElement(COLON)(':')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
PsiErrorElement:Type expected
|
|
<empty list>
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n ')
|
|
TRY
|
|
PsiElement(try)('try')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace(' ')
|
|
CATCH
|
|
PsiElement(catch)('catch')
|
|
PsiWhiteSpace(' ')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('e')
|
|
PsiElement(COLON)(':')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('Exception')
|
|
PsiErrorElement:Expecting ')'
|
|
<empty list>
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n')
|
|
FUN
|
|
PsiElement(fun)('fun')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(IDENTIFIER)('testClosedParens')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
TRY
|
|
PsiElement(try)('try')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace(' ')
|
|
CATCH
|
|
PsiElement(catch)('catch')
|
|
PsiWhiteSpace(' ')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_PARAMETER
|
|
PsiErrorElement:Parameter name expected
|
|
<empty list>
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n ')
|
|
TRY
|
|
PsiElement(try)('try')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace(' ')
|
|
CATCH
|
|
PsiElement(catch)('catch')
|
|
PsiWhiteSpace(' ')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('e')
|
|
PsiErrorElement:Parameters must have type annotation
|
|
<empty list>
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n ')
|
|
TRY
|
|
PsiElement(try)('try')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace(' ')
|
|
CATCH
|
|
PsiElement(catch)('catch')
|
|
PsiWhiteSpace(' ')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('e')
|
|
PsiElement(COLON)(':')
|
|
TYPE_REFERENCE
|
|
PsiErrorElement:Type expected
|
|
<empty list>
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n ')
|
|
TRY
|
|
PsiElement(try)('try')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace(' ')
|
|
CATCH
|
|
PsiElement(catch)('catch')
|
|
PsiWhiteSpace(' ')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('e')
|
|
PsiElement(COLON)(':')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('Exception')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n ')
|
|
TRY
|
|
PsiElement(try)('try')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace(' ')
|
|
CATCH
|
|
PsiElement(catch)('catch')
|
|
PsiWhiteSpace(' ')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_PARAMETER
|
|
PsiErrorElement:Parameter name expected
|
|
<empty list>
|
|
PsiElement(COLON)(':')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('Exception')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n ')
|
|
TRY
|
|
PsiElement(try)('try')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace(' ')
|
|
CATCH
|
|
PsiElement(catch)('catch')
|
|
PsiWhiteSpace(' ')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_PARAMETER
|
|
PsiErrorElement:Parameter name expected
|
|
<empty list>
|
|
PsiElement(COLON)(':')
|
|
TYPE_REFERENCE
|
|
PsiErrorElement:Type expected
|
|
<empty list>
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n')
|
|
FUN
|
|
PsiElement(fun)('fun')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(IDENTIFIER)('testFinally')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
TRY
|
|
PsiElement(try)('try')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace(' ')
|
|
CATCH
|
|
PsiElement(catch)('catch')
|
|
PsiErrorElement:Expecting exception variable declaration
|
|
<empty list>
|
|
PsiWhiteSpace('\n ')
|
|
FINALLY
|
|
PsiElement(finally)('finally')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n ')
|
|
TRY
|
|
PsiElement(try)('try')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace(' ')
|
|
CATCH
|
|
PsiElement(catch)('catch')
|
|
PsiWhiteSpace(' ')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_PARAMETER
|
|
PsiErrorElement:Parameter name expected
|
|
<empty list>
|
|
PsiElement(RPAR)(')')
|
|
PsiErrorElement:Expecting a block: { ... }
|
|
<empty list>
|
|
PsiWhiteSpace('\n ')
|
|
FINALLY
|
|
PsiElement(finally)('finally')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n\n ')
|
|
TRY
|
|
PsiElement(try)('try')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace(' ')
|
|
CATCH
|
|
PsiElement(catch)('catch')
|
|
PsiWhiteSpace(' ')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_PARAMETER
|
|
PsiElement(IDENTIFIER)('e')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(COLON)(':')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('Exception')
|
|
PsiElement(RPAR)(')')
|
|
PsiErrorElement:Expecting a block: { ... }
|
|
<empty list>
|
|
PsiWhiteSpace('\n ')
|
|
FINALLY
|
|
PsiElement(finally)('finally')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiWhiteSpace('\n ')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n')
|
|
PsiElement(RBRACE)('}')
|