Skip to content

Commit 7f441c5

Browse files
authored
Merge pull request #23 from Kotlin/fix_spark_output
Fix jupyter-lab issue
2 parents 7c8188a + 3ee84d1 commit 7f441c5

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

src/main/kotlin/org/jetbrains/kotlin/jupyter/connection.kt

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class JupyterConnection(val config: KernelConfig): Closeable {
3131
connection.iopub.send(makeReplyMessage(msg, "status", content = jsonObject("execution_state" to status)))
3232
}
3333

34-
//fun send
3534
fun sendWrapped(incomingMessage: Message, msg: Message) {
3635
sendStatus("busy", incomingMessage)
3736
send(msg)

src/main/kotlin/org/jetbrains/kotlin/jupyter/protocol.kt

+16-10
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,22 @@ fun JupyterConnection.Socket.shellMessagesHandler(msg: Message, repl: ReplForJup
2525
when (msgType) {
2626
"kernel_info_request" ->
2727
sendWrapped(msg, makeReplyMessage(msg, "kernel_info_reply",
28-
content = jsonObject(
29-
"protocol_version" to protocolVersion,
30-
"language" to "Kotlin",
31-
"language_version" to KotlinCompilerVersion.VERSION,
32-
"language_info" to jsonObject(
33-
"name" to "kotlin",
34-
"codemirror_mode" to "text/x-kotlin",
35-
"file_extension" to "kt"
36-
)
37-
)))
28+
content = jsonObject(
29+
"protocol_version" to protocolVersion,
30+
"language" to "Kotlin",
31+
"language_version" to KotlinCompilerVersion.VERSION,
32+
"language_info" to jsonObject(
33+
"name" to "kotlin",
34+
"codemirror_mode" to "text/x-kotlin",
35+
"file_extension" to "kt"
36+
),
37+
38+
// Jupyter lab Console support
39+
"banner" to "Kotlin language, version ${KotlinCompilerVersion.VERSION}",
40+
"implementation" to "Kotlin",
41+
"implementation_version" to KotlinCompilerVersion.VERSION,
42+
"status" to "ok"
43+
)))
3844
"history_request" ->
3945
sendWrapped(msg, makeReplyMessage(msg, "history_reply",
4046
content = jsonObject(

0 commit comments

Comments
 (0)