javadba javadba - 1 year ago 74
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?

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download