I\'m working with intelliJ and my problem is when I start to import some temporary unused packages into my class file intellij delete those line within a second.
how
For Scala developers: you can have enabled Settings > Editor > General > Auto Import > Optimize imports on the fly but add exclusions into
Settings > Editor > General > Auto Import > Optimize imports on the fly
Settings > Editor > Code Style > Scala > Imports always marked as used: