Fix imported script functionality in JSR-223/REPL:
- setup compilation properly to take imported scripts into account - add compiled imported scripts into generated results = calculate ScriptLightVirtualFile path as relative - simplifies imported scripts location
This commit is contained in:
+2
-2
@@ -30,7 +30,6 @@ import kotlin.script.experimental.dependencies.ScriptDependencies
|
||||
import kotlin.script.experimental.host.*
|
||||
import kotlin.script.experimental.jvm.*
|
||||
import kotlin.script.experimental.jvm.compat.mapToDiagnostics
|
||||
import kotlin.script.experimental.jvm.impl.refineWith
|
||||
import kotlin.script.experimental.jvm.impl.toClassPathOrEmpty
|
||||
import kotlin.script.experimental.jvm.impl.toDependencies
|
||||
|
||||
@@ -97,7 +96,8 @@ class ScriptLightVirtualFile(name: String, private val _path: String?, text: Str
|
||||
charset = CharsetToolkit.UTF8_CHARSET
|
||||
}
|
||||
|
||||
override fun getPath(): String = _path ?: super.getPath()
|
||||
override fun getPath(): String = _path ?: if (parent != null) parent.path + "/" + name else name
|
||||
|
||||
override fun getCanonicalPath(): String? = path
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user