wmyywm / eclipse-code-formatter-intellij-plugin

Automatically exported from code.google.com/p/eclipse-code-formatter-intellij-plugin
0 stars 0 forks source link

formatting changes every time #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

When i do ctrl-alt-L on a class file my class imports are organized like this:

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.springframework.stereotype.Repository;
import org.springframework.util.StringUtils;

Then when i do again ctrl-alt-L they get rearranged to this

import org.springframework.stereotype.Repository;
import org.springframework.util.StringUtils;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import java.util.List;

So every time i format it reverses the order of the imports. I have followed 
the instructions in the wiki for intellij:

Optimizing imports
set "Class count to use import with '*'" and "Name count to use static import 
with '*'" to 99 or more (Settings - Code Style - Imports)
IntelliJ's Import Optimizing must be turned off (Settings-Editor-Show "Reformat 
Code" dialog...)

Original issue reported on code.google.com by Jorg.Hey...@gmail.com on 17 Apr 2012 at 6:37

GoogleCodeExporter commented 9 years ago
Ive got the same behavior when intellij's import optimizing is turned on.
are you sure you have it disabled? 

check the Settings-Editor-Show "Reformat Code" dialog.. 
and then in that dialog turn off import optimizing.

Original comment by vojta.kr...@gmail.com on 17 Apr 2012 at 7:35

GoogleCodeExporter commented 9 years ago
Hi,

Attached 2 screenshots of my settings. Maybe i missed something ?

Original comment by Jorg.Hey...@gmail.com on 17 Apr 2012 at 7:39

Attachments:

GoogleCodeExporter commented 9 years ago
turn the first on, and then in the reformatting dialog, uncheck import 
optimizing

Original comment by vojta.kr...@gmail.com on 17 Apr 2012 at 7:44

Attachments:

GoogleCodeExporter commented 9 years ago
Right, that did the trick ! I thought the global setting to turn of import 
optimizing would have the same effect, apparently not then :|

Original comment by Jorg.Hey...@gmail.com on 17 Apr 2012 at 8:04

GoogleCodeExporter commented 9 years ago
good.

Original comment by vojta.kr...@gmail.com on 17 Apr 2012 at 8:05