dchai added a comment.
Just to confirm, the regression is in the number of spaces before a trailing
comment?
Before (2 spaces):
package foo.bar; // foo.bar package
After (1 space):
package foo.bar; // foo.bar package
Top-level options are handled the same way. I'll see if I can address
hokein added a comment.
This patch has caused a regression issue, see the test:
verifyFormat("// Detached comment\n\n"
"// Leading comment\n"
"syntax = \"proto2\"; // trailing comment\n\n"
"// in foo.bar package\n"
"pac
This revision was automatically updated to reflect the committed changes.
Closed by commit rL356835: [clang-format] Keep protobuf "package"
statement on one line (authored by paulhoad, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rL LLVM
CH
MyDeveloperDay accepted this revision.
MyDeveloperDay added a comment.
This revision is now accepted and ready to land.
LGTM
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59627/new/
https://reviews.llvm.org/D59627
__
dchai updated this revision to Diff 191734.
dchai added a comment.
Use "isOneOf" instead of two calls to "is".
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59627/new/
https://reviews.llvm.org/D59627
Files:
lib/Format/TokenAnnotator.cpp
unittests/Format/Form
MyDeveloperDay added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:1079
if (Style.Language == FormatStyle::LK_Proto && Line.Level == 0 &&
-CurrentToken->is(Keywords.kw_option)) {
+(CurrentToken->is(Keywords.kw_option) ||
+ CurrentToken->i
dchai created this revision.
dchai added a reviewer: sammccall.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Top-level "package" and "import" statements should generally be kept on one
line, for all languages.
Repository:
rC Clang
https://reviews.llvm.org/D59627
Fil