Attach preceding line comments to property accessors (KT-25417)
#KT-25417 Fixed
This commit is contained in:
+6
@@ -71,3 +71,9 @@ var prop: Int // Int
|
||||
set(value) {} // this is setter
|
||||
|
||||
val prop2: Int get = 1 // prop2
|
||||
|
||||
var prop3: Int // Int
|
||||
// this comment is for getter
|
||||
get() = 1
|
||||
// this comment is for setter
|
||||
set(value) {}
|
||||
|
||||
+40
-1
@@ -472,4 +472,43 @@ KtFile: CommentsBinding.kt
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('1')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// prop2')
|
||||
PsiComment(EOL_COMMENT)('// prop2')
|
||||
PsiWhiteSpace('\n\n')
|
||||
PROPERTY
|
||||
PsiElement(var)('var')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('prop3')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// Int')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY_ACCESSOR
|
||||
PsiComment(EOL_COMMENT)('// this comment is for getter')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(get)('get')
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('1')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY_ACCESSOR
|
||||
PsiComment(EOL_COMMENT)('// this comment is for setter')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(set)('set')
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_PARAMETER_LIST
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('value')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
Reference in New Issue
Block a user