2016-10-12 1 views
0

Wenn if Zustand ist sehr groß und nehmen mehr Linien dann Zustand und Körper einen Monoblock werden, weil Standard Spiegelstrich 4 und IDEA ausrichten mehrzeilige if bis 4.IntelliJ IDEA-Code Style - Legen Sie eine leere Zeile oder zusätzliches indent nach mehrere Zustand

if (status != HttpStatus.OK.value() 
    || doc.title().equals("Foo") 
    || list.isEmpty()) { 
    logger.info("Awful readability."); 
    foobar(); 
    ex.execute(this); 
} 

OR

if (status != HttpStatus.OK.value() || 
    doc.title().equals("Foo") || 
    list.isEmpty()) { 
    logger.info("The most horrible readability."); 
    foobar(); 
    ex.execute(this); 
} 

Ablesbarkeit werden so lala. Dazu möchte ich nach Bedingung eine Leerzeile einfügen oder zusätzlichen Einzug für Bedingungen per AutoFormat einfügen.

if (status != HttpStatus.OK.value() 
     || doc.title().equals("Foo") 
     || list.isEmpty()) { 
    logger.info("Good readability."); 
    foobar(); 
    ex.execute(this); 
} 

OR 

if (status != HttpStatus.OK.value() 
    || doc.title().equals("Foo") 
    || list.isEmpty()) { 

    logger.info("Good readability."); 
    foobar(); 
    ex.execute(this); 
} 

Leider kann ich etwas in Code Style Optionen nicht finden.

Antwort

0

Die IntelliJ IDEA-Codeformatierung unterstützt nicht das automatische Einfügen von Leerzeilen in Methodenkörper.

+0

Zusätzliche Einzugsunterstützung? – jimmbraddock

Verwandte Themen