clang: clang::DeclFilterCCC< C > Class Template Reference (original) (raw)
Simple template class for restricting typo correction candidates to ones having a single Decl* of the given type. More...
#include "[clang/Sema/TypoCorrection.h](TypoCorrection%5F8h%5Fsource.html)"
Public Member Functions | |
---|---|
DeclFilterCCC (const IdentifierInfo *Typo=nullptr, NestedNameSpecifier *TypoNNS=nullptr) | |
bool | ValidateCandidate (const TypoCorrection &candidate) override |
Simple predicate used by the default RankCandidate to determine whether to return an edit distance of 0 or InvalidDistance. | |
std::unique_ptr< CorrectionCandidateCallback > | clone () override |
Clone this CorrectionCandidateCallback. | |
![]() |
|
CorrectionCandidateCallback (const IdentifierInfo *Typo=nullptr, NestedNameSpecifier *TypoNNS=nullptr) | |
virtual | ~CorrectionCandidateCallback ()=default |
virtual bool | ValidateCandidate (const TypoCorrection &candidate) |
Simple predicate used by the default RankCandidate to determine whether to return an edit distance of 0 or InvalidDistance. | |
virtual unsigned | RankCandidate (const TypoCorrection &candidate) |
Method used by [Sema::CorrectTypo](classclang%5F1%5F1Sema.html#a6120561015b463e46bc6e299de250c6f "Try to "correct" a typo in the source code by finding visible declarations whose names are similar to...") to assign an "edit distance" rank to a candidate (where a lower value represents a better candidate), or returning InvalidDistance if the candidate is not at all viable. | |
virtual std::unique_ptr< CorrectionCandidateCallback > | clone ()=0 |
Clone this CorrectionCandidateCallback. | |
void | setTypoName (const IdentifierInfo *II) |
void | setTypoNNS (NestedNameSpecifier *NNS) |
Additional Inherited Members | |
---|---|
![]() |
|
bool | WantTypeSpecifiers = true |
bool | WantExpressionKeywords = true |
bool | WantCXXNamedCasts = true |
bool | WantFunctionLikeCasts = true |
bool | WantRemainingKeywords = true |
bool | WantObjCSuper = false |
bool | IsObjCIvarLookup = false |
bool | IsAddressOfOperand = false |
![]() |
|
static const unsigned | InvalidDistance = TypoCorrection::InvalidDistance |
![]() |
|
bool | MatchesTypo (const TypoCorrection &candidate) |
![]() |
|
const IdentifierInfo * | Typo |
NestedNameSpecifier * | TypoNNS |
template<class C>
class clang::DeclFilterCCC< C >
Simple template class for restricting typo correction candidates to ones having a single Decl* of the given type.
Definition at line 366 of file TypoCorrection.h.
◆ clone()
◆ ValidateCandidate()
Simple predicate used by the default RankCandidate to determine whether to return an edit distance of 0 or InvalidDistance.
This can be overridden by validators that only need to determine if a candidate is viable, without ranking potentially viable candidates. Only ValidateCandidate or RankCandidate need to be overridden by a callback wishing to check the viability of correction candidates. The default predicate always returns true if the candidate is not a type name or keyword, true for types if WantTypeSpecifiers is true, and true for keywords if WantTypeSpecifiers, WantExpressionKeywords, WantCXXNamedCasts, WantRemainingKeywords, or WantObjCSuper is true.
Reimplemented from clang::CorrectionCandidateCallback.
Definition at line 372 of file TypoCorrection.h.
References clang::C, and clang::TypoCorrection::getCorrectionDeclAs().
The documentation for this class was generated from the following file:
- include/clang/Sema/TypoCorrection.h