Skip to content

Commit fe996b7

Browse files
darthorimarintellij-monorepo-bot
authored andcommitted
[lsp] implement integration tests for standalone kotlin lsp
^LSP-166 fixed GitOrigin-RevId: 44330d861a1a0f87eb0d24f4919184bedf1bdb83
1 parent c9d7915 commit fe996b7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

kotlin-lsp/src/com/jetbrains/ls/kotlinLsp/KotlinLspServerRunConfig.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,13 @@ sealed interface KotlinLspServerMode {
1111

1212
data class Socket(val config: TcpConnectionConfig) : KotlinLspServerMode
1313
}
14+
15+
16+
fun KotlinLspServerRunConfig.toArguments(): List<String> =
17+
when (mode) {
18+
is KotlinLspServerMode.Stdio -> listOf("--stdio")
19+
is KotlinLspServerMode.Socket -> when (val tcpConfig = mode.config) {
20+
is TcpConnectionConfig.Client -> listOf("--client", "--socket=${tcpConfig.port}")
21+
is TcpConnectionConfig.Server -> listOf("--socket=${tcpConfig.port}")
22+
}
23+
}

0 commit comments

Comments
 (0)