Scala Plug-In not installed correctly

This post was titled "Scala Plug-In not catching variable scope errors in Scala files" but I now believe the root cause is an improper Scala plugin installation.
Here is a simple class.

class IdeaTest {
  val s = new String()
def foo(a:String) { print(a) }

Clearly s is out of scope when used later in foo.  But in IDEA, no errors are reported.  At the REPL and compiling with scalac I get

error: not found: value s

I'm also finding that it does not catch other undeclared variable errors.
I started playing with the Scala Plug-In over a year ago when installation was a manual process and I remember installing it incorrectly.  I took some time off, but I have since uninstalled it and let it install through the IDEA plugin manager.  I can't rule out a Scala Plug-In installation issue which is why I'm reporting this here instead of filing a bug report.  Any insight?  Does IDEA report the error correctly for you?  It's in the "test" branch of my source tree if that matters.

Ubuntu 12.04 64-bit
IntelliJ IDEA 12.1.6
Build #IU-129.1359, Built on October 4, 2013
JRE: 1.7.0_45
VM: Java HotSpot(TM) 64-bit Server VM by Oracle

Scala Plugin for IntelliJ IDEA Version 0.22.302
Comment actions Permalink

Please enable "type-aware highlighting". In right bottom corner press on [_] icon to have [T].

Best regards,
Alexander Podkhalyuzin.

Comment actions Permalink

I can see what you are talking about under "How to configure it" here:  But I don't get that.  I tried uninstalling the Scala and SBT plugins, then Invalidate Caches, then reinstall, but no luck.  This must be a configuration issue.  I think I must have broken something trying to install an older version of the Scala plugin manually because it all works beautifully on my laptop.  When I search for Scala in Intellij/system/log I find the following two lines:  2013-09-25 11:28:07,798 [   5257]   INFO - llij.ide.plugins.PluginManager - Loaded custom plugins: SBT (1.5.0), Scala (0.19.299)   2013-09-25 11:28:20,802 [  18261]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $APP_CONFIG$/scala_config.xml file is null

Screenshot from 2013-11-11 08:06:47.png
Comment actions Permalink

Close IDEA. Go to .idea directory of your project open highlighting.xml file.

My file looks like:

<?xml version="1.0" encoding="UTF-8"?> <project version="4">   <component name="HighlightingAdvisor">     <option name="SUGGEST_TYPE_AWARE_HIGHLIGHTING" value="false" />     <option name="TYPE_AWARE_HIGHLIGHTING_ENABLED" value="true" />   </component> </project>

So just make "TYPE_AWARE_HIGHLIGHTING_ENABLED" true and open your project again, everything should work after that.

Best regards,
Alexander Podkhalyuzin.


Please sign in to leave a comment.