Fixed 182 patchsets
This commit is contained in:
@@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||||
|
* that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.idea.search
|
||||||
|
|
||||||
|
import com.intellij.psi.impl.search.IndexPatternBuilder
|
||||||
|
import com.intellij.psi.tree.IElementType
|
||||||
|
import org.jetbrains.kotlin.lexer.KtTokens
|
||||||
|
|
||||||
|
abstract class IndexPatternBuilderAdapter : IndexPatternBuilder {
|
||||||
|
override fun getCommentStartDelta(tokenType: IElementType, tokenText: CharSequence): Int {
|
||||||
|
return when (tokenType) {
|
||||||
|
KtTokens.EOL_COMMENT -> 2
|
||||||
|
KtTokens.BLOCK_COMMENT -> 2
|
||||||
|
KtTokens.DOC_COMMENT -> 3
|
||||||
|
else -> 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getCharsAllowedInContinuationPrefix(tokenType: IElementType): String {
|
||||||
|
return when (tokenType) {
|
||||||
|
KtTokens.BLOCK_COMMENT -> "*"
|
||||||
|
KtTokens.DOC_COMMENT -> "*"
|
||||||
|
else -> ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||||
|
* that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.idea.search
|
||||||
|
|
||||||
|
import com.intellij.psi.impl.search.IndexPatternBuilder
|
||||||
|
import com.intellij.psi.tree.IElementType
|
||||||
|
import org.jetbrains.kotlin.lexer.KtTokens
|
||||||
|
|
||||||
|
abstract class IndexPatternBuilderAdapter : IndexPatternBuilder {
|
||||||
|
}
|
||||||
+1
-18
@@ -26,7 +26,7 @@ import org.jetbrains.kotlin.lexer.KotlinLexer
|
|||||||
import org.jetbrains.kotlin.lexer.KtTokens
|
import org.jetbrains.kotlin.lexer.KtTokens
|
||||||
import org.jetbrains.kotlin.psi.KtFile
|
import org.jetbrains.kotlin.psi.KtFile
|
||||||
|
|
||||||
class KotlinIndexPatternBuilder: IndexPatternBuilder {
|
class KotlinIndexPatternBuilder: IndexPatternBuilderAdapter() {
|
||||||
private val TODO_COMMENT_TOKENS = TokenSet.orSet(KtTokens.COMMENTS, TokenSet.create(KDocTokens.KDOC))
|
private val TODO_COMMENT_TOKENS = TokenSet.orSet(KtTokens.COMMENTS, TokenSet.create(KDocTokens.KDOC))
|
||||||
|
|
||||||
override fun getCommentTokenSet(file: PsiFile): TokenSet? {
|
override fun getCommentTokenSet(file: PsiFile): TokenSet? {
|
||||||
@@ -43,21 +43,4 @@ class KotlinIndexPatternBuilder: IndexPatternBuilder {
|
|||||||
KtTokens.BLOCK_COMMENT -> "*/".length
|
KtTokens.BLOCK_COMMENT -> "*/".length
|
||||||
else -> 0
|
else -> 0
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getCommentStartDelta(tokenType: IElementType, tokenText: CharSequence): Int {
|
|
||||||
return when (tokenType) {
|
|
||||||
KtTokens.EOL_COMMENT -> 2
|
|
||||||
KtTokens.BLOCK_COMMENT -> 2
|
|
||||||
KtTokens.DOC_COMMENT -> 3
|
|
||||||
else -> 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getCharsAllowedInContinuationPrefix(tokenType: IElementType): String {
|
|
||||||
return when (tokenType) {
|
|
||||||
KtTokens.BLOCK_COMMENT -> "*"
|
|
||||||
KtTokens.DOC_COMMENT -> "*"
|
|
||||||
else -> ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user