mark CompletionPhase as sealed

GitOrigin-RevId: 9a04aa432d291a2adb19e7d71152eabbd2e02788
This commit is contained in:
Max Medvedev
2025-08-29 17:11:29 +00:00
committed by intellij-monorepo-bot
parent 409f85fe7d
commit 41ca07cf4c
@@ -53,7 +53,7 @@ import kotlin.math.max
* * [InsertedSingleItem] - a single item was found, and it was inserted into the document
* * [NoSuggestionsHint] - candidate inference has finished, but no candidates were found and a warning "no suggestions found" is shown.
*/
abstract class CompletionPhase @ApiStatus.Internal protected constructor(
sealed class CompletionPhase @ApiStatus.Internal constructor(
@JvmField
val indicator: CompletionProgressIndicator?
) : Disposable {
@@ -374,6 +374,16 @@ abstract class CompletionPhase @ApiStatus.Internal protected constructor(
}
}
private object NoCompletionImpl: CompletionPhase(null) {
override fun newCompletionStarted(time: Int, repeated: Boolean): Int {
return time
}
override fun toString(): String {
return "NoCompletion"
}
}
@ApiStatus.Internal
companion object {
@ApiStatus.Internal
@@ -385,15 +395,7 @@ abstract class CompletionPhase @ApiStatus.Internal protected constructor(
val CUSTOM_CODE_COMPLETION_ACTION_ID: Key<String> = Key.create("CodeCompletionActionID")
@JvmField
val NoCompletion: CompletionPhase = object : CompletionPhase(null) {
override fun newCompletionStarted(time: Int, repeated: Boolean): Int {
return time
}
override fun toString(): String {
return "NoCompletion"
}
}
val NoCompletion: CompletionPhase = NoCompletionImpl
}
}