JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
16.35k stars 1.18k forks source link

No Sources in Multiplatform #4213

Closed GazimSoliev closed 2 months ago

GazimSoliev commented 10 months ago

Describe the bug No Sources in Multiplatform, IDE can'r find them

Affected platforms Select one of the platforms below:

If the bug is Android-only, report it in the Jetpack Compose tracker

Versions

To Reproduce Steps and/or the code snippet to reproduce the behavior: Look sources

Expected behavior See sources

Screenshots image image

mazunin-v-jb commented 10 months ago

Hello! I can't reproduce that. Could you please provide information about reproducing the issue, step by step?

daoenpan commented 10 months ago

I have the same problem after apply org.jetbrains.compose plugin in shared project. Add a dependency e.g. implementation(compose.material3) to commonMain. Then open MyApplicationTheme.kt in androidApp, from there open MaterialTheme composable on line 49 with Command+Click. That will reproduce this bug.

Here is the demo project https://github.com/daoenpan/kmp-bugreport

I use Android Studio Hedgehog | 2023.1.1 Patch 2

ktkahkon commented 8 months ago

I'm facing the same issue. I created a project through the Kotlin Multiplatform Wizard web page. When I add, for example,

@Composable
fun Foobar() {
    Text("Foo")
}

to a file under androidMain and click go to definition on the Text function, it will show the sources of Text composable. But if I add Foobar under commonMain and go to definition of Text from there, I get IntelliJ API Decompiler stub source generated from a class file.

Is it possible to access the sources from commonMain somehow?

MindWing-net commented 8 months ago

I get the source on Android Studio Iguana | 2023.2.1

GazimSoliev commented 8 months ago

Hello! I can't reproduce that. Could you please provide information about reproducing the issue, step by step?

Now it's working in commonMain, but it doesn't work for specific target for example desktopMain (aka jvmMain)

okushnikov commented 3 months ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.