mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[docker] IJPL-218299 Docker Settings: restore connection options by providing ModalityState in EDT context
DockerBinaryPathsProvider's `SuspendingLazy` (`dockerPath`) was created on `Dispatchers.EDT` without a `ModalityState` context element, which prevented the computation from starting. As a result, the Docker connection dialog showed only "Loading..." with no fields. Use `currentCoroutineDispatchingContext()` (EDT + proper `ModalityState`) when creating the `SuspendingLazy` both for the local `dockerPath` and the autodetected/remote path cache. Initialize the lazy in `init()`. This unblocks `dockerPath` detection and restores the connection options UI. GitOrigin-RevId: e1d07dd85f8475f90bd918bcd49c511619196e64
This commit is contained in:
committed by
intellij-monorepo-bot
parent
9fad32720c
commit
77ce0f8ed2
@@ -1,10 +1,19 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.platform.ijent
|
||||
|
||||
import com.intellij.openapi.application.contextModality
|
||||
import kotlinx.coroutines.CoroutineDispatcher
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.currentCoroutineContext
|
||||
import kotlin.coroutines.CoroutineContext
|
||||
|
||||
suspend fun currentCoroutineDispatchingContext(): CoroutineContext {
|
||||
val currentCoroutineContext = currentCoroutineContext()
|
||||
val currentCoroutineDispatcher = currentCoroutineDispatcher()
|
||||
val currentContextModality = currentCoroutineContext.contextModality()
|
||||
return if (currentContextModality != null) currentCoroutineDispatcher + currentCoroutineContext else currentCoroutineDispatcher
|
||||
}
|
||||
|
||||
suspend fun currentCoroutineDispatcher(): CoroutineDispatcher {
|
||||
return currentCoroutineContext()[CoroutineDispatcher] ?: Dispatchers.Default
|
||||
|
||||
Reference in New Issue
Block a user