From 77ce0f8ed29ebfb02b508c59dea619a42bdf3a50 Mon Sep 17 00:00:00 2001 From: Alexander Koshevoy Date: Wed, 19 Nov 2025 23:54:01 +0100 Subject: [PATCH] [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 --- platform/ijent/src/com/intellij/platform/ijent/util.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/platform/ijent/src/com/intellij/platform/ijent/util.kt b/platform/ijent/src/com/intellij/platform/ijent/util.kt index f90d5733de57..69ce58d7a0e9 100644 --- a/platform/ijent/src/com/intellij/platform/ijent/util.kt +++ b/platform/ijent/src/com/intellij/platform/ijent/util.kt @@ -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