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
|
if (tokens.isEmpty()) return 0
|
||||||
|
|
||||||
for (idx in tokens.indices.reversed()) {
|
for (idx in tokens.indices.reversed()) {
|
||||||
val tokenType = tokens[idx]
|
if (tokens[idx] == JetTokens.DOC_COMMENT) return idx
|
||||||
when (tokenType) {
|
|
||||||
JetTokens.DOC_COMMENT -> return idx
|
|
||||||
|
|
||||||
JetTokens.WHITE_SPACE -> continue
|
|
||||||
|
|
||||||
else -> break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return tokens.size
|
return tokens.size
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ class A(
|
|||||||
/**
|
/**
|
||||||
* Doc comment for val-parameter
|
* Doc comment for val-parameter
|
||||||
*/
|
*/
|
||||||
val p: Int
|
/*var*/val p: Int
|
||||||
) {
|
) {
|
||||||
/**
|
/**
|
||||||
* Doc comment for function
|
* Doc comment for function
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ JetFile: DocCommentsBinding.kt
|
|||||||
PsiWhiteSpace('\n ')
|
PsiWhiteSpace('\n ')
|
||||||
PsiElement(KDOC_END)('*/')
|
PsiElement(KDOC_END)('*/')
|
||||||
PsiWhiteSpace('\n ')
|
PsiWhiteSpace('\n ')
|
||||||
|
PsiComment(BLOCK_COMMENT)('/*var*/')
|
||||||
PsiElement(val)('val')
|
PsiElement(val)('val')
|
||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
PsiElement(IDENTIFIER)('p')
|
PsiElement(IDENTIFIER)('p')
|
||||||
|
|||||||
Reference in New Issue
Block a user