@@ -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
@@ -143,6 +142,8 @@ interface ReplForJupyter {
143
142
144
143
val notebook: NotebookImpl
145
144
145
+ val variablesSerializer: VariablesSerializer
146
+
146
147
val fileExtension: String
147
148
148
149
val isEmbedded: Boolean
@@ -194,7 +195,9 @@ class ReplForJupyterImpl(
194
195
195
196
override val notebook = NotebookImpl (runtimeProperties)
196
197
197
- val librariesScanner = LibrariesScanner (notebook)
198
+ override val variablesSerializer = VariablesSerializer ()
199
+
200
+ private val librariesScanner = LibrariesScanner (notebook)
198
201
private val resourcesProcessor = LibraryResourcesProcessorImpl ()
199
202
200
203
override var outputConfig
@@ -429,6 +432,9 @@ class ReplForJupyterImpl(
429
432
notebook.updateVariablesState(internalEvaluator)
430
433
// printVars()
431
434
// printUsagesInfo(jupyterId, cellVariables[jupyterId - 1])
435
+ val entry = notebook.variablesState.entries.lastOrNull()
436
+ val serializedVarsState = variablesSerializer.serializeVariableState(jupyterId - 1 , entry?.key, entry?.value)
437
+ val serializedData = variablesSerializer.serializeVariables(jupyterId - 1 , notebook.variablesState)
432
438
433
439
434
440
val variablesStateUpdate = notebook.variablesState.mapValues { " " }
@@ -437,7 +443,7 @@ class ReplForJupyterImpl(
437
443
rendered,
438
444
result.scriptInstance,
439
445
result.result.name,
440
- EvaluatedSnippetMetadata (newClasspath, compiledData, newImports, SerializedVariablesState () ),
446
+ EvaluatedSnippetMetadata (newClasspath, compiledData, newImports, serializedData ),
441
447
)
442
448
}
443
449
}
0 commit comments