File tree Expand file tree Collapse file tree 2 files changed +23
-11
lines changed
src/com/jetbrains/ls/kotlinLsp
test/com/jetbrains/ls/kotlinLsp Expand file tree Collapse file tree 2 files changed +23
-11
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import java.nio.file.Path
1010
1111data class KotlinLspServerRunConfig (
1212 val mode : KotlinLspServerMode ,
13- val systemPath : Path ? = null ,
13+ val systemPath : Path ? ,
1414)
1515
1616sealed interface KotlinLspServerMode {
@@ -79,17 +79,20 @@ private fun String.toSocketConfig(): SocketConfig {
7979 return SocketConfig (host, port)
8080}
8181
82- fun KotlinLspServerRunConfig.toArguments (): List <String > =
82+ fun KotlinLspServerRunConfig.toArguments (): List <String > = buildList {
8383 when (mode) {
84- is KotlinLspServerMode .Stdio -> listOf (" --stdio" )
84+ is KotlinLspServerMode .Stdio -> add (" --stdio" )
8585 is KotlinLspServerMode .Socket -> when (val tcpConfig = mode.config) {
86- is TcpConnectionConfig .Client -> buildList {
86+ is TcpConnectionConfig .Client -> {
8787 add(" --client" )
8888 add(" --socket=${tcpConfig.host} :${tcpConfig.port} " )
8989 }
90- is TcpConnectionConfig .Server -> buildList {
90+
91+ is TcpConnectionConfig .Server -> {
9192 add(" --socket=${tcpConfig.host} :${tcpConfig.port} " )
9293 if (tcpConfig.isMultiClient) add(" --multi-client" )
9394 }
9495 }
95- }
96+ }
97+ if (systemPath != null ) add(" --system-path=$systemPath " )
98+ }
Original file line number Diff line number Diff line change @@ -4,18 +4,25 @@ package com.jetbrains.ls.kotlinLsp
44import com.jetbrains.lsp.implementation.TcpConnectionConfig
55import org.junit.jupiter.api.Assertions
66import org.junit.jupiter.api.Test
7+ import java.nio.file.Paths
78
89
910class KotlinLspServerRunConfigKtTest {
1011 @Test
1112 fun `stdio` () {
12- doConsistencyTest(KotlinLspServerRunConfig (KotlinLspServerMode .Stdio ))
13+ doConsistencyTest(KotlinLspServerRunConfig (KotlinLspServerMode .Stdio , systemPath = null ))
1314 }
1415
1516 @Test
1617 fun `tcp client` () {
17- doConsistencyTest(KotlinLspServerRunConfig (KotlinLspServerMode .Socket (
18- TcpConnectionConfig .Client (host = " 127.0.0.1" , port = 9999 ))))
18+ doConsistencyTest(
19+ KotlinLspServerRunConfig (
20+ KotlinLspServerMode .Socket (
21+ TcpConnectionConfig .Client (host = " 127.0.0.1" , port = 9999 )
22+ ),
23+ systemPath = Paths .get(" /path/to/system" ),
24+ )
25+ )
1926 }
2027
2128 @Test
@@ -28,7 +35,8 @@ class KotlinLspServerRunConfigKtTest {
2835 port = 9999 ,
2936 isMultiClient = false
3037 )
31- )
38+ ),
39+ systemPath = Paths .get(" /path/to/system" ),
3240 )
3341 )
3442 }
@@ -43,7 +51,8 @@ class KotlinLspServerRunConfigKtTest {
4351 port = 9999 ,
4452 isMultiClient = true
4553 )
46- )
54+ ),
55+ systemPath = null ,
4756 )
4857 )
4958 }
You can’t perform that action at this time.
0 commit comments