IntelliJ 13 compiler finds no errors in Play projects, but marker

I am trying to get IntelliJ compiled to let me know about bugs in my source code in a multi-module project using Play Framework 2.3.3 and Scala 2.11.2 - IntelliJ is version 13.1.4 (latest stable, Ultimate Edition).

Multi-module projects are very similar to the play-multidomain-seed project from Adrian Hurt, see https://github.com/adrianhurt/play-multidomain-seed or in the Activator Activator for future reference. The hierarchy looks like this:

/root
   /app
      ...
   /conf
      ...
   /modules
      /module1
         /app
            ...
         /conf
            ...
      /module2
         /app
            ...
         /conf
            ...

      

The root project has build.sbt

as well as a project directory containing a Scala object that contains general settings and helper methods to be used during the build process. Each subproject is located in a folder modules

and also has build.sbt

been referenced at build.sbt

the root level.

Now if I used the previously mentioned project template play-multidomain-seed

I can get everything and work fine using activator

/ sbt

. After I import the project into IntelliJ using the "Import SBT Project" function, I can work with it, but when I run compilation (for example CTRL + F9 for "Make Project") it doesn't matter if I run incremental compilation or full recompilation), it will not display any compile-time errors (such as undecidable characters or other syntax errors). The Scala header in the code editor will show them the correct error message! Running compilation in sbt

/ activator

on the command line will show an error, while IntelliJ simply says "Compilation completed successfully".

The interesting part is that this only happens with sub-projects that are Play projects, a library project using the standard folder layout (i.e. sources in src/main/scala

, etc.) works just fine - i.e. I am getting correct compiler feedback from IntelliJ. The source and resource settings are set correctly according to the IntelliJ Project Structure dialog, that is, the Play subprojects are used app

as the source folder.

I have another project based on Play 2.2.x that uses a single file Build.scala

instead of separate files build.sbt

and works great - I didn't really understand how to "port" the file Build.scala

before Play 2.3 as they changed quite a few things and the docs say that build.sbt

(as far as possible) best practice.

I haven't started reinstalling Scala / Play plugins. I could try this with EAP IntelliJ 14 to see if it changes something. I tried the "Import SBT Project" method to get the project in IntelliJ as well as the Play Framework idea

command and the gen-idea

plugin command sbt-idea

(which should be roughly similar to what is playing because it is using some version / fork of that plugin I think) ... Changing the "Incremental software compilation" setting in Settings -> IDE Options -> Scala from "IntelliJ IDEA" to "incremental sbt compiler" doesn't change anything either.

Has anyone seen this issue, or any ideas on what I could try? It makes me sad :).

TL; DR

If I have an error in the Scala source file, the compilation process initiated by IntelliJ will not report it, sbt

the console will, however, correctly report it. The IntelliJ marker (in the code editor) also marks it as an error with the correct error message (for example, "Unable to resolve character xyz"). This only happens for Play modules, not for "standard" library projects. My guess is that the compiler just doesn't compile the source files in the Play modules for the reason that I don't understand.

+3


source to share


1 answer


So after all this pleasant confusion it turns out that this is an issue with version 0.41 of the Play2 support plugin for IntelliJ, as overriding the Scala and Play 2 plugins to 0.38.441 fixes my problem. You can find these versions at http://plugins.jetbrains.com/update/index?pr=idea&updateId=16633 and http://plugins.jetbrains.com/update/index?pr=idea&updateId=16634 .

It seems like this question looks like this: http://youtrack.jetbrains.com/issue/SCL-7423 - it hasn't officially confirmed that this actually causes this problem, but it seems very related and quite significant nonetheless.



The reason I thought it was related to files build.sbt

was that when refactoring build.sbt

to Build.scala

I installed IntelliJ 14 EAP which updated the Scala / Play plugins and since the plugin shared folder between IntelliJ 13 and 14 EAP it just overwrote them. When I switched back to IntelliJ 13 because 14 EAP did not fix the problem, I only downgraded / activated the Scala plugin version 0.41, while the Play plugin remained deactivated - reactivating it in version 0.41 shows up.

What a journey.

+2


source







All Articles