Put comments and whitespaces under body in script files
It's more consistent to normal function body for IDE. Doc comments in file beginning are now sticks to declarations correctly. Moving declarations at the end of scripts is fixed
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
/** Comment */
|
||||
fun test() {}
|
||||
|
||||
// Some other comment
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
KtFile: FunctionComment.kts
|
||||
PACKAGE_DIRECTIVE
|
||||
<empty list>
|
||||
IMPORT_LIST
|
||||
<empty list>
|
||||
SCRIPT
|
||||
BLOCK
|
||||
FUN
|
||||
KDoc
|
||||
PsiElement(KDOC_START)('/**')
|
||||
KDOC_SECTION
|
||||
PsiElement(KDOC_TEXT)(' Comment ')
|
||||
PsiElement(KDOC_END)('*/')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('test')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n\n')
|
||||
PsiComment(EOL_COMMENT)('// Some other comment')
|
||||
+1
-1
@@ -23,9 +23,9 @@ KtFile: Import.kts
|
||||
PsiElement(IDENTIFIER)('ddd')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(MUL)('*')
|
||||
PsiWhiteSpace('\n\n')
|
||||
SCRIPT
|
||||
BLOCK
|
||||
PsiWhiteSpace('\n\n')
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
|
||||
+2
-2
@@ -3,10 +3,10 @@ KtFile: Shebang.kts
|
||||
<empty list>
|
||||
IMPORT_LIST
|
||||
<empty list>
|
||||
PsiComment(SHEBANG_COMMENT)('#!/usr/bin/env kotlin')
|
||||
PsiWhiteSpace('\n\n')
|
||||
SCRIPT
|
||||
BLOCK
|
||||
PsiComment(SHEBANG_COMMENT)('#!/usr/bin/env kotlin')
|
||||
PsiWhiteSpace('\n\n')
|
||||
SCRIPT_INITIALIZER
|
||||
CALL_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
|
||||
Reference in New Issue
Block a user