From 4580cca2e5d0872e7fee9962c7ccdf23c4b38643 Mon Sep 17 00:00:00 2001 From: "Alexander.Kirsanov" Date: Sat, 20 May 2023 20:54:20 +0200 Subject: [PATCH] [rdct] Pass session to toolwindows, introduce an overload for getting project-level sessions from app-level ones GitOrigin-RevId: 21c741149128341ed046840562f6c5b1e66daf1e --- .../intellij/openapi/client/ClientSessionsManager.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/client/ClientSessionsManager.kt b/platform/platform-impl/src/com/intellij/openapi/client/ClientSessionsManager.kt index dab474b1ab72..ade06a8d7c7e 100644 --- a/platform/platform-impl/src/com/intellij/openapi/client/ClientSessionsManager.kt +++ b/platform/platform-impl/src/com/intellij/openapi/client/ClientSessionsManager.kt @@ -17,9 +17,18 @@ import java.util.concurrent.ConcurrentHashMap @ApiStatus.Internal sealed class ClientSessionsManager { companion object { + + /** + * @return a project session for specified app-level session + */ + @JvmStatic + fun getProjectSession(project: Project, session: ClientAppSession): ClientProjectSession? { + return getInstance(project).getSession(session.clientId) + } + /** * Returns a project-level session for a particular client. - * @see ClientSession + * @see ClientProjectSession */ @JvmStatic @JvmOverloads