@@ -164,13 +164,6 @@ private class CompilationEnvironment(
164
164
configFiles = EnvironmentConfigFiles .JVM_CONFIG_FILES
165
165
)
166
166
167
- // TODO: Update VFS source files dynamically inside the environment using updateClasspath
168
- // and use VirtualFileManager.getInstance instead of using a custom SourcePath/SourceFile mechanism.
169
- // Documentation on the VFS is available here: https://www.jetbrains.org/intellij/sdk/docs/basics/architectural_overview/virtual_file.html
170
- // Virtual files can be manipulated using input-/output-stream-writers. Note that each virtual file has an associated charset.
171
-
172
- // environment.addKotlinSourceRoots(workspaceRoots.map { it.toFile() })
173
-
174
167
val project = environment.project
175
168
if (project is MockProject ) {
176
169
project.registerService(NullableNotNullManager ::class .java, KotlinNullableNotNullManager (project))
@@ -231,12 +224,12 @@ enum class CompilationKind {
231
224
* Incrementally compiles files and expressions.
232
225
* The basic strategy for compiling one file at-a-time is outlined in OneFilePerformance.
233
226
*/
234
- class Compiler (workspaceRoots : Set <Path >, classPath : Set <Path >, buildScriptClassPath : Set <Path > = emptySet()) : Closeable {
227
+ class Compiler (javaSourcePath : Set <Path >, classPath : Set <Path >, buildScriptClassPath : Set <Path > = emptySet()) : Closeable {
235
228
private var closed = false
236
229
private val localFileSystem: VirtualFileSystem
237
230
238
- private val defaultCompileEnvironment = CompilationEnvironment (workspaceRoots , classPath)
239
- private val buildScriptCompileEnvironment = buildScriptClassPath.takeIf { it.isNotEmpty() }?.let { CompilationEnvironment (workspaceRoots , it) }
231
+ private val defaultCompileEnvironment = CompilationEnvironment (javaSourcePath , classPath)
232
+ private val buildScriptCompileEnvironment = buildScriptClassPath.takeIf { it.isNotEmpty() }?.let { CompilationEnvironment (emptySet() , it) }
240
233
private val compileLock = ReentrantLock () // TODO: Lock at file-level
241
234
242
235
companion object {
0 commit comments