-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
I want to use Zed with Kotlin Multiplatform. A typical kotlin multiplatform project usually has multiple source sets like this:
// build.gradle.kts (:composeApp)
kotlin {
sourceSets {
val desktopMain by getting
androidMain.dependencies {
implementation(compose.preview)
implementation(libs.androidx.activity.compose)
}
commonMain.dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material3)
implementation(compose.ui)
implementation(compose.components.resources)
implementation(compose.components.uiToolingPreview)
implementation(libs.androidx.lifecycle.viewmodel)
implementation(libs.androidx.lifecycle.runtimeCompose)
}
commonTest.dependencies {
implementation(libs.kotlin.test)
}
desktopMain.dependencies {
implementation(compose.desktop.currentOs)
implementation(libs.kotlinx.coroutinesSwing)
}
}
}Using such a setup results in LSP errors such as:
interface Platform {
val name: String
}
expect fun getPlatform(): Platform // <- Function 'getPlatform': expect and corresponding actual are declared in the same module, which will be prohibited in Kotlin 2.0. See https://youtrack.jetbrains.com/issue/KT-55177 (kotlin EXPECT_AND_ACTUAL_IN_THE_SAME_MODULE)Even though the actual definitions are all in separate source sets.
Expected behavior: not showing the error if the actual implementations are correctly separated into different source sets. Potentially, providing the user with the list of actual implementations, and letting the user jumping to one of them (like in Android Studio)
To recreate just create a KMP project with their template, it already has an expect/actual platform example code.
Metadata
Metadata
Assignees
Labels
No labels