Skip to content

Commit

Permalink
Merge pull request #23 from Kotlin/fix_spark_output
Browse files Browse the repository at this point in the history
Fix jupyter-lab issue
  • Loading branch information
nikitinas authored Dec 3, 2019
2 parents 7c8188a + 3ee84d1 commit 7f441c5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/main/kotlin/org/jetbrains/kotlin/jupyter/connection.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class JupyterConnection(val config: KernelConfig): Closeable {
connection.iopub.send(makeReplyMessage(msg, "status", content = jsonObject("execution_state" to status)))
}

//fun send
fun sendWrapped(incomingMessage: Message, msg: Message) {
sendStatus("busy", incomingMessage)
send(msg)
Expand Down
26 changes: 16 additions & 10 deletions src/main/kotlin/org/jetbrains/kotlin/jupyter/protocol.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,22 @@ fun JupyterConnection.Socket.shellMessagesHandler(msg: Message, repl: ReplForJup
when (msgType) {
"kernel_info_request" ->
sendWrapped(msg, makeReplyMessage(msg, "kernel_info_reply",
content = jsonObject(
"protocol_version" to protocolVersion,
"language" to "Kotlin",
"language_version" to KotlinCompilerVersion.VERSION,
"language_info" to jsonObject(
"name" to "kotlin",
"codemirror_mode" to "text/x-kotlin",
"file_extension" to "kt"
)
)))
content = jsonObject(
"protocol_version" to protocolVersion,
"language" to "Kotlin",
"language_version" to KotlinCompilerVersion.VERSION,
"language_info" to jsonObject(
"name" to "kotlin",
"codemirror_mode" to "text/x-kotlin",
"file_extension" to "kt"
),

// Jupyter lab Console support
"banner" to "Kotlin language, version ${KotlinCompilerVersion.VERSION}",
"implementation" to "Kotlin",
"implementation_version" to KotlinCompilerVersion.VERSION,
"status" to "ok"
)))
"history_request" ->
sendWrapped(msg, makeReplyMessage(msg, "history_reply",
content = jsonObject(
Expand Down

0 comments on commit 7f441c5

Please sign in to comment.