[lsp] add keywords completion

GitOrigin-RevId: 1d6359a00c5d9b1e557aa2bb61badb91e2155128
This commit is contained in:
Ilya Kirillov
2025-05-14 18:49:23 +00:00
committed by intellij-monorepo-bot
parent fde19b5fb7
commit 6cc848fa4e
@@ -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(