ClangFormat incorrect block indentation

Viewed 190

The closing bracket of the if statement is incorrectly indented:

if (1) {
  2;
  }
var x = 3;

Placing a semicolon after the closing bracket seems to solve the problem, but it is undesirable.

The command line options are clang-format -style="{Language: JavaScript}" test.js.

I went through the style options documentation to no avail. Is that a bug, or is there a way to configure the formatter to correctly indent the block?

0 Answers
Related