From 6cc848fa4eac823128a320664af7004523f6cdea Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Tue, 13 May 2025 14:21:06 +0200 Subject: [PATCH] [lsp] add keywords completion GitOrigin-RevId: 1d6359a00c5d9b1e557aa2bb61badb91e2155128 --- .../idea/completion/implCommon/handlers/handlerUtils.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/kotlin/completion/impl-shared/src/org/jetbrains/kotlin/idea/completion/implCommon/handlers/handlerUtils.kt b/plugins/kotlin/completion/impl-shared/src/org/jetbrains/kotlin/idea/completion/implCommon/handlers/handlerUtils.kt index 5d14fb7b734e..3babb54243f3 100644 --- a/plugins/kotlin/completion/impl-shared/src/org/jetbrains/kotlin/idea/completion/implCommon/handlers/handlerUtils.kt +++ b/plugins/kotlin/completion/impl-shared/src/org/jetbrains/kotlin/idea/completion/implCommon/handlers/handlerUtils.kt @@ -15,6 +15,7 @@ import com.intellij.openapi.util.TextRange import com.intellij.psi.PsiDocumentManager import com.intellij.psi.PsiWhiteSpace import com.intellij.psi.codeStyle.CodeStyleManager +import org.jetbrains.annotations.ApiStatus import org.jetbrains.kotlin.idea.completion.KeywordLookupObject import org.jetbrains.kotlin.idea.core.moveCaret import org.jetbrains.kotlin.idea.formatter.adjustLineIndent @@ -94,9 +95,10 @@ fun CharSequence.isCharAt(offset: Int, c: Char) = offset < length && this[offset fun Document.isTextAt(offset: Int, text: String) = offset + text.length <= textLength && getText(TextRange(offset, offset + text.length)) == text -private data class KeywordConstructLookupObject( - private val keyword: String, - private val constructToInsert: String +@ApiStatus.Internal +data class KeywordConstructLookupObject( + val keyword: String, + val constructToInsert: String ) : KeywordLookupObject() fun LookupElement.withLineIndentAdjuster(): LookupElement = LookupElementDecorator.withDelegateInsertHandler(