4

I know I must be missing something, but can't figure out what. When I create a scala project, following the scala-plugin instructions, not a single syntax error is detected. For example:

object MyApp {
  val aNumber: Int = "hello"
}

does not detect any error. If I right-click and ask it to compile, then I get the expected type mismatch error from the scala compiler. This is just a silly example, no syntax errors are being flagged. For regular Java projects it works fine, so it must be scala specific.

I have a clean install of IDEA 10 CE on a OSX 10.6 and Scala 2.8.1 final. I have set up the jdk in the project settings as well as the scala home when creating the project. I have the latest version of the plugin (12/2010).

Any hint on what I'm missing?

5
  • Did you add the Scala facet to your project? And what is the name of the file in which your MyApp object resides? Commented Jan 2, 2011 at 23:48
  • I've noticed the same thing on my Linux environment. I'm new to IDEA, so I chalked it up to my lack of familiarity. Commented Jan 3, 2011 at 1:00
  • David, my project has the Scala facet. The "MyApp" object is by itself in a "MyApp.scala" file. Commented Jan 3, 2011 at 1:02
  • Also with IntelliJ IDEA 10, I don't notice any error highlighting. I suspect this is not fully implemented yet. Commented Jan 3, 2011 at 4:50
  • I am thinking of migrating to IntelliJ from Netbeans and found the IntelliJ plugin to be quite a disappointment. I don't understand what the hue and cry about Scala on IntelliJ is about unless I missed something. It does not detect simple errors, and even if it does (after the solutions given below), it does not offer a resolution (?) (quite disappointing). I could have used notepad++ and sbt to get the functionality of this plugin. What exactly does the plugin do? Commented Aug 5, 2014 at 10:14

6 Answers 6

3

You have to enable error highlighting. Turn on Settings/Code Style/Scala/Other settings/Enable experimental error highlighting

Sign up to request clarification or add additional context in comments.

1 Comment

I don't have the "Other settings" option.
1

Works here too (IntelliJ 10.0.1, Scala 2.8.1, OpenJDK, Ubuntu 10.10 64bit).

If you want more type checking you can also tick "Enable experimental error highlighting (possibly shows many wrong red code)" in the Settings, but this shouldn't make a difference in your case, although it works perfectly in my case for a large code base.

Comments

1

In project structure > modules > [your project name] > dependencies tab, do you have scala-compiler-[some version] listed?

See the Exploring the Project Structure here

1 Comment

Yes, a scala compiler is listed in the dependencies tab. This is really frustrating.
0

intelliJ IDEA 10.0.1 + scala 2.8.1 on Ubuntu 10.10 64bit.

It shows a type mismatch error

Comments

0

For 2019.1 CE on Mac OS:

Preferences | Build, Execution, Deployment | Compiler | Scala Compiler

Checked the option:

Features->Experimental Features

Comments

0

In the recent versions of IntelliJ Idea (i.e., 2022 version etc), select the "Built-in" Error highlighting option instead of the "Compiler" option in the Error Highlighting dropdown which can be accessed via "Preferences" -> "Languages & Frameworks" -> "Scala" -> "Editor" screen.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.