Use ModuleInfo in VirtualFileFinder to add script dependencies in search scope
Otherwise it prevent to inline functions from those dependencies during scratch compilation
This commit is contained in:
@@ -16,12 +16,17 @@
|
||||
|
||||
package org.jetbrains.kotlin.cli.jvm.compiler
|
||||
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.psi.search.GlobalSearchScope
|
||||
import org.jetbrains.kotlin.cli.jvm.index.JvmDependenciesIndex
|
||||
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
|
||||
import org.jetbrains.kotlin.load.kotlin.VirtualFileFinder
|
||||
import org.jetbrains.kotlin.load.kotlin.VirtualFileFinderFactory
|
||||
|
||||
// TODO: create different JvmDependenciesIndex instances for different sets of source roots to improve performance
|
||||
class CliVirtualFileFinderFactory(private val index: JvmDependenciesIndex) : VirtualFileFinderFactory {
|
||||
override fun create(scope: GlobalSearchScope): VirtualFileFinder = CliVirtualFileFinder(index, scope)
|
||||
|
||||
override fun create(project: Project, module: ModuleDescriptor): VirtualFileFinder =
|
||||
CliVirtualFileFinder(index, GlobalSearchScope.allScope(project))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user