Introduce LocalDescriptorResolver which handles differences in local declaration resolution between compiler and ide environments

This commit is contained in:
Pavel V. Talanov
2015-07-24 18:56:06 +03:00
parent 2ef5e03f27
commit 52bc84cb5f
13 changed files with 149 additions and 25 deletions
@@ -35,6 +35,7 @@ import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.resolve.CompilerEnvironment
import org.jetbrains.kotlin.resolve.descriptorUtil.classId
import org.jetbrains.kotlin.resolve.jvm.JvmAnalyzerFacade
import org.jetbrains.kotlin.resolve.jvm.JvmPlatformParameters
@@ -88,7 +89,8 @@ public class BuiltInsSerializer(private val dependOnOldBuiltIns: Boolean) {
val resolver = JvmAnalyzerFacade.setupResolverForProject(
ProjectContext(environment.project), listOf(builtInModule),
{ ModuleContent(files, GlobalSearchScope.EMPTY_SCOPE) },
platformParameters = JvmPlatformParameters { throw IllegalStateException() }
JvmPlatformParameters { throw IllegalStateException() },
CompilerEnvironment
)
val moduleDescriptor = resolver.descriptorForModule(builtInModule)