2

I am using eclipse scala ide Scala IDE build of Eclipse SDK Build id: 3.0.4-2.11-20140520-1158-Typesafe . Suggestions feature seems to be missing from it, like if from my test case I write PersonTest.scala

val person = new Person()

since Person class doesn't exist intially, I get a compilation error . Now in case of java if I press Control + 1 ( suggestion ) I get an option to create a class but in case of scala ide this feature seems to be missing .

Can someone pleas help me if there is an alternative or am I missing something ?

Shakti
  • 2,013
  • 8
  • 27
  • 40
  • Note: as mentioned by [sschaef](http://stackoverflow.com/users/2621536/sschaef) in [the comments](http://stackoverflow.com/questions/25100571/control-1-suggestion-doesnt-work-in-eclipse-scala-ide/25101397?noredirect=1#comment39069018_25101397), Scala IDE 4 will have a quick fix to create a new Scala class. See [my edited answer below](http://stackoverflow.com/a/25101397/6309) – VonC Aug 03 '14 at 15:09

1 Answers1

3

No, you don't have that option directly available with Scala in Eclipse (Q2 2014).

You can click shift+alt+n, and select new Scala class instead.


However Scala IDE 4 Lithium (Q3 2014) will propose a new Scala class dialog, and the create method/class quick fix

http://scala-ide.org/docs/_images/create-method.png

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Sad that eclipse ide is not having this feature, but your solution is also good enough to save some time. – Shakti Aug 03 '14 at 04:36
  • In Scala IDE 4 milestones this is supported with CTRL+1. – kiritsuku Aug 03 '14 at 14:48
  • @sschaef indeed. Well spotted. I have included the link to that new feature as well as a screenshot in the answer for more visibility. – VonC Aug 03 '14 at 15:08
  • @VonC - perfect ! You Saved me from an annoying coding practice !! – Shakti Aug 04 '14 at 07:59
  • This feature is having some bugs, If you try to change the package or source path , although it creates a source file but without any body and IDE is not able to recognize this scala class – Shakti Aug 04 '14 at 14:04
  • @Shakti I agree. Hopefully this will be fiexed in a future milestone: Scala IDE 4 isn't released yet. – VonC Aug 04 '14 at 14:16