Top-level "package" and "import" statements should generally be kept on one
line, for all languages.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Format/TokenAnnotator.cpp | ||
---|---|---|
1079 ↗ | (On Diff #191627) | Nit: could we use CurrentToken->isOneOf(Keywords.kw_option,Keyswords.kw_package) |
Comment Actions
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" "package foo.bar; // foo.bar package\n");
I have reverted it in rL356912.
Comment Actions
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 these both.