Invariably as code evolves, some lonely unused definitions are are left around. To help you find and eradicate these, IDEA now highlights unused vals, vars, and defs.
You can use the quick fix to delete the unused symbol.
Similarly, IDEA highlights needless vars, that is, ones that are never assigned to, with a quick fix to convert it to a val.
Currently this reference checking is not enabled for cross-file references, you still need to use Find Usages for these. This means that only locals and private class members are highlighted.
It is also disabled for implicit members, and for methods with special names (apply/unapply/update/map/flatMap/filter/withFilter/foreach), for which the reference checking is not yet comprehensive.