문제

I like to use curly brackets in this fashion

void hello()
{
    code();
}

When I press Ctrl + Shift + F in Eclipse it changes everything to

void hello(){
    code();
}
도움이 되었습니까?

해결책

Window/Preferences/Java/Code style/Formatter view:

Create a new profile based on the eclipse built in, then go to braces tab and change "same line" to next line everywhere. Then set the new profile to default.

다른 팁

Window -> Preferences -> Java -> Code Style -> Formatter -> Braces

Window > Preferences > Java > Code Style > Formatter

In Eclipse, go to Windows -> Preferences -> Java -> Formatter. Choose the Formatter you have. Click on Edit... Go to Tab "Braces". Change as suitable.

In Eclipse, go to Windows -> Preference -> Java -> Formatter. In Active Profile drop down box, select any profile, click Edit on right of it. In Profile Dialog box opened, you can change a lot of things like Indentation, New Line, Braces, White Spaces etc. Alternatively, if your profile is altogether different than standard one, Create a new active profile and then edit it accordingly.

:)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top