Skip to content

Commit

Permalink
Replace namedChildSCope with childScope
Browse files Browse the repository at this point in the history
  • Loading branch information
DenWav committed Aug 4, 2024
1 parent 5a17d89 commit ab0ec84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/creator/custom/CreatorContext.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}
5 changes: 2 additions & 3 deletions src/main/kotlin/creator/custom/TemplateService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 {

Expand Down

0 comments on commit ab0ec84

Please sign in to comment.