[PATCH] D119785: [clang-format] Fix formatting of struct-like records followed by variable declaration.

2022-02-16 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. curdeius marked an inline comment as done. Closed by commit rGd81f003ce141: [clang-format] Fix formatting of struct-like records followed by variable… (authored by curdeius). Changed prior to commit:

[PATCH] D119785: [clang-format] Fix formatting of struct-like records followed by variable declaration.

2022-02-16 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius marked 3 inline comments as done. curdeius added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:735 // We don't merge short records. -FormatToken *RecordTok = Line.First; -// Skip record modifiers. -while

[PATCH] D119785: [clang-format] Fix formatting of struct-like records followed by variable declaration.

2022-02-15 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:735 // We don't merge short records. -FormatToken *RecordTok = Line.First; -// Skip record modifiers. -while (RecordTok->Next && -

[PATCH] D119785: [clang-format] Fix formatting of struct-like records followed by variable declaration.

2022-02-15 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:735 // We don't merge short records. -FormatToken *RecordTok = Line.First; -// Skip record modifiers. -while (RecordTok->Next && -

[PATCH] D119785: [clang-format] Fix formatting of struct-like records followed by variable declaration.

2022-02-15 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:718 if (Line.Last->is(tok::l_brace)) { FormatToken *Tok = I[1]->First; @MyDeveloperDay, probably we'll need to check `LastNonComment` similarly to what I did

[PATCH] D119785: [clang-format] Fix formatting of struct-like records followed by variable declaration.

2022-02-15 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:470 +ShouldMerge = Style.AllowShortEnumsOnASingleLine; + } else if (TheLine->Last->isOneOf(TT_ClassLBrace, TT_StructLBrace)) { +// NOTE: We use AfterClass (whereas

[PATCH] D119785: [clang-format] Fix formatting of struct-like records followed by variable declaration.

2022-02-15 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks accepted this revision. HazardyKnusperkeks added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:470 +ShouldMerge = Style.AllowShortEnumsOnASingleLine; + } else if (TheLine->Last->isOneOf(TT_ClassLBrace, TT_StructLBrace))

[PATCH] D119785: [clang-format] Fix formatting of struct-like records followed by variable declaration.

2022-02-15 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay accepted this revision. MyDeveloperDay added a comment. This revision is now accepted and ready to land. LGTM, I really like the approach of us annotating more like this, it makes the token much easier to reason about when there is ambiguity. nice one! Comment

[PATCH] D119785: [clang-format] Fix formatting of struct-like records followed by variable declaration.

2022-02-14 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius updated this revision to Diff 408629. curdeius added a comment. Remove unused. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119785/new/ https://reviews.llvm.org/D119785 Files: clang/lib/Format/FormatToken.h

[PATCH] D119785: [clang-format] Fix formatting of struct-like records followed by variable declaration.

2022-02-14 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius created this revision. curdeius added reviewers: MyDeveloperDay, HazardyKnusperkeks, owenpan. curdeius requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Fixes https://github.com/llvm/llvm-project/issues/24781. Fixes