Put lines history into all data structures returned by repl, refactor storage and passing of the history for that

This commit is contained in:
Ilya Chernikov
2016-11-21 19:16:55 +01:00
parent 125cc6ebfb
commit 7a79fff9d6
12 changed files with 156 additions and 84 deletions
@@ -67,7 +67,7 @@ class KotlinJsr223JvmScriptEngine4Idea(
// TODO: bindings passing works only once on the first eval, subsequent setContext/setBindings call have no effect. Consider making it dynamic, but take history into account
val localEvaluator by lazy { GenericReplCompiledEvaluator(templateClasspath, Thread.currentThread().contextClassLoader, getScriptArgs(getContext()), scriptArgsTypes) }
override fun eval(codeLine: ReplCodeLine, history: Iterable<ReplCodeLine>): ReplEvalResult {
override fun eval(codeLine: ReplCodeLine, history: List<ReplCodeLine>): ReplEvalResult {
fun ReplCompileResult.Error.locationString() =
if (location == CompilerMessageLocation.NO_LOCATION) ""
@@ -81,6 +81,6 @@ class KotlinJsr223JvmScriptEngine4Idea(
is ReplCompileResult.CompiledClasses -> compileResult
}
return localEvaluator.eval(codeLine, history, compiled.classes, compiled.hasResult, compiled.newClasspath)
return localEvaluator.eval(codeLine, history, compiled.classes, compiled.hasResult, compiled.classpathAddendum)
}
}