Bera
Bera

Reputation: 1282

IntelliJ show errors in scala source files but the project compiles successfully

I'm working with project in intellij IDEA IDE based in maven. I can perform all maven goals but IntelliJ is showing a lot of errors in the source code like bellow:

enter image description here

Everything worked fine a few hours ago. I don't understand why the IDE continue showing errors. When I rebuild or compile the entire project (CTRL + F9) or a single scala class I always receive a success message like that:

enter image description here

I already had configured scala plugin before, so I don't know what is happen.

thanks for your help

Upvotes: 7

Views: 4223

Answers (4)

uris
uris

Reputation: 6223

Sometimes the IntelliJ cache gets corrupted. You can fix this by the following:

File > "Invalidate Caches / Restart"

After choosing "Invalidate and Restart" when prompted, IntelliJ will restart and rebuild its cache.

Upvotes: 7

Bera
Bera

Reputation: 1282

thanks for your responses.

I solved this problem importing the project again.

Upvotes: 0

Randall Schulz
Randall Schulz

Reputation: 26486

If IDEA has lost track of obviously correct types such as Database or DateTime it probably means the configuration of the project is wrong or corrupted. Most commonly it does not have the required 3rd part dependencies such as Joda Time.

If you're not already doing so, define your project solely in SBT and use the sbt-idea plug-in to produce your IDEA project definition. Then whenever you change the project dependencies, re-run gen-idea to regenerate your IDEA project files. No muss, no fuss.

Upvotes: 2

Channing Walton
Channing Walton

Reputation: 4007

There are many bugs raised in jetbrains's bug tracker for this. I suggest you raise some bugs or vote for existing ones.

It loos like the problem you have is with the type aware highlighting which is worse than useless.

Upvotes: 1

Related Questions