Rename PlatformDependentCompilerServices -> PlatformDependentAnalyzerServices
This commit is contained in:
+7
-7
@@ -22,8 +22,8 @@ import com.intellij.psi.search.GlobalSearchScope
|
||||
import org.jetbrains.kotlin.analyzer.*
|
||||
import org.jetbrains.kotlin.config.LanguageFeature
|
||||
import org.jetbrains.kotlin.config.LanguageVersionSettings
|
||||
import org.jetbrains.kotlin.platform.TargetPlatformVersion
|
||||
import org.jetbrains.kotlin.container.StorageComponentContainer
|
||||
import org.jetbrains.kotlin.platform.TargetPlatformVersion
|
||||
import org.jetbrains.kotlin.container.get
|
||||
import org.jetbrains.kotlin.context.ModuleContext
|
||||
import org.jetbrains.kotlin.context.ProjectContext
|
||||
@@ -69,8 +69,8 @@ object CommonResolverForModuleFactory : ResolverForModuleFactory() {
|
||||
override val platform: TargetPlatform
|
||||
get() = CommonPlatforms.defaultCommonPlatform
|
||||
|
||||
override val compilerServices: PlatformDependentCompilerServices
|
||||
get() = CommonPlatformCompilerServices
|
||||
override val analyzerServices: PlatformDependentAnalyzerServices
|
||||
get() = CommonPlatformAnalyzerServices
|
||||
}
|
||||
|
||||
fun analyzeFiles(
|
||||
@@ -138,7 +138,7 @@ object CommonResolverForModuleFactory : ResolverForModuleFactory() {
|
||||
val trace = CodeAnalyzerInitializer.getInstance(project).createTrace()
|
||||
val container = createContainerToResolveCommonCode(
|
||||
moduleContext, trace, declarationProviderFactory, moduleContentScope, targetEnvironment, metadataPartProvider,
|
||||
languageVersionSettings, CommonPlatforms.defaultCommonPlatform, CommonPlatformCompilerServices
|
||||
languageVersionSettings, CommonPlatforms.defaultCommonPlatform, CommonPlatformAnalyzerServices
|
||||
)
|
||||
|
||||
val packageFragmentProviders = listOf(
|
||||
@@ -159,10 +159,10 @@ private fun createContainerToResolveCommonCode(
|
||||
metadataPartProvider: MetadataPartProvider,
|
||||
languageVersionSettings: LanguageVersionSettings,
|
||||
platform: TargetPlatform,
|
||||
compilerServices: PlatformDependentCompilerServices
|
||||
analyzerServices: PlatformDependentAnalyzerServices
|
||||
): StorageComponentContainer =
|
||||
createContainer("ResolveCommonCode", compilerServices) {
|
||||
configureModule(moduleContext, platform, compilerServices, bindingTrace, languageVersionSettings)
|
||||
createContainer("ResolveCommonCode", analyzerServices) {
|
||||
configureModule(moduleContext, platform, analyzerServices, bindingTrace, languageVersionSettings)
|
||||
|
||||
useInstance(moduleContentScope)
|
||||
useInstance(declarationProviderFactory)
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ class FirDefaultSimpleImportingScope(session: FirSession) : FirAbstractSimpleImp
|
||||
|
||||
override val simpleImports = run {
|
||||
val importResolveTransformer = FirImportResolveTransformer(session)
|
||||
session.moduleInfo?.compilerServices?.getDefaultImports(LanguageVersionSettingsImpl.DEFAULT, true)
|
||||
session.moduleInfo?.analyzerServices?.getDefaultImports(LanguageVersionSettingsImpl.DEFAULT, true)
|
||||
?.filter { !it.isAllUnder }
|
||||
?.map {
|
||||
FirImportImpl(session, null, it.fqName, isAllUnder = false, aliasName = null)
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ class FirDefaultStarImportingScope(session: FirSession, lookupInFir: Boolean = f
|
||||
FirAbstractStarImportingScope(session, lookupInFir) {
|
||||
|
||||
// TODO: put languageVersionSettings into FirSession?
|
||||
override val starImports = session.moduleInfo?.compilerServices?.getDefaultImports(LanguageVersionSettingsImpl.DEFAULT, true)
|
||||
override val starImports = session.moduleInfo?.analyzerServices?.getDefaultImports(LanguageVersionSettingsImpl.DEFAULT, true)
|
||||
?.filter { it.isAllUnder }
|
||||
?.map {
|
||||
FirResolvedImportImpl(
|
||||
|
||||
+6
-6
@@ -27,8 +27,8 @@ import org.jetbrains.kotlin.platform.TargetPlatform
|
||||
import org.jetbrains.kotlin.platform.js.JsPlatforms
|
||||
import org.jetbrains.kotlin.platform.jvm.JvmPlatforms
|
||||
import org.jetbrains.kotlin.platform.konan.KonanPlatforms
|
||||
import org.jetbrains.kotlin.resolve.PlatformDependentCompilerServices
|
||||
import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatformCompilerServices
|
||||
import org.jetbrains.kotlin.resolve.PlatformDependentAnalyzerServices
|
||||
import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatformAnalyzerServices
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
|
||||
@@ -150,8 +150,8 @@ abstract class AbstractFirDiagnosticsSmokeTest : BaseDiagnosticsTest() {
|
||||
override val platform: TargetPlatform
|
||||
get() = JvmPlatforms.defaultJvmPlatform
|
||||
|
||||
override val compilerServices: PlatformDependentCompilerServices
|
||||
get() = JvmPlatformCompilerServices
|
||||
override val analyzerServices: PlatformDependentAnalyzerServices
|
||||
get() = JvmPlatformAnalyzerServices
|
||||
|
||||
override fun dependencies(): List<ModuleInfo> {
|
||||
return listOf(this)
|
||||
@@ -162,8 +162,8 @@ abstract class AbstractFirDiagnosticsSmokeTest : BaseDiagnosticsTest() {
|
||||
override val platform: TargetPlatform
|
||||
get() = JvmPlatforms.defaultJvmPlatform
|
||||
|
||||
override val compilerServices: PlatformDependentCompilerServices
|
||||
get() = JvmPlatformCompilerServices
|
||||
override val analyzerServices: PlatformDependentAnalyzerServices
|
||||
get() = JvmPlatformAnalyzerServices
|
||||
|
||||
val dependencies = mutableListOf<ModuleInfo>(this)
|
||||
override fun dependencies(): List<ModuleInfo> {
|
||||
|
||||
@@ -7,7 +7,7 @@ package org.jetbrains.kotlin.analyzer
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.PlatformDependentCompilerServices
|
||||
import org.jetbrains.kotlin.resolve.PlatformDependentAnalyzerServices
|
||||
import org.jetbrains.kotlin.platform.TargetPlatform
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ interface ModuleInfo {
|
||||
fun dependencies(): List<ModuleInfo>
|
||||
val expectedBy: List<ModuleInfo> get() = emptyList()
|
||||
val platform: TargetPlatform
|
||||
val compilerServices: PlatformDependentCompilerServices
|
||||
val analyzerServices: PlatformDependentAnalyzerServices
|
||||
fun modulesWhoseInternalsAreVisible(): Collection<ModuleInfo> = listOf()
|
||||
val capabilities: Map<ModuleDescriptor.Capability<*>, Any?>
|
||||
get() = mapOf(Capability to this)
|
||||
@@ -30,7 +30,7 @@ interface ModuleInfo {
|
||||
// but if they are present, they should come after JVM built-ins in the dependencies list, because JVM built-ins contain
|
||||
// additional members dependent on the JDK
|
||||
fun dependencyOnBuiltIns(): ModuleInfo.DependencyOnBuiltIns =
|
||||
compilerServices?.dependencyOnBuiltIns() ?: ModuleInfo.DependencyOnBuiltIns.LAST
|
||||
analyzerServices?.dependencyOnBuiltIns() ?: ModuleInfo.DependencyOnBuiltIns.LAST
|
||||
|
||||
//TODO: (module refactoring) provide dependency on builtins after runtime in IDEA
|
||||
enum class DependencyOnBuiltIns { NONE, AFTER_SDK, LAST }
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ import org.jetbrains.kotlin.storage.LockBasedStorageManager
|
||||
import org.jetbrains.kotlin.storage.StorageManager
|
||||
import java.util.ArrayList
|
||||
|
||||
abstract class PlatformDependentCompilerServices {
|
||||
abstract class PlatformDependentAnalyzerServices {
|
||||
private data class DefaultImportsKey(val includeKotlinComparisons: Boolean, val includeLowPriorityImports: Boolean)
|
||||
|
||||
private val defaultImports = LockBasedStorageManager("TargetPlatform").let { storageManager ->
|
||||
@@ -43,7 +43,7 @@ import org.jetbrains.kotlin.load.kotlin.VirtualFileFinderFactory
|
||||
import org.jetbrains.kotlin.platform.TargetPlatform
|
||||
import org.jetbrains.kotlin.resolve.*
|
||||
import org.jetbrains.kotlin.resolve.jvm.JavaDescriptorResolver
|
||||
import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatformCompilerServices
|
||||
import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatformAnalyzerServices
|
||||
import org.jetbrains.kotlin.resolve.lazy.KotlinCodeAnalyzer
|
||||
import org.jetbrains.kotlin.resolve.lazy.declarations.DeclarationProviderFactory
|
||||
import org.jetbrains.kotlin.types.SubstitutingScopeProviderImpl
|
||||
@@ -63,8 +63,8 @@ fun createContainerForLazyResolveWithJava(
|
||||
useBuiltInsProvider: Boolean,
|
||||
configureJavaClassFinder: (StorageComponentContainer.() -> Unit)? = null,
|
||||
javaClassTracker: JavaClassesTracker? = null
|
||||
): StorageComponentContainer = createContainer("LazyResolveWithJava", JvmPlatformCompilerServices) {
|
||||
configureModule(moduleContext, jvmPlatform, JvmPlatformCompilerServices, bindingTrace, languageVersionSettings)
|
||||
): StorageComponentContainer = createContainer("LazyResolveWithJava", JvmPlatformAnalyzerServices) {
|
||||
configureModule(moduleContext, jvmPlatform, JvmPlatformAnalyzerServices, bindingTrace, languageVersionSettings)
|
||||
|
||||
configureIncrementalCompilation(lookupTracker, expectActualTracker)
|
||||
configureStandardResolveComponents()
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter
|
||||
import org.jetbrains.kotlin.resolve.scopes.MemberScope
|
||||
import org.jetbrains.kotlin.storage.StorageManager
|
||||
|
||||
object JvmPlatformCompilerServices : PlatformDependentCompilerServices() {
|
||||
object JvmPlatformAnalyzerServices : PlatformDependentAnalyzerServices() {
|
||||
override fun computePlatformSpecificDefaultImports(storageManager: StorageManager, result: MutableList<ImportPath>) {
|
||||
result.add(ImportPath.fromString("kotlin.jvm.*"))
|
||||
|
||||
@@ -14,7 +14,7 @@ private object CommonPlatformConfigurator : PlatformConfiguratorBase() {
|
||||
override fun configureModuleComponents(container: StorageComponentContainer) {}
|
||||
}
|
||||
|
||||
object CommonPlatformCompilerServices : PlatformDependentCompilerServices() {
|
||||
object CommonPlatformAnalyzerServices : PlatformDependentAnalyzerServices() {
|
||||
override fun computePlatformSpecificDefaultImports(storageManager: StorageManager, result: MutableList<ImportPath>) {}
|
||||
|
||||
override val platformConfigurator: PlatformConfigurator = CommonPlatformConfigurator
|
||||
|
||||
@@ -42,7 +42,7 @@ import org.jetbrains.kotlin.types.expressions.LocalLazyDeclarationResolver
|
||||
fun StorageComponentContainer.configureModule(
|
||||
moduleContext: ModuleContext,
|
||||
platform: TargetPlatform,
|
||||
compilerServices: PlatformDependentCompilerServices,
|
||||
analyzerServices: PlatformDependentAnalyzerServices,
|
||||
trace: BindingTrace,
|
||||
languageVersionSettings: LanguageVersionSettings
|
||||
) {
|
||||
@@ -55,11 +55,11 @@ fun StorageComponentContainer.configureModule(
|
||||
useInstance(languageVersionSettings)
|
||||
|
||||
useInstance(platform)
|
||||
useInstance(compilerServices)
|
||||
useInstance(analyzerServices)
|
||||
useInstance(platform.componentPlatforms.singleOrNull()?.targetPlatformVersion ?: TargetPlatformVersion.NoVersion)
|
||||
|
||||
compilerServices.platformConfigurator.configureModuleComponents(this)
|
||||
compilerServices.platformConfigurator.configureModuleDependentCheckers(this)
|
||||
analyzerServices.platformConfigurator.configureModuleComponents(this)
|
||||
analyzerServices.platformConfigurator.configureModuleDependentCheckers(this)
|
||||
|
||||
for (extension in StorageComponentContainerContributor.getInstances(moduleContext.project)) {
|
||||
extension.registerModuleComponents(this, platform, moduleContext.module)
|
||||
@@ -107,10 +107,10 @@ fun createContainerForBodyResolve(
|
||||
bindingTrace: BindingTrace,
|
||||
platform: TargetPlatform,
|
||||
statementFilter: StatementFilter,
|
||||
compilerServices: PlatformDependentCompilerServices,
|
||||
analyzerServices: PlatformDependentAnalyzerServices,
|
||||
languageVersionSettings: LanguageVersionSettings
|
||||
): StorageComponentContainer = createContainer("BodyResolve", compilerServices) {
|
||||
configureModule(moduleContext, platform, compilerServices, bindingTrace, languageVersionSettings)
|
||||
): StorageComponentContainer = createContainer("BodyResolve", analyzerServices) {
|
||||
configureModule(moduleContext, platform, analyzerServices, bindingTrace, languageVersionSettings)
|
||||
|
||||
useInstance(statementFilter)
|
||||
|
||||
@@ -127,10 +127,10 @@ fun createContainerForLazyBodyResolve(
|
||||
bindingTrace: BindingTrace,
|
||||
platform: TargetPlatform,
|
||||
bodyResolveCache: BodyResolveCache,
|
||||
compilerServices: PlatformDependentCompilerServices,
|
||||
analyzerServices: PlatformDependentAnalyzerServices,
|
||||
languageVersionSettings: LanguageVersionSettings
|
||||
): StorageComponentContainer = createContainer("LazyBodyResolve", compilerServices) {
|
||||
configureModule(moduleContext, platform, compilerServices, bindingTrace, languageVersionSettings)
|
||||
): StorageComponentContainer = createContainer("LazyBodyResolve", analyzerServices) {
|
||||
configureModule(moduleContext, platform, analyzerServices, bindingTrace, languageVersionSettings)
|
||||
|
||||
useInstance(kotlinCodeAnalyzer)
|
||||
useInstance(kotlinCodeAnalyzer.fileScopeProvider)
|
||||
@@ -149,9 +149,9 @@ fun createContainerForLazyLocalClassifierAnalyzer(
|
||||
languageVersionSettings: LanguageVersionSettings,
|
||||
statementFilter: StatementFilter,
|
||||
localClassDescriptorHolder: LocalClassDescriptorHolder,
|
||||
compilerServices: PlatformDependentCompilerServices
|
||||
): StorageComponentContainer = createContainer("LocalClassifierAnalyzer", compilerServices) {
|
||||
configureModule(moduleContext, platform, compilerServices, bindingTrace, languageVersionSettings)
|
||||
analyzerServices: PlatformDependentAnalyzerServices
|
||||
): StorageComponentContainer = createContainer("LocalClassifierAnalyzer", analyzerServices) {
|
||||
configureModule(moduleContext, platform, analyzerServices, bindingTrace, languageVersionSettings)
|
||||
|
||||
useInstance(localClassDescriptorHolder)
|
||||
useInstance(lookupTracker)
|
||||
@@ -178,11 +178,11 @@ fun createContainerForLazyResolve(
|
||||
declarationProviderFactory: DeclarationProviderFactory,
|
||||
bindingTrace: BindingTrace,
|
||||
platform: TargetPlatform,
|
||||
compilerServices: PlatformDependentCompilerServices,
|
||||
analyzerServices: PlatformDependentAnalyzerServices,
|
||||
targetEnvironment: TargetEnvironment,
|
||||
languageVersionSettings: LanguageVersionSettings
|
||||
): StorageComponentContainer = createContainer("LazyResolve", compilerServices) {
|
||||
configureModule(moduleContext, platform, compilerServices, bindingTrace, languageVersionSettings)
|
||||
): StorageComponentContainer = createContainer("LazyResolve", analyzerServices) {
|
||||
configureModule(moduleContext, platform, analyzerServices, bindingTrace, languageVersionSettings)
|
||||
|
||||
configureStandardResolveComponents()
|
||||
|
||||
|
||||
@@ -119,5 +119,5 @@ abstract class PlatformConfiguratorBase(
|
||||
}
|
||||
}
|
||||
|
||||
fun createContainer(id: String, compilerServices: PlatformDependentCompilerServices, init: StorageComponentContainer.() -> Unit) =
|
||||
composeContainer(id, compilerServices.platformConfigurator.platformSpecificContainer, init)
|
||||
fun createContainer(id: String, analyzerServices: PlatformDependentAnalyzerServices, init: StorageComponentContainer.() -> Unit) =
|
||||
composeContainer(id, analyzerServices.platformConfigurator.platformSpecificContainer, init)
|
||||
|
||||
@@ -40,13 +40,13 @@ data class FileScopes(val lexicalScope: LexicalScope, val importingScope: Import
|
||||
class FileScopeFactory(
|
||||
private val topLevelDescriptorProvider: TopLevelDescriptorProvider,
|
||||
private val bindingTrace: BindingTrace,
|
||||
private val compilerServices: PlatformDependentCompilerServices,
|
||||
private val analyzerServices: PlatformDependentAnalyzerServices,
|
||||
private val components: ImportResolutionComponents
|
||||
) {
|
||||
private val defaultImports =
|
||||
compilerServices.getDefaultImports(components.languageVersionSettings, includeLowPriorityImports = false).map(::DefaultImportImpl)
|
||||
analyzerServices.getDefaultImports(components.languageVersionSettings, includeLowPriorityImports = false).map(::DefaultImportImpl)
|
||||
|
||||
private val defaultLowPriorityImports = compilerServices.defaultLowPriorityImports.map(::DefaultImportImpl)
|
||||
private val defaultLowPriorityImports = analyzerServices.defaultLowPriorityImports.map(::DefaultImportImpl)
|
||||
|
||||
private class DefaultImportImpl(private val importPath: ImportPath) : KtImportInfo {
|
||||
override val isAllUnder: Boolean get() = importPath.isAllUnder
|
||||
@@ -95,7 +95,7 @@ class FileScopeFactory(
|
||||
tempTrace,
|
||||
packageFragment = null,
|
||||
aliasImportNames = aliasImportNames,
|
||||
excludedImports = compilerServices.excludedImports
|
||||
excludedImports = analyzerServices.excludedImports
|
||||
)
|
||||
val lowPriority = createDefaultImportResolver(
|
||||
AllUnderImportsIndexed(defaultLowPriorityImports.also { imports ->
|
||||
|
||||
+2
-2
@@ -61,7 +61,7 @@ class LocalClassifierAnalyzer(
|
||||
private val typeResolver: TypeResolver,
|
||||
private val annotationResolver: AnnotationResolver,
|
||||
private val platform: TargetPlatform,
|
||||
private val compilerServices: PlatformDependentCompilerServices,
|
||||
private val analyzerServices: PlatformDependentAnalyzerServices,
|
||||
private val lookupTracker: LookupTracker,
|
||||
private val supertypeLoopChecker: SupertypeLoopChecker,
|
||||
private val languageVersionSettings: LanguageVersionSettings,
|
||||
@@ -103,7 +103,7 @@ class LocalClassifierAnalyzer(
|
||||
wrappedTypeFactory,
|
||||
substitutingScopeProvider
|
||||
),
|
||||
compilerServices
|
||||
analyzerServices
|
||||
)
|
||||
|
||||
container.get<LazyTopDownAnalyzer>().analyzeDeclarations(
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ import org.jetbrains.kotlin.js.analyze.TopDownAnalyzerFacadeForJS
|
||||
import org.jetbrains.kotlin.js.analyzer.JsAnalysisResult
|
||||
import org.jetbrains.kotlin.js.config.JSConfigurationKeys
|
||||
import org.jetbrains.kotlin.js.config.JsConfig
|
||||
import org.jetbrains.kotlin.js.resolve.JsPlatformCompilerServices
|
||||
import org.jetbrains.kotlin.js.resolve.JsPlatformAnalyzerServices
|
||||
import org.jetbrains.kotlin.js.resolve.MODULE_KIND
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
@@ -84,7 +84,7 @@ abstract class AbstractDiagnosticsTestWithJsStdLib : AbstractDiagnosticsTest() {
|
||||
override fun shouldSkipJvmSignatureDiagnostics(groupedByModule: Map<TestModule?, List<TestFile>>): Boolean = true
|
||||
|
||||
override fun createModule(moduleName: String, storageManager: StorageManager): ModuleDescriptorImpl =
|
||||
ModuleDescriptorImpl(Name.special("<$moduleName>"), storageManager, JsPlatformCompilerServices.builtIns)
|
||||
ModuleDescriptorImpl(Name.special("<$moduleName>"), storageManager, JsPlatformAnalyzerServices.builtIns)
|
||||
|
||||
override fun createSealedModule(storageManager: StorageManager): ModuleDescriptorImpl {
|
||||
val module = createModule("kotlin-js-test-module", storageManager)
|
||||
|
||||
@@ -8,15 +8,15 @@ package org.jetbrains.kotlin.fir
|
||||
import org.jetbrains.kotlin.analyzer.ModuleInfo
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.platform.jvm.JvmPlatforms
|
||||
import org.jetbrains.kotlin.resolve.PlatformDependentCompilerServices
|
||||
import org.jetbrains.kotlin.resolve.PlatformDependentAnalyzerServices
|
||||
import org.jetbrains.kotlin.platform.TargetPlatform
|
||||
import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatformCompilerServices
|
||||
import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatformAnalyzerServices
|
||||
|
||||
class FirTestModuleInfo(
|
||||
override val name: Name = Name.identifier("TestModule"),
|
||||
val dependencies: MutableList<ModuleInfo> = mutableListOf(),
|
||||
override val platform: TargetPlatform = JvmPlatforms.defaultJvmPlatform,
|
||||
override val compilerServices: PlatformDependentCompilerServices = JvmPlatformCompilerServices
|
||||
override val analyzerServices: PlatformDependentAnalyzerServices = JvmPlatformAnalyzerServices
|
||||
) : ModuleInfo {
|
||||
override fun dependencies(): List<ModuleInfo> = dependencies
|
||||
}
|
||||
+4
-4
@@ -27,12 +27,12 @@ import org.jetbrains.kotlin.context.ProjectContext
|
||||
import org.jetbrains.kotlin.load.kotlin.PackagePartProvider
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.resolve.PlatformDependentCompilerServices
|
||||
import org.jetbrains.kotlin.resolve.PlatformDependentAnalyzerServices
|
||||
import org.jetbrains.kotlin.platform.TargetPlatform
|
||||
import org.jetbrains.kotlin.platform.jvm.JvmPlatforms
|
||||
import org.jetbrains.kotlin.resolve.jvm.JvmResolverForModuleFactory
|
||||
import org.jetbrains.kotlin.resolve.jvm.JvmPlatformParameters
|
||||
import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatformCompilerServices
|
||||
import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatformAnalyzerServices
|
||||
|
||||
fun createResolveSessionForFiles(
|
||||
project: Project,
|
||||
@@ -69,6 +69,6 @@ private class TestModule(val dependsOnBuiltIns: Boolean) : ModuleInfo {
|
||||
override val platform: TargetPlatform
|
||||
get() = JvmPlatforms.defaultJvmPlatform
|
||||
|
||||
override val compilerServices: PlatformDependentCompilerServices
|
||||
get() = JvmPlatformCompilerServices
|
||||
override val analyzerServices: PlatformDependentAnalyzerServices
|
||||
get() = JvmPlatformAnalyzerServices
|
||||
}
|
||||
|
||||
@@ -27,17 +27,17 @@ import org.jetbrains.kotlin.frontend.di.configureModule
|
||||
import org.jetbrains.kotlin.platform.jvm.JvmPlatforms
|
||||
import org.jetbrains.kotlin.resolve.*
|
||||
import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowValueFactory
|
||||
import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatformCompilerServices
|
||||
import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatformAnalyzerServices
|
||||
import org.jetbrains.kotlin.types.SubstitutingScopeProviderImpl
|
||||
import org.jetbrains.kotlin.types.expressions.ExpressionTypingServices
|
||||
import org.jetbrains.kotlin.types.expressions.FakeCallResolver
|
||||
|
||||
fun createContainerForTests(project: Project, module: ModuleDescriptor): ContainerForTests {
|
||||
return ContainerForTests(createContainer("Tests", JvmPlatformCompilerServices) {
|
||||
return ContainerForTests(createContainer("Tests", JvmPlatformAnalyzerServices) {
|
||||
configureModule(
|
||||
ModuleContext(module, project, "container for tests"),
|
||||
JvmPlatforms.defaultJvmPlatform,
|
||||
JvmPlatformCompilerServices,
|
||||
JvmPlatformAnalyzerServices,
|
||||
BindingTraceContext(),
|
||||
LanguageVersionSettingsImpl.DEFAULT
|
||||
)
|
||||
|
||||
+4
-4
@@ -34,7 +34,7 @@ import org.jetbrains.kotlin.load.kotlin.PackagePartProvider
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.resolve.PlatformDependentCompilerServices
|
||||
import org.jetbrains.kotlin.resolve.PlatformDependentAnalyzerServices
|
||||
import org.jetbrains.kotlin.platform.TargetPlatform
|
||||
import org.jetbrains.kotlin.platform.jvm.JvmPlatforms
|
||||
import org.jetbrains.kotlin.resolve.constants.EnumValue
|
||||
@@ -42,7 +42,7 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.annotationClass
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.module
|
||||
import org.jetbrains.kotlin.resolve.jvm.JvmResolverForModuleFactory
|
||||
import org.jetbrains.kotlin.resolve.jvm.JvmPlatformParameters
|
||||
import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatformCompilerServices
|
||||
import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatformAnalyzerServices
|
||||
import org.jetbrains.kotlin.test.ConfigurationKind
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||
import org.jetbrains.kotlin.test.TestJdkKind
|
||||
@@ -64,8 +64,8 @@ class MultiModuleJavaAnalysisCustomTest : KtUsefulTestCase() {
|
||||
override val platform: TargetPlatform
|
||||
get() = JvmPlatforms.defaultJvmPlatform
|
||||
|
||||
override val compilerServices: PlatformDependentCompilerServices
|
||||
get() = JvmPlatformCompilerServices
|
||||
override val analyzerServices: PlatformDependentAnalyzerServices
|
||||
get() = JvmPlatformAnalyzerServices
|
||||
}
|
||||
|
||||
fun testJavaEntitiesBelongToCorrectModule() {
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.jetbrains.kotlin.js.config.JsConfig
|
||||
import org.jetbrains.kotlin.js.facade.K2JSTranslator
|
||||
import org.jetbrains.kotlin.js.facade.MainCallParameters
|
||||
import org.jetbrains.kotlin.js.facade.TranslationResult
|
||||
import org.jetbrains.kotlin.js.resolve.JsPlatformCompilerServices
|
||||
import org.jetbrains.kotlin.js.resolve.JsPlatformAnalyzerServices
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.BindingTraceContext
|
||||
import org.jetbrains.kotlin.serialization.AbstractVersionRequirementTest
|
||||
@@ -78,7 +78,7 @@ class JsVersionRequirementTest : AbstractVersionRequirementTest() {
|
||||
val config = JsConfig(environment.project, environment.configuration)
|
||||
return ContextForNewModule(
|
||||
ProjectContext(environment.project, "ProjectContext"),
|
||||
Name.special("<test>"), JsPlatformCompilerServices.builtIns, null
|
||||
Name.special("<test>"), JsPlatformAnalyzerServices.builtIns, null
|
||||
).apply {
|
||||
setDependencies(listOf(module) + config.moduleDescriptors + module.builtIns.builtInsModule)
|
||||
}
|
||||
|
||||
+2
-2
@@ -31,7 +31,7 @@ import org.jetbrains.kotlin.incremental.components.LookupTracker
|
||||
import org.jetbrains.kotlin.js.analyze.TopDownAnalyzerFacadeForJS
|
||||
import org.jetbrains.kotlin.js.config.JSConfigurationKeys
|
||||
import org.jetbrains.kotlin.js.config.JsConfig
|
||||
import org.jetbrains.kotlin.js.resolve.JsPlatformCompilerServices
|
||||
import org.jetbrains.kotlin.js.resolve.JsPlatformAnalyzerServices
|
||||
import org.jetbrains.kotlin.jvm.compiler.LoadDescriptorUtil.TEST_PACKAGE_FQNAME
|
||||
import org.jetbrains.kotlin.serialization.deserialization.DeserializationConfiguration
|
||||
import org.jetbrains.kotlin.serialization.js.KotlinJavascriptSerializationUtil.readModuleAsProto
|
||||
@@ -94,7 +94,7 @@ class KotlinJavascriptSerializerTest : TestCaseWithTmpdir() {
|
||||
}
|
||||
|
||||
private fun deserialize(metaFile: File): ModuleDescriptorImpl {
|
||||
val module = KotlinTestUtils.createEmptyModule("<${KotlinTestUtils.TEST_MODULE_NAME}>", JsPlatformCompilerServices.builtIns)
|
||||
val module = KotlinTestUtils.createEmptyModule("<${KotlinTestUtils.TEST_MODULE_NAME}>", JsPlatformAnalyzerServices.builtIns)
|
||||
val metadata = KotlinJavascriptMetadataUtils.loadMetadata(metaFile).single()
|
||||
|
||||
val (header, packageFragmentProtos) = readModuleAsProto(metadata.body, metadata.version)
|
||||
|
||||
@@ -19,7 +19,7 @@ package org.jetbrains.kotlin.types;
|
||||
import kotlin.Unit;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.analyzer.AnalysisResult;
|
||||
import org.jetbrains.kotlin.analyzer.common.CommonPlatformCompilerServices;
|
||||
import org.jetbrains.kotlin.analyzer.common.CommonPlatformAnalyzerServices;
|
||||
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment;
|
||||
import org.jetbrains.kotlin.config.LanguageVersionSettingsImpl;
|
||||
import org.jetbrains.kotlin.container.DslKt;
|
||||
@@ -117,7 +117,7 @@ public class DefaultModalityModifiersTest extends KotlinTestWithEnvironment {
|
||||
new FileBasedDeclarationProviderFactory(moduleContext.getStorageManager(), files),
|
||||
new BindingTraceContext(),
|
||||
CommonPlatforms.INSTANCE.getDefaultCommonPlatform(),
|
||||
CommonPlatformCompilerServices.INSTANCE,
|
||||
CommonPlatformAnalyzerServices.INSTANCE,
|
||||
CompilerEnvironment.INSTANCE,
|
||||
LanguageVersionSettingsImpl.DEFAULT
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user