mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[lsp] add keywords completion
GitOrigin-RevId: 1d6359a00c5d9b1e557aa2bb61badb91e2155128
This commit is contained in:
committed by
intellij-monorepo-bot
parent
fde19b5fb7
commit
6cc848fa4e
+5
-3
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user