From 69a1bddc04c0bdf4e357693428d4506be7cc7fc8 Mon Sep 17 00:00:00 2001 From: RedNesto Date: Tue, 1 Oct 2024 12:45:26 +0200 Subject: [PATCH] Opt-in internal API for now and hope it goes well for now --- src/main/kotlin/insight/generation/EventGenHelper.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/insight/generation/EventGenHelper.kt b/src/main/kotlin/insight/generation/EventGenHelper.kt index 2b7226229..4158f91c7 100644 --- a/src/main/kotlin/insight/generation/EventGenHelper.kt +++ b/src/main/kotlin/insight/generation/EventGenHelper.kt @@ -33,6 +33,7 @@ import com.intellij.psi.PsiElement import com.intellij.psi.PsiFile import com.intellij.psi.codeStyle.CodeStyleManager import com.intellij.psi.util.parentOfType +import org.jetbrains.kotlin.analysis.api.KaIdeApi import org.jetbrains.kotlin.idea.base.analysis.api.utils.shortenReferences import org.jetbrains.kotlin.idea.base.analysis.api.utils.shortenReferencesInRange import org.jetbrains.kotlin.idea.base.plugin.KotlinPluginMode @@ -115,7 +116,7 @@ class KotlinEventGenHelper : EventGenHelper { when (KotlinPluginModeProvider.currentPluginMode) { KotlinPluginMode.K1 -> ShortenReferences.DEFAULT.process(insertedEntry) // TODO find a non-internal alternative to this... - KotlinPluginMode.K2 -> shortenReferences(insertedEntry) + KotlinPluginMode.K2 -> @OptIn(KaIdeApi::class) shortenReferences(insertedEntry) } } @@ -127,7 +128,7 @@ class KotlinEventGenHelper : EventGenHelper { when (KotlinPluginModeProvider.currentPluginMode) { KotlinPluginMode.K1 -> ShortenReferences.DEFAULT.process(file, marker.startOffset, marker.endOffset) // TODO find a non-internal alternative to this... - KotlinPluginMode.K2 -> shortenReferencesInRange(file, marker.textRange) + KotlinPluginMode.K2 -> @OptIn(KaIdeApi::class) shortenReferencesInRange(file, marker.textRange) } } }