Bug 454137 - Code formatter should have option to not preserve only code blocks existing empty lines
Summary: Code formatter should have option to not preserve only code blocks existing e...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.4.1   Edit
Hardware: All All
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Manoj N Palat CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-04 09:50 EST by Ricardo Jorge PC de Almeida CLA
Modified: 2014-12-10 11:22 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ricardo Jorge PC de Almeida CLA 2014-12-04 09:50:50 EST
I want to preserve 1 empty line only in block of codes, but not in class definition, conditional statements, methods, etc...

So I set 1 line to preserve, but it preserves for everything. For example:

public class A

extends B

implements I

{
    public void method()
    
    throws Exception
    
    {
        
        if (1 > 2)
        
        {
            
            C.method();
            
            
            
            
            D.method();
        } else {
            
            
            C.method();
            
            
            
            D.method();
        }
        
    }
    
}

gets formatted as

public class A

extends B

implements I

{
    public void method()
    
    throws Exception
    
    {
        
        if (1 > 2)
        
        {
            
            C.method();
            
            D.method();
        } else {
            
            C.method();
            
            D.method();
        }
        
    }
    
}

instead of

public class A extends B implements I {
    public void method() throws Exception {
        if (1 > 2) {
            C.method();
            
            D.method();
        } else {
            C.method();
            
            D.method();
        }
    }
}