llvm-project/clang/lib/Format
Eric Liu bf4c41c7e1 [clang-format] Refactor #include insertion/deletion functionality into a class.
Summary:
The class will be moved into libToolingCore as followup.

The new behaviors in this patch:
- New #include is inserted in the right position in a #include block to
preserver sorted #includes. This is best effort - only works when the
block is already sorted.
- When inserting multiple #includes to the end of a file which doesn't
end with a "\n" character, a "\n" will be prepended to each #include.
This is a special and rare case that was previously handled. This is now
relaxed to avoid complexity as it's rare in practice.

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: klimek, cfe-commits, djasper

Differential Revision: https://reviews.llvm.org/D46180

llvm-svn: 331544
2018-05-04 17:55:13 +00:00
..
AffectedRangeManager.cpp Format closing braces when reformatting the line containing the opening brace. 2018-04-23 09:34:26 +00:00
AffectedRangeManager.h Format closing braces when reformatting the line containing the opening brace. 2018-04-23 09:34:26 +00:00
BreakableToken.cpp [format] Eliminate global destructors. 2018-03-20 21:52:19 +00:00
BreakableToken.h [clang-format] Fix clang-tidy readability problems, NFCI 2018-04-23 10:02:59 +00:00
CMakeLists.txt [clang-format] Support sorting using declarations 2017-06-21 12:03:12 +00:00
ContinuationIndenter.cpp [clang-format] Always indent wrapped Objective-C selector names 2018-04-12 15:11:48 +00:00
ContinuationIndenter.h [clang-format] Do not break Objective-C string literals inside array literals 2018-02-08 16:07:25 +00:00
Encoding.h [Format] Remove dead code. 2016-12-19 21:10:50 +00:00
Format.cpp [clang-format] Refactor #include insertion/deletion functionality into a class. 2018-05-04 17:55:13 +00:00
FormatInternal.h FormatInternal.h: Add missing includes. 2017-11-21 01:09:17 +00:00
FormatToken.cpp Implement P0482R2, support for char8_t type. 2018-05-01 05:02:45 +00:00
FormatToken.h [clang-format] Don't detect C++11 attribute specifiers as ObjC 2018-03-12 15:42:38 +00:00
FormatTokenLexer.cpp [clang] Change std::sort to llvm::sort in response to r327219 2018-03-27 16:50:00 +00:00
FormatTokenLexer.h [clang-format] Support python-style comments in text protos 2017-11-10 12:50:09 +00:00
NamespaceEndCommentsFixer.cpp [clang-format] Fix clang-tidy readability problems, NFCI 2018-04-23 10:02:59 +00:00
NamespaceEndCommentsFixer.h [clang-format] Don't remove empty lines before namespace endings 2018-04-19 13:02:15 +00:00
SortJavaScriptImports.cpp Format closing braces when reformatting the line containing the opening brace. 2018-04-23 09:34:26 +00:00
SortJavaScriptImports.h clang-format: [JS] sort ES6 imports. 2016-05-20 11:24:24 +00:00
TokenAnalyzer.cpp [clang-format] Format raw string literals 2017-10-30 14:01:50 +00:00
TokenAnalyzer.h [clang-format] Format raw string literals 2017-10-30 14:01:50 +00:00
TokenAnnotator.cpp [clang-format/ObjC] Use getIdentifierInfo() instead of tok::identifier 2018-04-27 18:51:12 +00:00
TokenAnnotator.h [clang-format] Fix clang-tidy readability problems, NFCI 2018-04-23 10:02:59 +00:00
UnwrappedLineFormatter.cpp Format closing braces when reformatting the line containing the opening brace. 2018-04-23 09:34:26 +00:00
UnwrappedLineFormatter.h [clang-format] Don't remove empty lines before namespace endings 2018-04-19 13:02:15 +00:00
UnwrappedLineParser.cpp Format closing braces when reformatting the line containing the opening brace. 2018-04-23 09:34:26 +00:00
UnwrappedLineParser.h Format closing braces when reformatting the line containing the opening brace. 2018-04-23 09:34:26 +00:00
UsingDeclarationsSorter.cpp Format closing braces when reformatting the line containing the opening brace. 2018-04-23 09:34:26 +00:00
UsingDeclarationsSorter.h [clang-format] Format raw string literals 2017-10-30 14:01:50 +00:00
WhitespaceManager.cpp [clang] Change std::sort to llvm::sort in response to r327219 2018-03-27 16:50:00 +00:00
WhitespaceManager.h [clang-format] Format raw string literals 2017-10-30 14:01:50 +00:00