From fb0757f5d4fc24a6f8cc9b5acd6db3a0fe5f706c Mon Sep 17 00:00:00 2001 From: "Kirill.Karnaukhov" Date: Thu, 24 Oct 2024 14:51:32 +0200 Subject: [PATCH] [inline-completion] IJPL-165092: rollback added `@ApiStatus.Internal` (cherry picked from commit f08b255c5c05793df2ac4f942a0dd09b2dd08941) IJ-MR-147666 GitOrigin-RevId: 12440db0ae92917719232b67aa1ec7e4a1d37c12 --- .../platform-impl/api-dump-unreviewed.txt | 4 ++++ .../completion/InlineCompletionEvent.kt | 22 +++++++++---------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/platform/platform-impl/api-dump-unreviewed.txt b/platform/platform-impl/api-dump-unreviewed.txt index 815ca6255478..cc320f8d02ae 100644 --- a/platform/platform-impl/api-dump-unreviewed.txt +++ b/platform/platform-impl/api-dump-unreviewed.txt @@ -775,6 +775,8 @@ com.intellij.codeInsight.inline.completion.InlineCompletionEvent - a:toRequest():com.intellij.codeInsight.inline.completion.InlineCompletionRequest f:com.intellij.codeInsight.inline.completion.InlineCompletionEvent$DirectCall - com.intellij.codeInsight.inline.completion.InlineCompletionEvent +- (com.intellij.openapi.editor.Editor,com.intellij.openapi.editor.Caret,com.intellij.openapi.actionSystem.DataContext):V +- b:(com.intellij.openapi.editor.Editor,com.intellij.openapi.editor.Caret,com.intellij.openapi.actionSystem.DataContext,I,kotlin.jvm.internal.DefaultConstructorMarker):V - f:getCaret():com.intellij.openapi.editor.Caret - f:getContext():com.intellij.openapi.actionSystem.DataContext - f:getEditor():com.intellij.openapi.editor.Editor @@ -791,10 +793,12 @@ com.intellij.codeInsight.inline.completion.InlineCompletionEvent$InlineLookupEve f:com.intellij.codeInsight.inline.completion.InlineCompletionEvent$LookupCancelled - com.intellij.codeInsight.inline.completion.InlineCompletionEvent - com.intellij.codeInsight.inline.completion.InlineCompletionEvent$InlineLookupEvent +- (com.intellij.codeInsight.lookup.LookupEvent):V - getEvent():com.intellij.codeInsight.lookup.LookupEvent f:com.intellij.codeInsight.inline.completion.InlineCompletionEvent$LookupChange - com.intellij.codeInsight.inline.completion.InlineCompletionEvent - com.intellij.codeInsight.inline.completion.InlineCompletionEvent$InlineLookupEvent +- (com.intellij.codeInsight.lookup.LookupEvent):V - getEvent():com.intellij.codeInsight.lookup.LookupEvent - toRequest():com.intellij.codeInsight.inline.completion.InlineCompletionRequest com.intellij.codeInsight.inline.completion.InlineCompletionEventAdapter diff --git a/platform/platform-impl/src/com/intellij/codeInsight/inline/completion/InlineCompletionEvent.kt b/platform/platform-impl/src/com/intellij/codeInsight/inline/completion/InlineCompletionEvent.kt index 6e8943d10ddb..68328a25c4ec 100644 --- a/platform/platform-impl/src/com/intellij/codeInsight/inline/completion/InlineCompletionEvent.kt +++ b/platform/platform-impl/src/com/intellij/codeInsight/inline/completion/InlineCompletionEvent.kt @@ -19,7 +19,6 @@ import com.intellij.psi.PsiFile import com.intellij.psi.impl.source.PsiFileImpl import com.intellij.psi.util.PsiUtilBase import org.jetbrains.annotations.ApiStatus -import org.jetbrains.annotations.ApiStatus.ScheduledForRemoval import kotlin.random.Random class InlineCompletionRequest( @@ -97,7 +96,10 @@ interface InlineCompletionEvent { * * Use [ManualCall] instead as it guarantees that exactly your provider is going to be called. */ - class DirectCall @ApiStatus.Internal constructor( + class DirectCall + @Deprecated("This constructor is going to be internal. It should not be created outside of the platform.") + @ApiStatus.ScheduledForRemoval + constructor( val editor: Editor, val caret: Caret, val context: DataContext? = null, @@ -124,10 +126,10 @@ interface InlineCompletionEvent { * @param additionalData The data context for the call (not stable). */ @ApiStatus.Experimental - class ManualCall( + class ManualCall @ApiStatus.Experimental constructor( val editor: Editor, - @ApiStatus.Internal + @get:ApiStatus.Internal override val providerId: InlineCompletionProviderID, @ApiStatus.Experimental @@ -190,14 +192,13 @@ interface InlineCompletionEvent { * @param event The lookup event. */ class LookupChange @ApiStatus.Internal constructor( - @ApiStatus.Experimental + @get:ApiStatus.Experimental override val editor: Editor, override val event: LookupEvent, ) : InlineLookupEvent, Builtin { - @Deprecated("This event should not be created outside the platform.") - @ScheduledForRemoval - @ApiStatus.Internal + @Deprecated("It should not be created outside of the platform.") + @ApiStatus.ScheduledForRemoval constructor(event: LookupEvent) : this( runReadAction { event.lookup!!.editor }, event @@ -223,9 +224,8 @@ interface InlineCompletionEvent { override val event: LookupEvent ) : InlineLookupEvent, Builtin { - @Deprecated("This event should not be created outside the platform.") - @ScheduledForRemoval - @ApiStatus.Internal + @Deprecated("It should not be created outside of the platform.") + @ApiStatus.ScheduledForRemoval constructor(event: LookupEvent) : this( runReadAction { event.lookup!!.editor }, event