Fixed doc-comments only binder to bind doc-comment always
This commit is contained in:
@@ -58,14 +58,7 @@ object PrecedingDocCommentsBinder : WhitespacesAndCommentsBinder {
|
||||
if (tokens.isEmpty()) return 0
|
||||
|
||||
for (idx in tokens.indices.reversed()) {
|
||||
val tokenType = tokens[idx]
|
||||
when (tokenType) {
|
||||
JetTokens.DOC_COMMENT -> return idx
|
||||
|
||||
JetTokens.WHITE_SPACE -> continue
|
||||
|
||||
else -> break
|
||||
}
|
||||
if (tokens[idx] == JetTokens.DOC_COMMENT) return idx
|
||||
}
|
||||
|
||||
return tokens.size
|
||||
|
||||
@@ -6,7 +6,7 @@ class A(
|
||||
/**
|
||||
* Doc comment for val-parameter
|
||||
*/
|
||||
val p: Int
|
||||
/*var*/val p: Int
|
||||
) {
|
||||
/**
|
||||
* Doc comment for function
|
||||
|
||||
@@ -27,6 +27,7 @@ JetFile: DocCommentsBinding.kt
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(KDOC_END)('*/')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiComment(BLOCK_COMMENT)('/*var*/')
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('p')
|
||||
|
||||
Reference in New Issue
Block a user