@@ -27,7 +27,6 @@ import org.jetbrains.kotlinx.jupyter.compiler.ScriptImportsCollector
27
27
import org.jetbrains.kotlinx.jupyter.compiler.util.Classpath
28
28
import org.jetbrains.kotlinx.jupyter.compiler.util.EvaluatedSnippetMetadata
29
29
import org.jetbrains.kotlinx.jupyter.compiler.util.SerializedCompiledScriptsData
30
- import org.jetbrains.kotlinx.jupyter.compiler.util.SerializedVariablesState
31
30
import org.jetbrains.kotlinx.jupyter.config.catchAll
32
31
import org.jetbrains.kotlinx.jupyter.config.getCompilationConfiguration
33
32
import org.jetbrains.kotlinx.jupyter.dependencies.JupyterScriptDependenciesResolverImpl
@@ -134,6 +133,8 @@ interface ReplForJupyter {
134
133
135
134
val notebook: NotebookImpl
136
135
136
+ val variablesSerializer: VariablesSerializer
137
+
137
138
val fileExtension: String
138
139
139
140
val isEmbedded: Boolean
@@ -185,7 +186,9 @@ class ReplForJupyterImpl(
185
186
186
187
override val notebook = NotebookImpl (runtimeProperties)
187
188
188
- val librariesScanner = LibrariesScanner (notebook)
189
+ override val variablesSerializer = VariablesSerializer ()
190
+
191
+ private val librariesScanner = LibrariesScanner (notebook)
189
192
private val resourcesProcessor = LibraryResourcesProcessorImpl ()
190
193
191
194
override var outputConfig
@@ -418,6 +421,9 @@ class ReplForJupyterImpl(
418
421
notebook.updateVariablesState(internalEvaluator)
419
422
// printVars()
420
423
// printUsagesInfo(jupyterId, cellVariables[jupyterId - 1])
424
+ val entry = notebook.variablesState.entries.lastOrNull()
425
+ val serializedVarsState = variablesSerializer.serializeVariableState(jupyterId - 1 , entry?.key, entry?.value)
426
+ val serializedData = variablesSerializer.serializeVariables(jupyterId - 1 , notebook.variablesState)
421
427
422
428
423
429
val variablesStateUpdate = notebook.variablesState.mapValues { " " }
@@ -426,7 +432,7 @@ class ReplForJupyterImpl(
426
432
rendered,
427
433
result.scriptInstance,
428
434
result.result.name,
429
- EvaluatedSnippetMetadata (newClasspath, compiledData, newImports, SerializedVariablesState () ),
435
+ EvaluatedSnippetMetadata (newClasspath, compiledData, newImports, serializedData ),
430
436
)
431
437
}
432
438
}
0 commit comments