Skyost
Skyost

Reputation: 1536

Eclipse formatter : add blank line at the end of the class

I am trying to setup my own profile for the Eclipse's code formatter but I cannot find a way to add a blank line at the end of the class.

public class MyClass {

     public void method() {
          // Something here.
     }
     // Want a blank line here.
}

Here is my current profile.

Upvotes: 5

Views: 1730

Answers (2)

bish
bish

Reputation: 3419

In newer versions there is an option

<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration" value="1"/>

Javadocs of eclipse formatter

Bug issue in status "verify fixed"

Upvotes: 2

E-Riz
E-Riz

Reputation: 32915

There is no such option. The best you can do is set the number of empty lines to preserve and manually insert the blank line.

Upvotes: 3

Related Questions