Skip to content

Commit 1b2d546

Browse files
committed
refactor: rename WS completion request dto
1 parent 4689d59 commit 1b2d546

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

completions/src/main/kotlin/completions/controllers/ws/LspCompletionWebSocketHandler.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,16 @@ class LspCompletionWebSocketHandler(
8080
}.getOrElse { Response.Error("LSP not available: ${it.message}") }
8181
}.subscribeOn(Schedulers.boundedElastic())
8282

83-
private fun getCompletionRequests(session: WebSocketSession, sideSink: Sinks.Many<Response>): Flux<CompletionRequest> =
83+
private fun getCompletionRequests(session: WebSocketSession, sideSink: Sinks.Many<Response>): Flux<WebSocketCompletionRequest> =
8484
session.receive()
8585
.map { it.payloadAsText }
8686
.onBackpressureDrop { dropped ->
87-
runCatching { objectMapper.readValue<CompletionRequest>(dropped) }.onSuccess {
87+
runCatching { objectMapper.readValue<WebSocketCompletionRequest>(dropped) }.onSuccess {
8888
sideSink.tryEmitNext(Response.Discarded(it.requestId))
8989
}
9090
}
9191
.flatMap({ payload ->
92-
val req = runCatching { objectMapper.readValue<CompletionRequest>(payload) }.getOrNull()
92+
val req = runCatching { objectMapper.readValue<WebSocketCompletionRequest>(payload) }.getOrNull()
9393
if (req == null) {
9494
sideSink.tryEmitNext(Response.Error("Failed to parse request: $payload"))
9595
Mono.empty()
@@ -98,7 +98,7 @@ class LspCompletionWebSocketHandler(
9898
}
9999
}, 1)
100100

101-
private fun handleCompletionRequest(sessionId: String, requests: Flux<CompletionRequest>): Flux<Response> =
101+
private fun handleCompletionRequest(sessionId: String, requests: Flux<WebSocketCompletionRequest>): Flux<Response> =
102102
requests
103103
.concatMap({ request ->
104104
mono {
@@ -148,7 +148,7 @@ sealed interface Response {
148148
data class Discarded(override val requestId: String) : Error("discarded", requestId)
149149
}
150150

151-
private data class CompletionRequest(
151+
private data class WebSocketCompletionRequest(
152152
val requestId: String,
153153
val project: Project,
154154
val line: Int,

0 commit comments

Comments
 (0)