How to optimize imports for a custom scope

Answered

Hi,

is there an option in IntelliJ Idea 15.0.3 to optimize the imports in all files of a custom scope or all files matching a name pattern?

The dialog for "Code | Optimize imports" does not have such an option.

The dialog for "Code | Reformat Code" has an option to restrict the operation to some scope or file mask but it also reformats code that does not match the code style, which I do not want.

Is there another option (maybe in some plugin?) or a simple workaround to just optimize the imports of some files of a certain type?

Cheers,
Andreas

3 comments
Comment actions Permalink

Sorry, it's not possible right now. There is a backlogged request at https://youtrack.jetbrains.com/issue/IDEABKL-5372.

0
Comment actions Permalink

I wrote a custom plugin now for this functionality: https://plugins.jetbrains.com/plugin/8188

1
Comment actions Permalink

Thanks for your contribution, Andreas!

0

Please sign in to leave a comment.