@@ -163,7 +163,8 @@ private class CompilationEnvironment(
163
163
configFiles = EnvironmentConfigFiles .JVM_CONFIG_FILES
164
164
)
165
165
166
- // TODO: Use environment.addKotlinSourceRoots(workspaceRoots) and update those instead of using a custom SourcePath/SourceFile mechanism
166
+ // TODO: Update VFS source files directly inside the environment instead of using a custom SourcePath/SourceFile mechanism
167
+ // environment.addKotlinSourceRoots(workspaceRoots.map { it.toFile() })
167
168
168
169
val project = environment.project
169
170
if (project is MockProject ) {
@@ -194,13 +195,14 @@ private class CompilationEnvironment(
194
195
fun createContainer (sourcePath : Collection <KtFile >): Pair <ComponentProvider , BindingTraceContext > {
195
196
val trace = CliBindingTrace ()
196
197
val container = TopDownAnalyzerFacadeForJVM .createContainer(
197
- project = environment.project,
198
- files = listOf (),
199
- trace = trace,
200
- configuration = environment.configuration,
201
- packagePartProvider = environment::createPackagePartProvider,
202
- // TODO FileBasedDeclarationProviderFactory keeps indices, re-use it across calls
203
- declarationProviderFactory = { storageManager, _ -> FileBasedDeclarationProviderFactory (storageManager, sourcePath) })
198
+ project = environment.project,
199
+ files = sourcePath,
200
+ trace = trace,
201
+ configuration = environment.configuration,
202
+ packagePartProvider = environment::createPackagePartProvider,
203
+ // TODO FileBasedDeclarationProviderFactory keeps indices, re-use it across calls
204
+ declarationProviderFactory = ::FileBasedDeclarationProviderFactory
205
+ )
204
206
return Pair (container, trace)
205
207
}
206
208
0 commit comments