Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add extra newline after printing enum values #5649

Merged

Conversation

sanderploegsma
Copy link
Contributor

This partly solves #4129 by adding an extra newline after printing the enum values.

So instead of printing this:

public enum SimpleEnum {

    CONSTANT;}

It now prints this:

public enum SimpleEnum {

    CONSTANT;
}

This does have a small impact on enums with members, as previously they would be printed like this:

public enum EnumWithMembers {

    ONE,
    TWO,
    THREE;
    private static int len = -1;

    public static void f() {
        len = 44;
    }
}

And now they will be printed like this:

public enum EnumWithMembers {

    ONE,
    TWO,
    THREE;

    private static int len = -1;

    public static void f() {
        len = 44;
    }
}

To be honest I prefer the second anyway.

@sanderploegsma sanderploegsma force-pushed the fix/simple-enum-pretty-printing branch from a929ddb to d41cc73 Compare January 31, 2024 21:09
@sanderploegsma sanderploegsma changed the title Add extra newline after printing enum values fix: Add extra newline after printing enum values Feb 1, 2024
Copy link
Collaborator

@SirYwell SirYwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks.

@SirYwell SirYwell merged commit 1d55e5a into INRIA:master Feb 3, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants