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:
Nikolay Krasko
2017-08-03 16:27:38 +03:00
parent 8de6017e53
commit 8d226594ff
11 changed files with 84 additions and 14 deletions
+5
View File
@@ -0,0 +1,5 @@
/** Comment */
fun test() {}
// Some other comment
+26
View File
@@ -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
View File
@@ -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
View File
@@ -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