clang API Documentation
#include <SemaInternal.h>
Classes | |
class | NamespaceSpecifierSet |
Public Member Functions | |
TypoCorrectionConsumer (Sema &SemaRef, const DeclarationNameInfo &TypoName, Sema::LookupNameKind LookupKind, Scope *S, CXXScopeSpec *SS, std::unique_ptr< CorrectionCandidateCallback > CCC, DeclContext *MemberContext, bool EnteringContext) | |
bool | includeHiddenDecls () const override |
Determine whether hidden declarations (from unimported modules) should be given to this consumer. By default, they are not included. | |
void | FoundDecl (NamedDecl *ND, NamedDecl *Hiding, DeclContext *Ctx, bool InBaseClass) override |
Invoked each time Sema::LookupVisibleDecls() finds a declaration visible from the current scope or context. | |
void | FoundName (StringRef Name) |
void | addKeywordResult (StringRef Keyword) |
void | addCorrection (TypoCorrection Correction) |
bool | empty () const |
TypoResultList & | operator[] (StringRef Name) |
Return the list of TypoCorrections for the given identifier from the set of corrections that have the closest edit distance, if any. | |
unsigned | getBestEditDistance (bool Normalized) |
Return the edit distance of the corrections that have the closest/best edit distance from the original typop. | |
void | addNamespaces (const llvm::MapVector< NamespaceDecl *, bool > &KnownNamespaces) |
Set-up method to add to the consumer the set of namespaces to use in performing corrections to nested name specifiers. This method also implicitly adds all of the known classes in the current AST context to the to the consumer for correcting nested name specifiers. | |
const TypoCorrection & | getNextCorrection () |
Return the next typo correction that passes all internal filters and is deemed valid by the consumer's CorrectionCandidateCallback, starting with the corrections that have the closest edit distance. An empty TypoCorrection is returned once no more viable corrections remain in the consumer. | |
const TypoCorrection & | getCurrentCorrection () |
Get the last correction returned by getNextCorrection(). | |
void | resetCorrectionStream () |
Reset the consumer's position in the stream of viable corrections (i.e. getNextCorrection() will return each of the previously returned corrections in order before returning any new corrections). | |
bool | finished () |
Return whether the end of the stream of corrections has been reached. | |
ASTContext & | getContext () const |
const LookupResult & | getLookupResult () const |
Definition at line 90 of file SemaInternal.h.
clang::TypoCorrectionConsumer::TypoCorrectionConsumer | ( | Sema & | SemaRef, |
const DeclarationNameInfo & | TypoName, | ||
Sema::LookupNameKind | LookupKind, | ||
Scope * | S, | ||
CXXScopeSpec * | SS, | ||
std::unique_ptr< CorrectionCandidateCallback > | CCC, | ||
DeclContext * | MemberContext, | ||
bool | EnteringContext | ||
) | [inline] |
Definition at line 96 of file SemaInternal.h.
References clang::LookupResult::suppressDiagnostics().
void TypoCorrectionConsumer::addCorrection | ( | TypoCorrection | Correction | ) |
Definition at line 3422 of file SemaLookup.cpp.
References checkCorrectionVisibility(), clang::TypoCorrection::getAsString(), clang::TypoCorrection::getCorrectionAsIdentifierInfo(), clang::TypoCorrection::getCorrectionDecl(), clang::TypoCorrection::getEditDistance(), clang::Sema::getLangOpts(), clang::IdentifierInfo::getName(), isCandidateViable(), clang::TypoCorrection::isResolved(), MaxTypoDistanceResultSets, and Typo.
void TypoCorrectionConsumer::addKeywordResult | ( | StringRef | Keyword | ) |
Definition at line 3394 of file SemaLookup.cpp.
Referenced by AddKeywordsToConsumer().
void TypoCorrectionConsumer::addNamespaces | ( | const llvm::MapVector< NamespaceDecl *, bool > & | KnownNamespaces | ) |
Set-up method to add to the consumer the set of namespaces to use in performing corrections to nested name specifiers. This method also implicitly adds all of the known classes in the current AST context to the to the consumer for correcting nested name specifiers.
Definition at line 3467 of file SemaLookup.cpp.
References clang::Sema::getASTContext(), and clang::ASTContext::types().
bool clang::TypoCorrectionConsumer::empty | ( | ) | const [inline] |
Definition at line 124 of file SemaInternal.h.
bool clang::TypoCorrectionConsumer::finished | ( | ) | [inline] |
Return whether the end of the stream of corrections has been reached.
Definition at line 174 of file SemaInternal.h.
void TypoCorrectionConsumer::FoundDecl | ( | NamedDecl * | ND, |
NamedDecl * | Hiding, | ||
DeclContext * | Ctx, | ||
bool | InBaseClass | ||
) | [override, virtual] |
Invoked each time Sema::LookupVisibleDecls()
finds a declaration visible from the current scope or context.
ND | the declaration found. |
Hiding | a declaration that hides the declaration ND , or NULL if no such declaration exists. |
Ctx | the original context from which the lookup started. |
InBaseClass | whether this declaration was found in base class of the context we searched. |
Implements clang::VisibleDeclConsumer.
Definition at line 3366 of file SemaLookup.cpp.
References findAcceptableDecl(), clang::NamedDecl::getIdentifier(), clang::IdentifierInfo::getName(), clang::LookupResult::isVisible(), and Typo.
void TypoCorrectionConsumer::FoundName | ( | StringRef | Name | ) |
Definition at line 3388 of file SemaLookup.cpp.
unsigned clang::TypoCorrectionConsumer::getBestEditDistance | ( | bool | Normalized | ) | [inline] |
Return the edit distance of the corrections that have the closest/best edit distance from the original typop.
Definition at line 136 of file SemaInternal.h.
References clang::TypoCorrection::NormalizeEditDistance().
ASTContext& clang::TypoCorrectionConsumer::getContext | ( | ) | const [inline] |
Definition at line 179 of file SemaInternal.h.
References clang::Sema::Context.
const TypoCorrection& clang::TypoCorrectionConsumer::getCurrentCorrection | ( | ) | [inline] |
Get the last correction returned by getNextCorrection().
Definition at line 159 of file SemaInternal.h.
const LookupResult& clang::TypoCorrectionConsumer::getLookupResult | ( | ) | const [inline] |
Definition at line 180 of file SemaInternal.h.
Return the next typo correction that passes all internal filters and is deemed valid by the consumer's CorrectionCandidateCallback, starting with the corrections that have the closest edit distance. An empty TypoCorrection is returned once no more viable corrections remain in the consumer.
Definition at line 3492 of file SemaLookup.cpp.
References clang::TypoCorrection::begin(), clang::TypoCorrection::isResolved(), and clang::TypoCorrection::requiresImport().
bool clang::TypoCorrectionConsumer::includeHiddenDecls | ( | ) | const [inline, override, virtual] |
Determine whether hidden declarations (from unimported modules) should be given to this consumer. By default, they are not included.
Reimplemented from clang::VisibleDeclConsumer.
Definition at line 115 of file SemaInternal.h.
TypoResultList& clang::TypoCorrectionConsumer::operator[] | ( | StringRef | Name | ) | [inline] |
Return the list of TypoCorrections for the given identifier from the set of corrections that have the closest edit distance, if any.
Definition at line 130 of file SemaInternal.h.
void clang::TypoCorrectionConsumer::resetCorrectionStream | ( | ) | [inline] |
Reset the consumer's position in the stream of viable corrections (i.e. getNextCorrection() will return each of the previously returned corrections in order before returning any new corrections).
Definition at line 168 of file SemaInternal.h.