clang 20.0.0git
|
Public Member Functions | |
LeftRightQualifierAlignmentFixer (const Environment &Env, const FormatStyle &Style, const std::string &Qualifier, const std::vector< tok::TokenKind > &ConfiguredQualifierTokens, bool RightAlign) | |
std::pair< tooling::Replacements, unsigned > | analyze (TokenAnnotator &Annotator, SmallVectorImpl< AnnotatedLine * > &AnnotatedLines, FormatTokenLexer &Tokens) override |
void | fixQualifierAlignment (SmallVectorImpl< AnnotatedLine * > &AnnotatedLines, FormatTokenLexer &Tokens, tooling::Replacements &Fixes) |
const FormatToken * | analyzeRight (const SourceManager &SourceMgr, const AdditionalKeywords &Keywords, tooling::Replacements &Fixes, const FormatToken *Tok, const std::string &Qualifier, tok::TokenKind QualifierType) |
const FormatToken * | analyzeLeft (const SourceManager &SourceMgr, const AdditionalKeywords &Keywords, tooling::Replacements &Fixes, const FormatToken *Tok, const std::string &Qualifier, tok::TokenKind QualifierType) |
Public Member Functions inherited from clang::format::TokenAnalyzer | |
TokenAnalyzer (const Environment &Env, const FormatStyle &Style) | |
std::pair< tooling::Replacements, unsigned > | process (bool SkipAnnotation=false) |
Public Member Functions inherited from clang::format::UnwrappedLineConsumer | |
virtual | ~UnwrappedLineConsumer () |
virtual void | consumeUnwrappedLine (const UnwrappedLine &Line)=0 |
virtual void | finishRun ()=0 |
Static Public Member Functions | |
static tok::TokenKind | getTokenFromQualifier (const std::string &Qualifier) |
Additional Inherited Members | |
Protected Member Functions inherited from clang::format::TokenAnalyzer | |
virtual std::pair< tooling::Replacements, unsigned > | analyze (TokenAnnotator &Annotator, SmallVectorImpl< AnnotatedLine * > &AnnotatedLines, FormatTokenLexer &Tokens)=0 |
void | consumeUnwrappedLine (const UnwrappedLine &TheLine) override |
void | finishRun () override |
Protected Attributes inherited from clang::format::TokenAnalyzer | |
FormatStyle | Style |
LangOptions | LangOpts |
const Environment & | Env |
AffectedRangeManager | AffectedRangeMgr |
SmallVector< SmallVector< UnwrappedLine, 16 >, 2 > | UnwrappedLines |
encoding::Encoding | Encoding |
Definition at line 44 of file QualifierAlignmentFixer.h.
clang::format::LeftRightQualifierAlignmentFixer::LeftRightQualifierAlignmentFixer | ( | const Environment & | Env, |
const FormatStyle & | Style, | ||
const std::string & | Qualifier, | ||
const std::vector< tok::TokenKind > & | ConfiguredQualifierTokens, | ||
bool | RightAlign | ||
) |
Definition at line 527 of file QualifierAlignmentFixer.cpp.
|
overridevirtual |
Implements clang::format::TokenAnalyzer.
Definition at line 535 of file QualifierAlignmentFixer.cpp.
References clang::format::TokenAnalyzer::AffectedRangeMgr, clang::format::AffectedRangeManager::computeAffectedLines(), and fixQualifierAlignment().
const FormatToken * clang::format::LeftRightQualifierAlignmentFixer::analyzeLeft | ( | const SourceManager & | SourceMgr, |
const AdditionalKeywords & | Keywords, | ||
tooling::Replacements & | Fixes, | ||
const FormatToken * | Tok, | ||
const std::string & | Qualifier, | ||
tok::TokenKind | QualifierType | ||
) |
Definition at line 370 of file QualifierAlignmentFixer.cpp.
References clang::format::FormatToken::ClosesRequiresClause, clang::format::FormatToken::ClosesTemplateDeclaration, clang::format::FormatToken::endsSequence(), clang::format::FormatToken::getPreviousNonComment(), clang::format::insertQualifierBefore(), clang::format::FormatToken::is(), clang::format::isConfiguredQualifier(), clang::format::isConfiguredQualifierOrType(), clang::format::FormatToken::isNot(), clang::format::FormatToken::isOneOf(), clang::format::FormatToken::isPointerOrReference(), clang::format::isPossibleMacro(), clang::format::isQualifier(), clang::format::FormatToken::isTypeName(), clang::format::TokenAnalyzer::LangOpts, clang::format::FormatToken::MatchingParen, Previous, clang::format::removeToken(), and clang::format::rotateTokens().
Referenced by fixQualifierAlignment().
const FormatToken * clang::format::LeftRightQualifierAlignmentFixer::analyzeRight | ( | const SourceManager & | SourceMgr, |
const AdditionalKeywords & | Keywords, | ||
tooling::Replacements & | Fixes, | ||
const FormatToken * | Tok, | ||
const std::string & | Qualifier, | ||
tok::TokenKind | QualifierType | ||
) |
Definition at line 179 of file QualifierAlignmentFixer.cpp.
References clang::format::FormatToken::ClosesRequiresClause, clang::format::FormatToken::ClosesTemplateDeclaration, clang::CharSourceRange::getCharRange(), clang::format::FormatToken::getNextNonComment(), clang::format::FormatToken::getPreviousNonComment(), clang::format::FormatToken::getStartOfNonWhitespace(), clang::format::insertQualifierAfter(), clang::format::FormatToken::is(), clang::format::FormatToken::isNot(), clang::format::FormatToken::isOneOf(), clang::format::isPossibleMacro(), clang::format::isQualifier(), clang::format::isQualifierOrType(), clang::format::FormatToken::isTypeName(), clang::format::TokenAnalyzer::LangOpts, clang::format::FormatToken::Next, Range, clang::format::replaceToken(), and clang::format::rotateTokens().
Referenced by fixQualifierAlignment().
void clang::format::LeftRightQualifierAlignmentFixer::fixQualifierAlignment | ( | SmallVectorImpl< AnnotatedLine * > & | AnnotatedLines, |
FormatTokenLexer & | Tokens, | ||
tooling::Replacements & | Fixes | ||
) |
Definition at line 545 of file QualifierAlignmentFixer.cpp.
References analyzeLeft(), analyzeRight(), clang::format::TokenAnalyzer::Env, clang::First, fixQualifierAlignment(), clang::format::Environment::getSourceManager(), getTokenFromQualifier(), clang::Last, and clang::Line.
Referenced by analyze(), and fixQualifierAlignment().
|
static |
Definition at line 512 of file QualifierAlignmentFixer.cpp.
Referenced by fixQualifierAlignment(), clang::format::prepareLeftRightOrderingForQualifierAlignmentFixer(), and clang::format::validateQualifierOrder().