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

2017-01-25 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL293055: [clang-format] Implement comment reflowing. (authored by krasimir). Changed prior to commit: https://reviews.llvm.org/D28764?vs=85739=85740#toc Repository: rL LLVM

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

2017-01-25 Thread Manuel Klimek via Phabricator via cfe-commits
klimek accepted this revision. klimek added a comment. This revision is now accepted and ready to land. LG https://reviews.llvm.org/D28764 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2017-01-25 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 85739. krasimir marked 2 inline comments as done. krasimir added a comment. - Address review comments. https://reviews.llvm.org/D28764 Files: lib/Format/BreakableToken.cpp lib/Format/BreakableToken.h lib/Format/CMakeLists.txt

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

2017-01-25 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: lib/Format/BreakableToken.cpp:747 +Split SplitBefore, WhitespaceManager ) { + // 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

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

2017-01-25 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added inline comments. Comment at: lib/Format/BreakableToken.cpp:747 +Split SplitBefore, WhitespaceManager ) { + // 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

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

2017-01-25 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. Tried to add some comments around range computations. Most of the time it's about converting range offsets from local line-based values to start-of-token-based offsets. Comment at: lib/Format/BreakableToken.cpp:279-280 + return Content.size() >= 2

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

2017-01-25 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 85737. krasimir marked 3 inline comments as done. krasimir added a comment. - Address comments. Add a bunch of comments about various range computations. https://reviews.llvm.org/D28764 Files: lib/Format/BreakableToken.cpp lib/Format/BreakableToken.h

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

2017-01-25 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added inline comments. Comment at: lib/Format/BreakableToken.cpp:279-280 + return Content.size() >= 2 && + Content != "clang-format on" && + Content != "clang-format off" && + !Content.endswith("\\") && Can we now use delimitsRegion here?

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

2017-01-25 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: lib/Format/ContinuationIndenter.cpp:1158-1159 +CommentPragmasRegex.match(Current.TokenText.substr(2)) || +Current.TokenText.substr(2).ltrim().startswith("clang-format on") || +

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

2017-01-25 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 85725. krasimir marked 8 inline comments as done. krasimir added a comment. - Address review comments. https://reviews.llvm.org/D28764 Files: lib/Format/BreakableToken.cpp lib/Format/BreakableToken.h lib/Format/CMakeLists.txt

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

2017-01-24 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added inline comments. Comment at: lib/Format/BreakableToken.h:42-48 +/// There is a pair of operations that are used to compress a long whitespace +/// range with a single space if that will bring the line lenght under the +/// column limit: +/// -

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

2017-01-24 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir marked an inline comment as done. krasimir added inline comments. Comment at: lib/Format/BreakableToken.h:42-48 +/// There is a pair of operations that are used to compress a long whitespace +/// range with a single space if that will bring the line lenght under the

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

2017-01-24 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added a comment. This is starting to be pretty awesome. The one thing that would help me review the gist of the implementation a bit more is if that had a bit more comments. Perhaps go over the math in the code and put some comments in why we're doing what at various steps.

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

2017-01-24 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: lib/Format/ContinuationIndenter.cpp:1158-1159 +CommentPragmasRegex.match(Current.TokenText.substr(2)) || +Current.TokenText.substr(2).ltrim().startswith("clang-format on") || +

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

2017-01-24 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added inline comments. Comment at: lib/Format/ContinuationIndenter.cpp:1158-1159 +CommentPragmasRegex.match(Current.TokenText.substr(2)) || +Current.TokenText.substr(2).ltrim().startswith("clang-format on") || +

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

2017-01-24 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 85557. krasimir marked 3 inline comments as done. krasimir added a comment. - Address review comments. https://reviews.llvm.org/D28764 Files: lib/Format/BreakableToken.cpp lib/Format/BreakableToken.h lib/Format/CMakeLists.txt

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

2017-01-24 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir marked 3 inline comments as done. krasimir added inline comments. Comment at: lib/Format/BreakableToken.h:55-56 +/// been reformatted, and +/// - replaceWhitespaceBefore, for executing the reflow using a whitespace +/// manager. +/// klimek wrote: >

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

2017-01-23 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added inline comments. Comment at: lib/Format/BreakableToken.h:55-56 +/// been reformatted, and +/// - replaceWhitespaceBefore, for executing the reflow using a whitespace +/// manager. +/// Shouldn't that be called insertBreakBefore for consistency

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

2017-01-23 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 85381. krasimir added a comment. - Add back a test case that I had previously removed for no good reason. https://reviews.llvm.org/D28764 Files: lib/Format/BreakableToken.cpp lib/Format/BreakableToken.h lib/Format/CMakeLists.txt

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

2017-01-23 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 85376. krasimir added a comment. - Add a note about replaceWhitespace in the comments of BreakableToken. https://reviews.llvm.org/D28764 Files: lib/Format/BreakableToken.cpp lib/Format/BreakableToken.h lib/Format/CMakeLists.txt

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

2017-01-23 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added inline comments. Comment at: lib/Format/BreakableToken.h:40 +/// of the content after a split has been used for breaking, and +/// - insertBreak, for executing the split using a whitespace manager. +/// Do we want to describe how replaceWhitespace

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

2017-01-23 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: lib/Format/BreakableToken.h:87 /// space. virtual void replaceWhitespace(unsigned LineIndex, unsigned TailOffset, Split Split, By the way, I got confused, this stays because the

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

2017-01-23 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 85339. krasimir added a comment. - [clang-format] Improve the interface of BreakableToken and add comments. https://reviews.llvm.org/D28764 Files: lib/Format/BreakableToken.cpp lib/Format/BreakableToken.h lib/Format/CMakeLists.txt

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

2017-01-16 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. krasimir added a reviewer: klimek. krasimir added subscribers: ioeric, cfe-commits, mgorny, klimek, djasper. This presents a version of the comment reflowing with less mutable state inside the comment breakable token subclasses. The state has been pushed into the