From ab0ec84950e6d2f6bf7e597ba17d3ff81c62f506 Mon Sep 17 00:00:00 2001 From: Kyle Wood Date: Sat, 3 Aug 2024 22:26:17 -0500 Subject: [PATCH] Replace namedChildSCope with childScope --- src/main/kotlin/creator/custom/CreatorContext.kt | 4 ++-- src/main/kotlin/creator/custom/TemplateService.kt | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/creator/custom/CreatorContext.kt b/src/main/kotlin/creator/custom/CreatorContext.kt index 61f8b160f..0f3487225 100644 --- a/src/main/kotlin/creator/custom/CreatorContext.kt +++ b/src/main/kotlin/creator/custom/CreatorContext.kt @@ -27,7 +27,7 @@ import com.intellij.openapi.application.EDT import com.intellij.openapi.application.ModalityState import com.intellij.openapi.application.asContextElement import com.intellij.openapi.observable.properties.PropertyGraph -import com.intellij.platform.util.coroutines.namedChildScope +import com.intellij.platform.util.coroutines.childScope import kotlin.coroutines.CoroutineContext import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -53,5 +53,5 @@ data class CreatorContext( /** * A general purpose scope dependent of the main creator scope, cancelled when the creator is closed. */ - fun childScope(name: String): CoroutineScope = scope.namedChildScope(name) + fun childScope(name: String): CoroutineScope = scope.childScope(name) } diff --git a/src/main/kotlin/creator/custom/TemplateService.kt b/src/main/kotlin/creator/custom/TemplateService.kt index 1476defa4..b028a32cf 100644 --- a/src/main/kotlin/creator/custom/TemplateService.kt +++ b/src/main/kotlin/creator/custom/TemplateService.kt @@ -25,7 +25,7 @@ import com.intellij.openapi.components.service import com.intellij.openapi.diagnostic.thisLogger import com.intellij.openapi.project.Project import com.intellij.openapi.startup.ProjectActivity -import com.intellij.platform.util.coroutines.namedChildScope +import com.intellij.platform.util.coroutines.childScope import com.intellij.util.application import kotlinx.coroutines.CoroutineScope @@ -47,8 +47,7 @@ class TemplateService(private val scope: CoroutineScope) { pendingActions.remove(project.locationHash)?.invoke() } - @Suppress("UnstableApiUsage") // namedChildScope is Internal right now but has been promoted to Stable in 2024.2 - fun scope(name: String): CoroutineScope = scope.namedChildScope(name) + fun scope(name: String): CoroutineScope = scope.childScope(name) companion object {