Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[contributing] Completion error in intellij after 2.0.0-RC3 #2725

Closed
Chuckame opened this issue Jun 23, 2024 · 12 comments
Closed

[contributing] Completion error in intellij after 2.0.0-RC3 #2725

Chuckame opened this issue Jun 23, 2024 · 12 comments

Comments

@Chuckame
Copy link
Contributor

Chuckame commented Jun 23, 2024

Describe the bug
Since kotlinx.serialization 1.7.0, I'm unable to contribute as all the kotlin standard library is missing the completion, and/or have the standard library missing from the classpath, which makes all the listOf, apply, to and more to be red. No issue when going back to 1.6.3. I don't know if it's a misconfiguration of the library or my computer, but this is the only project having issues (regarding 10-15 other projects), that's why I'm opening the issue here.

I tried everything, even reinstalling intellij, emptying gradle's cache, remove shared indexes, etc. Also tried with multiple Java runtimes from 17 to 21.

Do you already had this issue?

To Reproduce
Just checkout 1.7.0 or master.

Environment

  • Kotlin version: lib's version
  • Library version: 1.7.0+ (1.6.3 ok)
  • Kotlin platforms: all
  • Gradle version: lib's version
  • IDE version (if bug is related to the IDE) intellij 2024.1.4
@sandwwraith
Copy link
Member

Do you mean that when you open the kotlinx.serializaition project itself, you can't get indexing/completion? I haven't experienced such problems, so it may be indeed related to your configuration. See this ticket, maybe you have similar problem: #2673

@Chuckame
Copy link
Contributor Author

I've totally removed the lib folder and re-cloned it, after removing the system directory, enabled K2 mode, re-imported the root build.gradle.kts. Still the same, all the standard libraries are not found by IntelliJ 😞 All the rest is working (indexing/completion)

@Chuckame Chuckame changed the title [contributing] Completion error in intellij after 1.6.4 [contributing] Completion error in intellij after 1.6.3 Jun 24, 2024
@sandwwraith
Copy link
Member

You shouldn't enable K2 mode in IDE, it doesn't support MPP projects for now. Regular mode works fine with Kotlin 2.0 projects

@Chuckame
Copy link
Contributor Author

Ok, same without K2 mode.

But there is something strange: Annotation class is indexed, but it's from a decompiled kotlin class and not sources, I never had this.
image


Here are the errors I'm getting:
image
image

@sandwwraith
Copy link
Member

Unfortunately, I'm not able to reproduce the problem even on a freshly cloned project :(
Does building from command line (e.g. ./gradlew jvmTest) works correctly? Maybe you have some weird environment variables?

@Chuckame
Copy link
Contributor Author

Yes, gradle compiles well and execute well the tests

$ kotlinx.serialization % ./gradlew jvmTest
[.....]
BUILD SUCCESSFUL in 49s

AFAIK, no weird env var, the only changed config is -Xmx3072m.

All my other projects are working well 😅

@sandwwraith
Copy link
Member

To be honest, I don't know what else to recommend to you except trying to take your colleague's computer and/or VM and see what happens there :(

@xiaozhikang0916
Copy link
Contributor

Did you try install another instance of intellij via JetBrains Toolbox, or other version like 2024.2 EAP, or clean all IDE cache by removing directory in ~/Library/Caches/JetBrains/{IDE_VERSION} (in mac) ?

@Chuckame
Copy link
Contributor Author

Chuckame commented Jul 2, 2024

@xiaozhikang0916 yes I already cleaned this folder (that is the system directory) and also already cleaned all the caches.

Today I tried with a brand new clean IDE (IntelliJ community), but still having the same issue: all the standard library is not found by the IDE

@Chuckame
Copy link
Contributor Author

Chuckame commented Jul 2, 2024

Ok, I've tested all the commits on the fresh IntelliJ. The error appears when moving from kotlin 2.0.0-RC3 to 2.0.0, commit d2dc7d2978bd62971e8ab00de197d59d7e378ed2, tag v1.7.0.

@Chuckame Chuckame changed the title [contributing] Completion error in intellij after 1.6.3 [contributing] Completion error in intellij after 2.0.0-RC3 Jul 2, 2024
@Chuckame
Copy link
Contributor Author

Chuckame commented Jul 2, 2024

It works when using Kotlin 2.0.20-Beta1

@Chuckame
Copy link
Contributor Author

Works with the last master commit (kotlin 2.0.20).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants