javadba javadba - 3 months ago 24
Scala Question

Automatically filling in data types for <CollectionType>.empty[] in Intellij

The following type of code is quite frequent in

method parameters:

events: Map[BpmId, Seq[BpmEvent]] = Map.empty[BpmId, Seq[BpmEvent]],

So theoretically after having provided the type information and the
the IDE should be able to fill in the rest for us:

events: Map[BpmId, Seq[BpmEvent]] = Map.empty[**IDE fills in the types for us**],

However I have not discovered an Intellij built-in or plugin function to provide that feature. Is there such an animal?


For method arguments, the use of Map() as a default empty-Map value is an option. Type information is preserved.