Fixed 182 patchsets

This commit is contained in:
Alexander Podkhalyuzin
2019-02-13 16:31:01 +03:00
parent abad408d7b
commit a2d702c2a7
3 changed files with 43 additions and 18 deletions
@@ -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 -> ""
}
}
}
@@ -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 {
}
@@ -26,7 +26,7 @@ import org.jetbrains.kotlin.lexer.KotlinLexer
import org.jetbrains.kotlin.lexer.KtTokens
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))
override fun getCommentTokenSet(file: PsiFile): TokenSet? {
@@ -43,21 +43,4 @@ class KotlinIndexPatternBuilder: IndexPatternBuilder {
KtTokens.BLOCK_COMMENT -> "*/".length
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 -> ""
}
}
}