Skip to content

Auto add brackets to if/else/while/do when format code #2846

Description

@houtaru

Is there a way to add brackets to the if/else/while/do statement when we use format code?

Environment
  • Operating System: Ubuntu 20.04
  • JDK version: 1.8.0, 17.05
  • Visual Studio Code version: 17.05
  • Java extension version:v1.13.0
Steps To Reproduce

Right-click -> Choose Format Doccment

Current Result
publicinttest(intx) {
if (x == 1) returnx + 1;
returnx * 10;
}
Expected Result
publicinttest(intx) {
if (x == 1) {
returnx + 1;
}
returnx * 10;
}
Additional Informations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions