[IDE] Propagate KotlinFacetSettings version and completely drop isReleaseCoroutines flag
Also this commit removes number of tests related to support experimental coroutines
This commit is contained in:
committed by
TeamCityServer
parent
e991c9d476
commit
af94bcebea
-1
@@ -43,7 +43,6 @@ class IdeaResolverForProject(
|
||||
private val syntheticFilesByModule: Map<IdeaModuleInfo, Collection<KtFile>>,
|
||||
delegateResolver: ResolverForProject<IdeaModuleInfo>,
|
||||
fallbackModificationTracker: ModificationTracker? = null,
|
||||
private val isReleaseCoroutines: Boolean? = null,
|
||||
// TODO(dsavvinov): this is needed only for non-composite analysis, extract separate resolver implementation instead
|
||||
private val constantSdkDependencyIfAny: SdkInfo? = null
|
||||
) : AbstractResolverForProject<IdeaModuleInfo>(
|
||||
|
||||
+6
-22
@@ -80,20 +80,16 @@ internal val LOG = Logger.getInstance(KotlinCacheService::class.java)
|
||||
* This mode is currently enabled only for HMPP projects
|
||||
*/
|
||||
sealed class PlatformAnalysisSettings {
|
||||
// Effectively unused as a property. Needed only to distinguish different modes when being put in a map
|
||||
abstract val isReleaseCoroutines: Boolean
|
||||
|
||||
companion object {
|
||||
fun create(
|
||||
project: Project,
|
||||
platform: TargetPlatform,
|
||||
sdk: Sdk?,
|
||||
isAdditionalBuiltInFeaturesSupported: Boolean,
|
||||
isReleaseCoroutines: Boolean
|
||||
isAdditionalBuiltInFeaturesSupported: Boolean
|
||||
) = if (project.useCompositeAnalysis)
|
||||
CompositeAnalysisSettings(isReleaseCoroutines)
|
||||
CompositeAnalysisSettings
|
||||
else
|
||||
PlatformAnalysisSettingsImpl(platform, sdk, isAdditionalBuiltInFeaturesSupported, isReleaseCoroutines)
|
||||
PlatformAnalysisSettingsImpl(platform, sdk, isAdditionalBuiltInFeaturesSupported)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,11 +97,9 @@ data class PlatformAnalysisSettingsImpl(
|
||||
val platform: TargetPlatform,
|
||||
val sdk: Sdk?,
|
||||
val isAdditionalBuiltInFeaturesSupported: Boolean,
|
||||
override val isReleaseCoroutines: Boolean
|
||||
) : PlatformAnalysisSettings()
|
||||
|
||||
data class CompositeAnalysisSettings(override val isReleaseCoroutines: Boolean) : PlatformAnalysisSettings() {
|
||||
}
|
||||
object CompositeAnalysisSettings : PlatformAnalysisSettings()
|
||||
|
||||
class KotlinCacheServiceImpl(val project: Project) : KotlinCacheService {
|
||||
override fun getResolutionFacade(elements: List<KtElement>): ResolutionFacade {
|
||||
@@ -149,10 +143,7 @@ class KotlinCacheServiceImpl(val project: Project) : KotlinCacheService {
|
||||
): ProjectResolutionFacade {
|
||||
val sdk = dependenciesModuleInfo.sdk
|
||||
val platform = JvmPlatforms.defaultJvmPlatform // TODO: Js scripts?
|
||||
val settings = PlatformAnalysisSettings.create(
|
||||
project, platform, sdk, true,
|
||||
LanguageFeature.ReleaseCoroutines.defaultState == LanguageFeature.State.ENABLED
|
||||
)
|
||||
val settings = PlatformAnalysisSettings.create(project, platform, sdk, true)
|
||||
|
||||
val dependenciesForScriptDependencies = listOf(
|
||||
LibraryModificationTracker.getInstance(project),
|
||||
@@ -227,16 +218,9 @@ class KotlinCacheServiceImpl(val project: Project) : KotlinCacheService {
|
||||
|
||||
private fun IdeaModuleInfo.platformSettings(targetPlatform: TargetPlatform) = PlatformAnalysisSettings.create(
|
||||
this@KotlinCacheServiceImpl.project, targetPlatform, sdk,
|
||||
supportsAdditionalBuiltInsMembers(this@KotlinCacheServiceImpl.project),
|
||||
isReleaseCoroutines()
|
||||
supportsAdditionalBuiltInsMembers(this@KotlinCacheServiceImpl.project)
|
||||
)
|
||||
|
||||
private fun IdeaModuleInfo.isReleaseCoroutines(): Boolean {
|
||||
return IDELanguageSettingsProvider
|
||||
.getLanguageVersionSettings(this, this@KotlinCacheServiceImpl.project)
|
||||
.supportsFeature(LanguageFeature.ReleaseCoroutines)
|
||||
}
|
||||
|
||||
private fun facadeForModules(settings: PlatformAnalysisSettings) =
|
||||
getOrBuildGlobalFacade(settings).facadeForModules
|
||||
|
||||
|
||||
-1
@@ -122,7 +122,6 @@ internal class ProjectResolutionFacade(
|
||||
syntheticFilesByModule,
|
||||
delegateResolverForProject,
|
||||
if (invalidateOnOOCB) KotlinModificationTrackerService.getInstance(project).outOfBlockModificationTracker else null,
|
||||
settings.isReleaseCoroutines,
|
||||
constantSdkDependencyIfAny = if (settings is PlatformAnalysisSettingsImpl) settings.sdk?.let { SdkInfo(project, it) } else null
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user