llvm-project/clang/lib/Format
Benjamin Kramer dab50463d0 [clang-format] Fix comment aligning when there are changes within the comment
As soon as a comment had whitespace changes inside of the token, we
couldn't identify the whole comment as a trailing comment anymore and
alignment stopped working. Add a new boolean to Change for this special
case and fix trailing comment identification to use it.

This also changes WhitespaceManager to sum the length of all Changes
inside of a token into the first Change.

Before this fix

  int xy;  // a
  int z;   //b

became

  int xy;  // a
  int z;  // b

with this patch we immediately get to:

  int xy;  // a
  int z;   // b

Differential Revision: http://reviews.llvm.org/D16058

llvm-svn: 257341
2016-01-11 16:27:16 +00:00
..
BreakableToken.cpp clang-format: clang-format (NFC) 2015-06-17 13:08:06 +00:00
BreakableToken.h Roll-back r250822. 2015-10-20 13:23:58 +00:00
CMakeLists.txt clang-format: Factor out UnwrappedLineFormatter into a separate file. 2014-12-10 19:00:42 +00:00
ContinuationIndenter.cpp clang-format: Slightly row back on r257257. 2016-01-11 11:01:05 +00:00
ContinuationIndenter.h [clang-format] Use in-class initializers to simplify constructor. 2015-06-12 14:39:08 +00:00
Encoding.h clang-format: Fix crasher when a UTF8 character is found in an escape 2015-07-20 23:28:07 +00:00
Format.cpp clang-format: Fix the counting of leading whitespace in tok::unknown tokens 2016-01-09 21:12:45 +00:00
FormatToken.cpp clang-format: Align long braced init lists even if they are nested in 2016-01-04 07:30:44 +00:00
FormatToken.h clang-format: Improve line wrapping behavior in call sequences. 2016-01-05 13:03:50 +00:00
Makefile
TokenAnnotator.cpp clang-format: Fix overloading "operator," definitions more thoroughly. 2016-01-11 12:55:33 +00:00
TokenAnnotator.h Support AlwaysBreakAfterReturnType 2015-12-18 22:20:15 +00:00
UnwrappedLineFormatter.cpp clang-format: treat Q_SIGNALS as an access modifier 2015-12-01 12:05:04 +00:00
UnwrappedLineFormatter.h clang-format: clang-format (NFC) 2015-06-17 13:08:06 +00:00
UnwrappedLineParser.cpp clang-format: [JS] Support semicolons in TypeScript's TypeMemberLists. 2016-01-09 15:56:28 +00:00
UnwrappedLineParser.h clang-format: [JS] Support semicolons in TypeScript's TypeMemberLists. 2016-01-09 15:56:28 +00:00
WhitespaceManager.cpp [clang-format] Fix comment aligning when there are changes within the comment 2016-01-11 16:27:16 +00:00
WhitespaceManager.h [clang-format] Fix comment aligning when there are changes within the comment 2016-01-11 16:27:16 +00:00