Compiler for scala in IDEA 14 does not fail on errors

Having created new SBT projects from Typesafe Activator for play and scala, I tested the compiler by putting garbage in my code, the compiler never manages to report errors.
I have tried the following:

  • Uninstalled 14 and all previous versions and removed any user settings (Mac) and installed 14 fresh
  • Uninstalled and reinstalled the scala plugin 1.0 - and manually invalidated caches
  • Used the following compilers:

    • Scala compiler server
    • IDEA compiler (incremental and non-incremental)
    • SBT compiler
  • Created a fresh Play 2 SBT project only within Idea 14
  • Created a standard scala project from Activator
  • Changed the scala version from 2.11.1 -> 2.11.4
  • Changed the Play Framework version up to latest 2.3.6

The result of the above tests all resulted in the compiler failing to report errors.

I have created a standard scala SBT project only within Idea 14 and that DID catch errors on compilation - but this was the only test that worked. Having had success with this, I then changed through all compiler options and still got positive results.

So it looks like a problem compiling Typesafe Activator / Play 2 scala projects

At the moment I can only use Idea as a very expensive text editor and then compile from command line with SBT - so really hoping this gets resolved soon.
0
42 comments

Hello,

can you attach file scala.xml from ~/Library/Preferences/IntellijIdea14/options (for OS X) ot USER\.IntellijIdea14\config\options (Win)  please?

0

Please find attached


Also forgot to mention last night I cleared my ivy cache as well - thankfully I have fast internet connection to grab everything again :-)



Attachment(s):
scala.xml
0

I am having problems with Scala and Play 2 projects with IDEA 14. Here is a link to a public repo of a Play project I generated with activator https://github.com/DougC/idea14-issue

I have created a new IDEA project by importing this as an SBT project and let IDEA do its thing to create the .idea files. If I then "make project", the compile reports that it built in 3 seconds, but there are no generated class files in the target directory. If I introduce a deliberate error into the Application.scala controller and "make project" the status bar reports "All files are up-to-date". The file is not compiled and no errors are reported.

I used to have a similar issue in Idea 13 when I had both the Scala plugin and the Play 2 plugin active. I uninstalled the Play 2 plugin for this reason. Now that the two plugins have been merged that is not an option. This is a complete show-stopper for me and I have reverted to using Idea 13 for the time being.

For reference I have zipped up the generated .idea directory and attached it.

Doug



Attachment(s):
dotidea.zip
0

I have the same problem.
I tried to add the project with clean sources using just the SBT importer on intellij.Still doesn't work
I checked the logs and it has no errors, just says that compilation finished and that it is fine.
Tried with both IDEA and SBT compilers.

0

I seem to have resolved this. I have completely re-installed IDEA 14 after deleting the ~/Library/Preferences/IntelliJIdea14 directory. Rather than importing my Idea 13 settings, as I did before, I accepted all the defaults, installed the Scala plugin and re-imported the project. It now compiles correctly and reports errors.

0

I even cleaned some other folders i found that had logs and caches and I can't get it to work.
Is your IDE version the one in the web page or a beta?

0

I have since cleared out all references to IntelliJ and performed a clean install with no porting of settings and the compiler works as expected. Thanks to all for giving your input - saved me from insanity :^O Back to awesome scala code...

For others reference I did choose to run Idea with JDK 1.8 - but I dont think this was the problem, it looked like old Idea 13 settings mutating something in Idea 14.

0

(Deleted)

Edit: After a lot of cleaning it seems to be working.

Great work JetBrains :D

0

OK update: I have restarted my machine from scratch and the compiler has stopped picking up errors - back to the original problem - I will try clearning our again before reverting back to Idea 13

0

I am having the same/similar issues with my Play project. Upgraded to 14, deleted all preferences and restarted. In my project I deleted all .idea directories and recreated the projects by opening the build.sbt files.

The project is created successfully, but compiling just reports that it was successful without actually compiling, errors in code don't result in compilation errors and the source highlighting is full of red sybmols. Things seem pretty unusable at the moment.

I created a scala project from scratch , and that worked correctly.

0

Same here. I didn't even need to restart. I simply shut down IDEA 14 and re-opened it and now the  play compiler is no longer compiling.

:(

0

Hi Dimitri, was the scala.xml helpful?

0

Yes, thank you. Do you have problem with project brims-mobile or do you have another projects with the same issue?

0

Same problem here! It's extremely annoying that IDEA doesn't want to build the Play2 project..

0

I have the same exact problem - I have to work using IntelliJ 13 which is not ideal plus I have to disable the Play 2.0 plugin otherwise I get the same problem. Scala plugin v1.1.1 for IntelliJ 14 didn't fix the issue. Is this being monitored and / or tracked as an official bug as lots of people are facing this?

0

I have not seen any progress on this since my original post - every now and then I get hold of the nightly build for the plugin in hope - but no.

For the moment, I am back to Idea 13 and using SBT in the console.

One thing that I am suprised at is how few people are developing in Play 2 Scala on idea or how quiet people are being.

I am happy to provide any testing that is necessary to get this fixed as it makes my upgrade license worthless.

0

Yes, it would be really great to hear whether any work is being done on this. I also cannot use Idea 14 until things start working here. I would also be happy to test things or provide additional diagnostics.

I have Idea 13 working pretty well right now so I don't have a huge need to use the new version, but I always like to check out the newer versions so that I can keep my project running smoothly and take advantage of the improvements in the Scala plugin. I'm generally the guinea pig in my team for testing things out and then recommending to the team when to upgrade.

So I'll ask explicitly, is there anything that you guys (Alexander, et. al.) need as plugin developers to investigate this?

Thanks!

0

Since my last post I have no issues it works flawlessly.
I never had this working before.
After I cleaned all the stuff and added the new project with the build.sbt in the clean project root, it constructed everything and made it work just fine.

0

I tried doing that myself, deleting all .idea and target directories, installing into a fresh Idea 14 where I had not migrated my settings from 13. It didn't work for me, so I'm curious why you had this success. But thanks for the clarification that it is still working properly. I'll try it again when I have some free time, if I don't hear anything with respect to a new version that fixes issues.

0

Can you please outline what exact steps you performed? For me cleaning everything IDEA-related and reinstalling from the scratch doesn't solve the problem

0

I do not know what are the exact steps because I was doing some random changes to make it work. Although I will try to enumerate then here.

  • Delete Intellij using some program like AppClean to make sure it removes all the chaches and trash
  • Remove all the trash folders from the project (target, idea,  etc) usually can be done with 'git clean -dxf'
  • Install intellij idea ultimate with default configurations adding scala plugin in the end
  • Do not import your settings (not sure if they can mess with build or not)
  • Setup Oracle JDK8 (this is the version I'm using and that I need for my project)
  • Add project to intellij by double clicking build.sbt and then selecting all the options
  • Wait for the downloads
  • Turn Compiler server on
  • Do full rebuild of the project t in the build tab


I'm not sure if i did anything else but this night be all
NOTES

  • I remember to build manually the project in the terminal with sbt (not play) not sure if it has anything to do
  • After first compilation I think u added scala SDK as global not sure if this matters too

  • Hope it helps you guys
0

I appreciate your help, but my issue is still there. I can't believe noone from IntelliJ is not reacting to this

0

Hello,

sorry for terrible delay, I was sure this info was added to the web help: did you try to explicitly enable Play2 compiler for your project? This is here: Settings -> Languages & Frameworks -> Play2. There are 3 settings: enable compiler or not; Play2 module (i.e. module where Play2 is used) and project uri (i.e. the root of your sbt project, for projects imported with our sbt support it is content root of the project).


Best regards,
Dmitry Naydanov

0

Ok, this is very obscure option. Shouldn't IDEA automatically detect Play?

Anyways, this didn't change anything for me? I removed the .idea folder from my project and imported it again with IDEA.
Checked 'Use Play2 compiler for this project" (tried both Module 'root' and Module 'root-build' - not sure what's the difference)

The result is the same - IDEA resolves all the dependences from the build.sbt and even highlights errors in code, but when Build Project is selected nothings happens

That 'All files are up-to-date' message you can see at the screenshot is the only result of selecting "Make Project'



Attachment(s):
Screen Shot 2014-11-19 at 6.26.18 PM.png
0

Hi Dimitry,

Unfortunately this did not work, I had previously tried this and also went through the same steps as Anton and I get the same problem. I hope this helps you diagnose this Bug.

Also with regards to the Play 2 preferences. Elsewhere in Idea, whereever there is an input to place a URI/path - a button is placed at the right of the input to bring up a file browser. Not having this consistent interface element could, and I suspect has, confused end-users.

As things stand Idea is not fit for purpose as an IDE for Play 2 scala, I would like to help you resolve this, clearly there is an issue that is consistent for a number of people. If this cannot be reolved I will be requesting a refund of my license fee and looking at alternative IDEs.

Kind regards

Matt

0

Dmitry,

I have updated IntelliJ 14 to the latest version with all the latest plugins and still no joy. When I change a file and make the project Idea still insists that no files have changed and does not even attempt to compile.

This problem is a complete show-stopper for our use of IntelliJ 14 here and I am very disappointed by the lack of any real response from you on this board. Last week I specifically created a sample project that demonstrates the problem and posted the link to the github project but you have given no indication that you have even tried to test it.

If we don't get a resolution to this issue soon I will be requesting a refund of my license.

Doug

0

Unless I am very much mistaken, this is this bug:  https://youtrack.jetbrains.com/issue/SCL-7776, currently unresolved :-(

ATB

0

We finally found problem. Fix is available in nightly builds: http://confluence.jetbrains.com/display/SCA/Scala+Plugin+Nightly+Builds+for+Cassiopeia
We will move fixes to release build today (and upload it too). However would be great if you check that it's really fixed. Thank you! And sorry for slow reaction and inconveniences due to this bug. Actual problem was in IDEA 14 API change, it was hard to recognize.

Best regards,
Alexander Podkhalyuzin.

0

Great thanks it works

0

This is an improvement, in that Idea 14 will now re-compile scala file when I change them. However, it is not compiling Play2 resources at all (e.g. template files or routes files) regardless of whether I select "Play2->Use Play 2 compiler" or not. In fact, that option seems to have no effect on my imported project as the messages always report Play 2 Compiler.

The other comment I have is that re-compiles now take a lot longer on my complex project than they did in IntelliJ13 even if I only change a single scala file. To be clear, I was not using the Play 2 plugin in 13 as I had always suffered the same problems as have been reported here. I guess that the Play 2 compiler does not make use of the incremental compile server.

In summary, 14 now "works" for me in that I can actually work on scala, but I now have degraded performance without any benefit of Idea compiling play 2 resources.

-- Doug

0

Please sign in to leave a comment.