In Intellij, declaring a companion object in front of its companion class, displays Scala Object Fileinstead Scala Class File(that is, in the left pane of the navigator, it displays O(object file) instead of C(class file)),
I assumed that Intellij will automatically pick up a companion object and will have a scala class file by default, but this is not the case. However, it works fine if I declare a companion object after the companion class.
Is there a setting in Intellij to fix this?
Or should I change my coding style to take this into account? (i.e. is it considered good style to place a companion object after declaring a class in scala? I have so far been used to declare static fieldsbefore instance fields)
source
share