Skip to content

Commit 98c8b4e

Browse files
dkrasnoffnikpachoo
authored andcommitted
Fixed the changed contract for PluginCliParser.loadPluginsSafe
After KT-72172 the contract for `loadPluginsSafe` requires passing disposable to it.
1 parent 0c3a64b commit 98c8b4e

File tree

6 files changed

+13
-9
lines changed

6 files changed

+13
-9
lines changed

common/src/main/kotlin/component/KotlinEnvironment.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ class KotlinEnvironment(
100100
put(WasmConfigurationKeys.WASM_ENABLE_ASSERTS, false)
101101
}
102102

103+
val rootDisposable = Disposer.newDisposable()
104+
103105
val composeWasmConfiguration: CompilerConfiguration = configuration.copy().apply {
104106
put(CommonConfigurationKeys.MODULE_NAME, "playground")
105107
put(JSConfigurationKeys.LIBRARIES, COMPOSE_WASM_LIBRARIES)
@@ -109,13 +111,14 @@ class KotlinEnvironment(
109111
PluginCliParser.loadPluginsSafe(
110112
COMPOSE_WASM_COMPILER_PLUGINS,
111113
composeWasmCompilerPluginOptions,
112-
emptyList(),
113-
this
114+
emptyList<String>(),
115+
this,
116+
rootDisposable
114117
)
115118
}
116119

117120
private val environment = KotlinCoreEnvironment.createForProduction(
118-
projectDisposable = Disposer.newDisposable(),
121+
projectDisposable = rootDisposable,
119122
configuration = configuration.copy(),
120123
configFiles = EnvironmentConfigFiles.JVM_CONFIG_FILES
121124
)

indexation/src/main/kotlin/WebIndexationBuilder.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ class WebIndexationBuilder(
2828
PluginCliParser.loadPluginsSafe(
2929
compilerPlugins,
3030
compilerPluginOptions,
31-
emptyList(),
32-
configuration
31+
emptyList<String>(),
32+
configuration,
33+
kotlinEnvironment.rootDisposable
3334
)
3435
}
3536
val sourceModule = prepareAnalyzedSourceModule(

src/test/resources/test-compile-output/js/KotlinByExampleSnippetsTests/01_dynamic/0.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/test/resources/test-compile-output/js/KotlinByExampleSnippetsTests/02_js_function/0.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/test/resources/test-compile-output/js/KotlinByExampleSnippetsTests/02_js_function/1.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/test/resources/test-compile-output/js/KotlinByExampleSnippetsTests/03_external/0.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)