[kotlin] Enable WASM target in the IDE

^KT-64984 Fixed

GitOrigin-RevId: 3ec8a9c9a53635fd14d1bef605adacf9bda98716
This commit is contained in:
Yan Zhulanow
2024-09-03 02:31:36 +09:00
committed by intellij-monorepo-bot
parent b9e773d51b
commit 5f2a39edea
5 changed files with 2 additions and 24 deletions

View File

@@ -1,18 +0,0 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.kotlin.idea.test
import com.intellij.openapi.util.registry.Registry
import com.intellij.testFramework.UsefulTestCase
import org.jetbrains.annotations.TestOnly
import org.jetbrains.kotlin.idea.base.plugin.KotlinPluginMode
import org.jetbrains.kotlin.idea.base.plugin.USE_K2_PLUGIN_PROPERTY_NAME
import org.jetbrains.kotlin.idea.base.plugin.useK2Plugin
@TestOnly
fun <T> T.enableKmpWasmSupport() where T : UsefulTestCase, T : ExpectedPluginModeProvider {
if (this.pluginMode == KotlinPluginMode.K2) {
check(useK2Plugin == true) { "Expected '$USE_K2_PLUGIN_PROPERTY_NAME' to be set, please set up the plugin before enabling KMP" }
Registry.get("kotlin.k2.kmp.wasm.enabled").setValue(true, testRootDisposable)
}
}

View File

@@ -132,7 +132,7 @@
<registryKey key="kotlin.k2.kmp.wasm.enabled"
description="Enable KMP support in the K2 mode for WASM platform"
defaultValue="false"
defaultValue="true"
restartRequired="true"/>
<!-- inlay hints -->

View File

@@ -22,7 +22,7 @@ internal class WasmMultiplatformSupportAvailability : KotlinSupportAvailability
true
}
Registry.`is`("kotlin.k2.kmp.wasm.enabled", false) -> {
Registry.`is`("kotlin.k2.kmp.wasm.enabled", true) -> {
true
}

View File

@@ -28,7 +28,6 @@ import org.jetbrains.kotlin.idea.codeInsight.gradle.combineMultipleFailures
import org.jetbrains.kotlin.idea.codeMetaInfo.clearTextFromDiagnosticMarkup
import org.jetbrains.kotlin.idea.test.ExpectedPluginModeProvider
import org.jetbrains.kotlin.idea.test.KotlinTestUtils
import org.jetbrains.kotlin.idea.test.enableKmpWasmSupport
import org.jetbrains.kotlin.idea.test.runAll
import org.jetbrains.kotlin.idea.test.setUpWithKotlinPlugin
import org.jetbrains.kotlin.konan.target.HostManager
@@ -206,7 +205,6 @@ abstract class AbstractKotlinMppGradleImportingTest : GradleImportingTestCase(),
// @Parametrized
(this as GradleImportingTestCase).gradleVersion = context.gradleVersion.version
super.setUp()
enableKmpWasmSupport()
}
context.testProject = myProject

View File

@@ -31,8 +31,6 @@ abstract class KotlinLightMultiplatformCodeInsightFixtureTestCase : KotlinLightC
override fun setUp() {
super.setUp()
Registry.get("kotlin.k2.kmp.wasm.enabled").setValue(true, testRootDisposable)
// sync is necessary to detect unexpected disappearances of library files
VfsTestUtil.syncRefresh()
}