|
clang-tools 22.0.0git
|
A provider of fix-it hints to insert opening and closing braces. More...
#include <BracesAroundStatement.h>
Public Member Functions | |
| BraceInsertionHints ()=default | |
| Constructor for a no-hint. | |
| BraceInsertionHints (SourceLocation DiagnosticPos) | |
| Constructor for a valid hint that cannot insert braces automatically. | |
| BraceInsertionHints (SourceLocation OpeningBracePos, SourceLocation ClosingBracePos, std::string ClosingBrace) | |
| Constructor for a hint offering fix-its for brace insertion. | |
| operator bool () const | |
| Indicates whether the hint provides at least the position of a diagnostic. | |
| 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. | |
| FixItHint | closingBraceFixIt () const |
| Fix-it to insert a closing brace. | |
Public Attributes | |
| SourceLocation | DiagnosticPos |
| The position of a potential diagnostic. | |
A provider of fix-it hints to insert opening and closing braces.
An instance of this type is the result of calling getBraceInsertionsHints below.
Definition at line 23 of file BracesAroundStatement.h.
|
default |
Constructor for a no-hint.
|
inline |
Constructor for a valid hint that cannot insert braces automatically.
Definition at line 33 of file BracesAroundStatement.h.
References DiagnosticPos.
|
inline |
Constructor for a hint offering fix-its for brace insertion.
Both positions must be valid.
Definition at line 38 of file BracesAroundStatement.h.
References DiagnosticPos, and offersFixIts().
| FixItHint clang::tidy::utils::BraceInsertionHints::closingBraceFixIt | ( | ) | const |
Fix-it to insert a closing brace.
Definition at line 42 of file BracesAroundStatement.cpp.
| bool clang::tidy::utils::BraceInsertionHints::offersFixIts | ( | ) | const |
Indicates whether the hint provides fix-its to insert braces.
Definition at line 26 of file BracesAroundStatement.cpp.
Referenced by BraceInsertionHints().
| FixItHint clang::tidy::utils::BraceInsertionHints::openingBraceFixIt | ( | ) | const |
Fix-it to insert an opening brace.
Definition at line 36 of file BracesAroundStatement.cpp.
| clang::tidy::utils::BraceInsertionHints::operator bool | ( | ) | const |
Indicates whether the hint provides at least the position of a diagnostic.
Definition at line 24 of file BracesAroundStatement.cpp.
References DiagnosticPos.
| unsigned clang::tidy::utils::BraceInsertionHints::resultingCompoundLineExtent | ( | const SourceManager & | SourceMgr | ) | const |
The number of lines between the inserted opening brace and its closing counterpart.
Definition at line 30 of file BracesAroundStatement.cpp.
| SourceLocation clang::tidy::utils::BraceInsertionHints::DiagnosticPos |
The position of a potential diagnostic.
It coincides with the position of the opening brace to insert, but can also just be the place to show a diagnostic in case braces cannot be inserted automatically.
Definition at line 27 of file BracesAroundStatement.h.
Referenced by BraceInsertionHints(), BraceInsertionHints(), and operator bool().