Problem with imports in Java project when Scala plugin is enabled

Hi,

I'm doing some tests with Play framework 2.0. I'm seeing problems with imports in Play 2.0 Java projects as long as the Scala plugin is enabled. When it's disabled, the problems vanishes. Play 2.0 Scala projects don't seem to be affected.

Reproduction:
1. Download http://download.playframework.org/releases/play-2.0-beta.zip and unzip
2. Add play-2.0-beta/repository/local/play/play_2.9.1/2.0-beta/jars/play_2.9.1.jar as dependency/library to a Java project
3. Add the following Java class to the project:

---
package test;

import play.*;

public class Test {
    public static void main() {
        Application application;
    }
}
---

When the Scala plugin is enabled, the import will be marked as having an error ("Cannot resolve symbol play"). When I disable the Plugin, the errors disappears.

Explicitly importing play.Application with the Scala Plugin enabled also solves the problem.

This is with IDEA 11.0.1 and Scala Plugin 0.5.282.

Is this a known problem?

Timo

0
13 comments

I just started big part of work in Scala plugin to fix Java -> Scala compatibility. When it will be done, your problem will disappear in Java code with enabled Scala plugin.

Best regards,
Alexander Podkhalyuzin.

0

I'm doing very large refactoring, and this issue will be fixed too (and I hope to fix all Java -> Scala compatibility problems). However this refactoring can break anything. So plugin will be unstable some time. I hope this is not very big price for fixing Java -> Scala compatibility (and Groovy -> Scala and so on).

Best regards,
Alexander Podkhalyuzin.

0

"No pain, no gain" - eagerly awaiting the next series of nightly builds.
We have some partial Java/Scala projects, I hope we'll be able to catch some bugs :)

-tt

0
Avatar
Permanently deleted user

Great. Do you already have any ETA when this will be done? Days/weeks/months away?

Thanks,

Timo

0

I want to end it until the end of the February.

Best regards,
Alexander Podkhalyuzin.

0
Avatar
Permanently deleted user

What is the status on this?

0

Actually I've done changes, which I want to do, but your problem is still here. I'll check it now then.

Best regards,
Alexander Podkhalyuzin.

0

Ok, that was another problem with package object names (which is `package` and `package$` in Java). It's also fixed now. Next update will contain this fix.
So now example with "import play.*" is also works. Thank you.

Best regards,
Alexander Podkhalyuzin.

0
Avatar
Permanently deleted user

Hello Alexander

I have a couple of questions

a) Are you saying that this is fixed in 0.5.429 of the Scala plugin?

b) I tried downloading the plugin and installing but the plugin is not activated (apparently it is not compatible with Idea Ultimate 11.0.2).
Am I missing a dependency? I am able to install 0.5.392 without issues from the Settings -> plugins -> Browse repositories

Thanks
-Rao

0

IntelliJ IDEA 11.1 will be released soon, you can just wait it. And yes, 0.5.429 contains this fix.

Best regards,
Alexander Podkhalyuzin.

0
Avatar
Permanently deleted user

Thanks for the clarification and your prompt response.

0

Please sign in to leave a comment.