Switch to templates in the separate script runtime
This commit is contained in:
@@ -70,7 +70,7 @@ class KotlinConsoleKeeper(val project: Project) {
|
||||
//paramList.add("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005")
|
||||
|
||||
val kotlinPaths = PathUtil.getKotlinPathsForIdeaPlugin()
|
||||
val replClassPath = listOf(kotlinPaths.compilerPath, kotlinPaths.reflectPath, kotlinPaths.runtimePath)
|
||||
val replClassPath = listOf(kotlinPaths.compilerPath, kotlinPaths.reflectPath, kotlinPaths.runtimePath, kotlinPaths.scriptRuntimePath)
|
||||
.map { it.absolutePath }
|
||||
.joinToString(File.pathSeparator)
|
||||
|
||||
|
||||
+4
-8
@@ -29,13 +29,9 @@ class KotlinJsr223StandardScriptEngineFactory4Idea : KotlinJsr223JvmScriptEngine
|
||||
KotlinJsr223JvmScriptEngine4Idea(
|
||||
Disposer.newDisposable(),
|
||||
this,
|
||||
listOf(PathUtil.getKotlinPathsForIdeaPlugin().runtimePath),
|
||||
"kotlin.script.ScriptTemplateWithArgsAndBindings",
|
||||
{ ctx ->
|
||||
val bindings = ctx.getBindings(ScriptContext.ENGINE_SCOPE)
|
||||
arrayOf(
|
||||
(bindings[ScriptEngine.ARGV] as? Array<*>) ?: emptyArray<String>(),
|
||||
bindings) },
|
||||
arrayOf(Array<String>::class.java, Map::class.java)
|
||||
listOf(PathUtil.getKotlinPathsForIdeaPlugin().runtimePath, PathUtil.getKotlinPathsForIdeaPlugin().scriptRuntimePath),
|
||||
"kotlin.script.templates.standard.ScriptTemplateWithBindings",
|
||||
{ ctx -> arrayOf(ctx.getBindings(ScriptContext.ENGINE_SCOPE)) },
|
||||
arrayOf(Map::class.java)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user