This is an archive of the discontinued LLVM Phabricator instance.

clang-format: [JS/Java] ignore Objective-C constructs in JS & Java.
ClosedPublic

Authored by mprobst on Apr 26 2017, 4:40 AM.

Details

Summary

Java and JavaScript support annotations and decorators, respectively, that use a leading "@" token. clang-format currently detects this as an Objective-C construct and applies special formatting, for example no whitespace around "=" operators. This change disables the distinction for Java and JavaScript, which leads to normal formatting of single line annotated and initialized properties.

Before:

class X {
  @foo() bar=false;
}

After:

class X {
  @foo() bar = false;
}

Diff Detail

Repository
rL LLVM

Event Timeline

mprobst created this revision.Apr 26 2017, 4:40 AM
djasper accepted this revision.Apr 26 2017, 5:30 AM

Looks good.

This revision is now accepted and ready to land.Apr 26 2017, 5:30 AM
This revision was automatically updated to reflect the committed changes.