Optimize imports - a few issues

Thanks for taking care of the the spurious scala.Some import!

I'm running into a few issues related to Optimize import. Using scala plugin build 0.39.836 on IDEA v135.1019 ...

  • Doesn't recognize imported implicits as necessary
  • Doesn't recognize when an explicit import is necessary due to ambiguous import. Turns import common.model.location.{AirportDAO, _} into import common.model.location._ making the code reference to AirportDAO ambiguous with another _ import of a different AirportDAO
  • How can I search for scala Unused imports? Only seems to work against Java sources.


Do you want me to submit separate bugs for these, and would you need more information than the points above?

Thanks,
Jon

3 comments
Comment actions Permalink

I just don't like the new "optimize import" stuff - I don't like the
ordering it uses for one thing, or how it automatically rearranges
everything, at the slightest provocation.

Also, I was having some weird problems with two "object"s in the same
file that extended the same trait. Optimize imports kept deleting the
import for the trait - though I'm not sure I could recreate the problem.

On 6/18/14 4:13 AM, Jon Steelman wrote:

Thanks for taking care of the the spurious scala.Some import!

>

I'm running into a few issues related to Optimize import. Using scala plugin build 0.39.836 on IDEA v135.1019 ...

  • Doesn't recognize imported implicits as necessary

  • Doesn't recognize when an explicit import is necessary due to ambiguous import. Turns import common.model.location.{AirportDAO, } into import common.model.location. making the code reference to AirportDAO ambiguous with another _ import of a different AirportDAO

  • How can I search for scala Unused imports? Only seems to work against Java sources.

>

Do you want me to submit separate bugs for these, and would you need more information than the points above?


0
Comment actions Permalink

I just don't like the new "optimize import" stuff - I don't like the
ordering it uses for one thing, or how it automatically rearranges
everything, at the slightest provocation.


I am kind of digging the new optimize import. While the bugs are still around, would be nice to have a way to tell it to not mess with a particular import line.

How would you improve the ordering?

Cheers,
Jon

0
Comment actions Permalink

Hi Jon!

It's possible to tweak "import optimization" settings in Project Settings / Code Style / Scala / Imports tab.

Also, make sure that Settings / Editor / Auto Import / Scala / Optimize imports on the fly is turned off.

It's the first step in that direction, so is troublesome. Please submit all the bugs to YouTrack (separately) and we'll fix them as soon as possible.

All in all, I think that Optimize Import, by itself, is a great feature, we just need to refine the implementation.

0

Please sign in to leave a comment.