manifold-systems / manifold

Manifold is a Java compiler plugin, its features include Metaprogramming, Properties, Extension Methods, Operator Overloading, Templates, a Preprocessor, and more.
http://manifold.systems/
Apache License 2.0
2.42k stars 125 forks source link

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

Open Svetlovsky opened 4 months ago

Svetlovsky commented 4 months ago

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):

Svetlovsky commented 2 months ago

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

rsmckinney commented 2 months ago

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 commented 2 months ago

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