5

When I right-click and follow New->Scala Class, Intellij defaults to creating a new regular class. I'd like it to default to creating a case class.

A small thing... but annoying when creating a lot of new classes.

Is it configurable somewhere?

Greg
  • 10,696
  • 22
  • 68
  • 98

1 Answers1

9
  1. Open File>Settings and go to Files and Code Templates.
  2. Click on + and add name Scala Case Class, set extension to scala and provide correct template. You might copy template from Scala Class and modify it accordingly. enter image description here
  3. Click on New > Scala Class. Dialog should have now option Scala Case Class.
Krzysztof Atłasik
  • 21,985
  • 6
  • 54
  • 76
  • This worked! Is there a way to make it the default in the dialog's options? Thinking it might be alphabetical I gave it a name like "A Scala Case Class" but it still put it at the end. – Greg May 16 '19 at 00:55
  • I can't find a way to move it higher either :/ – Krzysztof Atłasik May 16 '19 at 05:06