Before:
@Annotation1 // comment
@Annotation2 class C {}
After:
@Annotation1 // comment
@Annotation2
class C {}
llvm-svn: 222825
Current.Previous->is(tok::at) &&
Current.isNot(Keywords.kw_interface)) {
const FormatToken &AtToken = *Current.Previous;
- if (!AtToken.Previous || AtToken.Previous->is(TT_LeadingJavaAnnotation))
+ const FormatToken *Previous = AtToken.getPreviousNonComment();
+ if (!Previous || Previous->is(TT_LeadingJavaAnnotation))
Current.Type = TT_LeadingJavaAnnotation;
else
Current.Type = TT_JavaAnnotation;
verifyFormat("@Override\n"
"@Nullable\n"
"public String getNameIfPresent() {}");
+ verifyFormat("@Override // comment\n"
+ "@Nullable\n"
+ "public String getNameIfPresent() {}");
verifyFormat("@SuppressWarnings(value = \"unchecked\")\n"
"public void doSomething() {}");