clang 20.0.0git
|
#include "clang/Rewrite/Core/Rewriter.h"
Public Member Functions | |
RewriteOptions () | |
Public Attributes | |
bool | IncludeInsertsAtBeginOfRange = true |
Given a source range, true to include previous inserts at the beginning of the range as part of the range itself (true by default). | |
bool | IncludeInsertsAtEndOfRange = true |
Given a source range, true to include previous inserts at the end of the range as part of the range itself (true by default). | |
bool | RemoveLineIfEmpty = false |
If true and removing some text leaves a blank line also remove the empty line (false by default). | |
Definition at line 38 of file Rewriter.h.
|
inline |
Definition at line 62 of file Rewriter.h.
Given a source range, true to include previous inserts at the beginning of the range as part of the range itself (true by default).
Definition at line 41 of file Rewriter.h.
Referenced by clang::Rewriter::getRangeSize(), and clang::Rewriter::InsertTextAfterToken().
Given a source range, true to include previous inserts at the end of the range as part of the range itself (true by default).
Definition at line 45 of file Rewriter.h.
Referenced by clang::Rewriter::getRangeSize().
If true and removing some text leaves a blank line also remove the empty line (false by default).
FIXME: This sometimes corrupts the file's rewrite buffer due to incorrect indexing in the implementation (see the FIXME in llvm::RewriteBuffer::RemoveText). Moreover, it's inefficient because it must scan the buffer from the beginning to find the start of the line. When feasible, it's better for the caller to check for a blank line and then, if found, expand the removal range to include it. Checking for a blank line is easy if, for example, the caller can guarantee this is the first edit of a line. In that case, it can just scan before and after the removal range until the next newline or begin/end of the input.
Definition at line 60 of file Rewriter.h.
Referenced by clang::Rewriter::RemoveText().