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

IntelliJ plugin incorrectly shows Kotlin collection functions as if they come from Java in a mixed project #610

Open
Svetlovsky opened this issue Jul 18, 2024 · 3 comments

Comments

@Svetlovsky
Copy link

Svetlovsky commented Jul 18, 2024

Describe the bug
In a mixed project, where Java is a production code and Kotlin is a test code, when using Manifold plugin IntelliJ shows kotlin's map, filter and other collection functions as if they come from Java and crosses them out as if they are deprecated, which leads to another issue when infix functions are shown as unresolved reference. However, this issue is just visual, because tests pass

To Reproduce
Steps to reproduce the behavior:

  1. clone https://github.com/Svetlovsky/manifold-mixed-project-bug project
  2. run ./gradlew test to verify tests are passing
  3. open AppTest.kt file to see the issue

Repository also contains screenshots that demonstrate the behavior

Expected behavior
Manifold IntelliJ plugin should use kotlin functions when working with kotlin files in a mixed project (i.e. Java + Kotlin)

Screenshots
issue

Desktop (please complete the following information):

  • OS Type & Version: macos Sonoma 14.5 & Windows 11
  • Java/JDK version: Corretto 21
  • IDE version (IntelliJ IDEA or Android Studio): IntelliJ IDEA 2024.1.4
  • Manifold version: 2024.1.23
  • Manifold IntelliJ plugin version: 2024.1.6
@Svetlovsky
Copy link
Author

@rsmckinney hi! are there any updates/plans on this?

@rsmckinney
Copy link
Member

Not yet . . .

Fixing this is a bit involved. Internally, IJ shares the same type definition with both Java nd Kotlin. Since manifold extensions are necessarily applied directly to the type, the manifold plugin must override Kotlin plugin functionality to prevent it from resolving references manifold extension methods.

It's non-trivial, but not a big project either. I just need to set aside time to implement it for Kotlin. Apologies for the wait.

@Svetlovsky
Copy link
Author

I see, no problem, I was just checking in, thank you for explaining!

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

2 participants