Mutable/immutable collections prefix convention support

As described here we should prefer the following code style for mutable and immutable collection names:

Scala plugin for IntelliJ IDEA (nightly builds) now supports this code style by default.

First of all, it brings useful code inspection, helping to migrate from different code style:

Second is class name completion and auto-import features. They both support this code style. And everywhere, where you need to import something mutable, it will be imported with such prefix according to this code style.

Third thing is that basic completion considers “import scala.collection.mutable” import as placeholder import. So there is no necessity to use class name completion everytime, when you want to use mutable completion.

And it’s not all. The last thing is that it works not only for collections. You can define any set of classes, which should support such code style.

Check “Settings -> Scala -> Imports -> Classes to use only with prefix”. Here you can add your own classes (if you have some other name clashes), or you can remove current classes (in case if you don’t want to use this code style for mutable colletions).

This entry was posted in Uncategorized. Bookmark the permalink.

3 Responses to Mutable/immutable collections prefix convention support

  1. Great feature! :-)

    I always found it a bit tiresome to manually import mutable and then keep using “mutable.HashSet”, thanks for bringing in all those nice scala specific refactors :-)

  2. OlegYch says:

    thanks, awesome idea

  3. Tammy says:

    I discovered your Mutable/immutable collections prefix convention support | IntelliJ Scala plugin blog page and noticed you could have a lot more traffic. I have found that the key to running a website is making sure the visitors you are getting are interested in your subject matter. There is a company that you can get visitors from and they let you try the service for free. I managed to get over 300 targeted visitors to day to my site. Visit them here:

Leave a Reply

Your email address will not be published. Required fields are marked *