[PATCH] D28764: [clang-format] Implement comment reflowing (v3)

Krasimir Georgiev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 25 05:56:31 PST 2017


krasimir added inline comments.


================
Comment at: lib/Format/BreakableToken.cpp:747
+    Split SplitBefore, WhitespaceManager &Whitespaces) {
+  // If this is the first line of a token, we need to inform Whitespace Manager
+  // about it: either adapt the whitespace range preceding it, or mark it as an
----------------
klimek wrote:
> What do you mean by "first line of a token"?
Sadly, there are multi-line line comment tokens, as in:
```
// line 1 \
// line 2
```
Add a note about it.


================
Comment at: lib/Format/BreakableToken.h:110-111
+
+  /// \brief Returns a whitespace range (offset, length) of the content at \p
+  /// LineIndex such that the content preceding this range needs to be
+  /// reformatted before any breaks are made to this line.
----------------
klimek wrote:
> I'd keep \p and LineIndex in the same line...
Sadly, that's one thing that the reflowing doesn't support yet...


https://reviews.llvm.org/D28764





More information about the cfe-commits mailing list