@@ -29,7 +29,6 @@ import org.jetbrains.kotlinx.jupyter.compiler.ScriptImportsCollector
29
29
import org.jetbrains.kotlinx.jupyter.compiler.util.Classpath
30
30
import org.jetbrains.kotlinx.jupyter.compiler.util.EvaluatedSnippetMetadata
31
31
import org.jetbrains.kotlinx.jupyter.compiler.util.SerializedCompiledScriptsData
32
- import org.jetbrains.kotlinx.jupyter.compiler.util.SerializedVariablesState
33
32
import org.jetbrains.kotlinx.jupyter.config.catchAll
34
33
import org.jetbrains.kotlinx.jupyter.config.getCompilationConfiguration
35
34
import org.jetbrains.kotlinx.jupyter.dependencies.JupyterScriptDependenciesResolverImpl
@@ -150,6 +149,8 @@ interface ReplForJupyter {
150
149
151
150
val notebook: NotebookImpl
152
151
152
+ val variablesSerializer: VariablesSerializer
153
+
153
154
val fileExtension: String
154
155
155
156
val isEmbedded: Boolean
@@ -201,7 +202,9 @@ class ReplForJupyterImpl(
201
202
202
203
override val notebook = NotebookImpl (runtimeProperties)
203
204
204
- val librariesScanner = LibrariesScanner (notebook)
205
+ override val variablesSerializer = VariablesSerializer ()
206
+
207
+ private val librariesScanner = LibrariesScanner (notebook)
205
208
private val resourcesProcessor = LibraryResourcesProcessorImpl ()
206
209
207
210
override var outputConfig
@@ -442,13 +445,21 @@ class ReplForJupyterImpl(
442
445
updateClasspath()
443
446
} ? : emptyList()
444
447
448
+ notebook.updateVariablesState(internalEvaluator)
449
+ // printVars()
450
+ // printUsagesInfo(jupyterId, cellVariables[jupyterId - 1])
451
+ val entry = notebook.variablesState.entries.lastOrNull()
452
+ val serializedVarsState = variablesSerializer.serializeVariableState(jupyterId - 1 , entry?.key, entry?.value)
453
+ val serializedData = variablesSerializer.serializeVariables(jupyterId - 1 , notebook.variablesState)
454
+
455
+
445
456
val variablesStateUpdate = notebook.variablesState.mapValues { " " }
446
457
EvalResultEx (
447
458
result.result.value,
448
459
rendered,
449
460
result.scriptInstance,
450
461
result.result.name,
451
- EvaluatedSnippetMetadata (newClasspath, compiledData, newImports, SerializedVariablesState () ),
462
+ EvaluatedSnippetMetadata (newClasspath, compiledData, newImports, serializedData ),
452
463
)
453
464
}
454
465
}
0 commit comments