[dap] LSP-335: Provide lsp server coroutine scope to the command handler

GitOrigin-RevId: d6e066b306414b9c16b19a306e55f00cca969419
This commit is contained in:
Nikolay Rykunov
2025-12-17 21:26:45 +00:00
committed by intellij-monorepo-bot
parent 94ce469337
commit f611a55f38
2 changed files with 4 additions and 2 deletions
@@ -34,12 +34,14 @@ interface LspHandlersBuilder {
class LspHandlerContext(
val lspClient: LspClient,
val lspScope: CoroutineScope,
)
context(context: LspHandlerContext)
val lspClient: LspClient get() = context.lspClient
context(context: LspHandlerContext)
val lspScope: CoroutineScope get() = context.lspScope
class LspRequestHandler<Params, Result, Error>(
val requestType: RequestType<Params, Result, Error>,
@@ -99,7 +99,7 @@ suspend fun withLsp(
}
}
val lspHandlerContext = LspHandlerContext(lspClient)
val lspHandlerContext = LspHandlerContext(lspClient, this)
launch(CoroutineName("incoming requests accepter") + createCoroutineContext(lspClient)) {
withSupervisor { supervisor ->