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) }
foo(s)


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
              foo(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
3 comments

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

Best regards,
Alexander Podkhalyuzin.

0

I can see what you are talking about under "How to configure it" here: http://blog.jetbrains.com/scala/2011/03/02/type-aware-highlighting/  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



Attachment(s):
Screenshot from 2013-11-11 08:06:47.png
0

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.

0

Please sign in to leave a comment.