14#include "clang/AST/Stmt.h"
15#include "clang/Basic/Diagnostic.h"
16#include "clang/Basic/SourceLocation.h"
17#include "clang/Basic/SourceManager.h"
39 SourceLocation ClosingBracePos, std::string ClosingBrace)
40 :
DiagnosticPos(OpeningBracePos), OpeningBracePos(OpeningBracePos),
41 ClosingBracePos(ClosingBracePos), ClosingBrace(ClosingBrace) {
46 operator bool()
const;
62 SourceLocation OpeningBracePos;
63 SourceLocation ClosingBracePos;
64 std::string ClosingBrace;
72 const SourceManager &SM, SourceLocation StartLoc,
73 SourceLocation EndLocHint = SourceLocation());
BraceInsertionHints getBraceInsertionsHints(const Stmt *const S, const LangOptions &LangOpts, const SourceManager &SM, SourceLocation StartLoc, SourceLocation EndLocHint)
Create fix-it hints for braces that wrap the given statement when applied.
A provider of fix-it hints to insert opening and closing braces.
BraceInsertionHints()=default
Constructor for a no-hint.
SourceLocation DiagnosticPos
The position of a potential diagnostic.
FixItHint closingBraceFixIt() const
Fix-it to insert a closing brace.
BraceInsertionHints(SourceLocation DiagnosticPos)
Constructor for a valid hint that cannot insert braces automatically.
bool offersFixIts() const
Indicates whether the hint provides fix-its to insert braces.
unsigned resultingCompoundLineExtent(const SourceManager &SourceMgr) const
The number of lines between the inserted opening brace and its closing counterpart.
FixItHint openingBraceFixIt() const
Fix-it to insert an opening brace.
BraceInsertionHints(SourceLocation OpeningBracePos, SourceLocation ClosingBracePos, std::string ClosingBrace)
Constructor for a hint offering fix-its for brace insertion.