4

In Java, and also in C#, when I use a class that has not been imported, I get a list of suggestions to import. Is this also possible in ScalaIDE?

Thanks

Khanetor
  • 11,595
  • 8
  • 40
  • 76
  • 2
    Yes. I can't post it as an answer, as it's a yes-no question. – Iulian Dragos Nov 12 '14 at 15:15
  • 4
    Yes. Either ctrl-space for completion or ctrl-1 for quickfix works, just as you'd expect. – lmm Nov 12 '14 at 15:19
  • Ah thanks! When I click on the error icon, it says it has no suggestion, but Ctrl-Space does the trick. The problem is, I think it gives me a complete list of all classes in the entire application, and it does not match the one at the cursor. I still have to scroll through a very long list to find the right import. I am doing this in Play framework. – Khanetor Nov 12 '14 at 15:30
  • For those like me who are on Mac OS X Mavericks or above, where installing java 7 is a faff, I had the same problem, but if you place the cursor near the end of the word, Ctrl-Space will show you the list of potential imports that start with that stem, so you do only get a few, appropriate options. – user384842 Feb 14 '15 at 08:05

1 Answers1

4

It turns out that I was using Java 8, which is not compatible with the current version of Scala 2.11.4 as of this post. This messes up the compiler and yields false positive everywhere, and package suggestion is also affected.

I removed Java 8, and then install Java 7. Now Eclipse is happy with Scala.

Khanetor
  • 11,595
  • 8
  • 40
  • 76