clang
8.0.0
|
#include "clang/Sema/SemaInternal.h"
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. More... | |
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. More... | |
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. More... | |
unsigned | getBestEditDistance (bool Normalized) |
Return the edit distance of the corrections that have the closest/best edit distance from the original typop. More... | |
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. More... | |
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. More... | |
const TypoCorrection & | getCurrentCorrection () |
Get the last correction returned by getNextCorrection(). More... | |
const TypoCorrection & | peekNextCorrection () |
Return the next typo correction like getNextCorrection, but keep the internal state pointed to the current correction (i.e. More... | |
void | resetCorrectionStream () |
Reset the consumer's position in the stream of viable corrections (i.e. More... | |
bool | finished () |
Return whether the end of the stream of corrections has been reached. More... | |
void | saveCurrentPosition () |
Save the current position in the correction stream (overwriting any previously saved position). More... | |
void | restoreSavedPosition () |
Restore the saved position in the correction stream. More... | |
ASTContext & | getContext () const |
const LookupResult & | getLookupResult () const |
bool | isAddressOfOperand () const |
const CXXScopeSpec * | getSS () const |
Scope * | getScope () const |
CorrectionCandidateCallback * | getCorrectionValidator () const |
![]() | |
virtual | ~VisibleDeclConsumer () |
Destroys the visible declaration consumer. More... | |
virtual void | EnteredContext (DeclContext *Ctx) |
Callback to inform the client that Sema entered into a new context to find a visible declaration. More... | |
Definition at line 125 of file SemaInternal.h.
|
inline |
Definition at line 131 of file SemaInternal.h.
void TypoCorrectionConsumer::addCorrection | ( | TypoCorrection | Correction | ) |
Definition at line 3996 of file SemaLookup.cpp.
void TypoCorrectionConsumer::addKeywordResult | ( | StringRef | Keyword | ) |
Definition at line 3967 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 4041 of file SemaLookup.cpp.
References clang::NestedNameSpecifier::getAsType(), clang::CXXScopeSpec::getScopeRep(), clang::Type::getTypeClass(), and clang::CXXScopeSpec::isValid().
|
inline |
Definition at line 159 of file SemaInternal.h.
|
inline |
Return whether the end of the stream of corrections has been reached.
Definition at line 220 of file SemaInternal.h.
|
overridevirtual |
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 3940 of file SemaLookup.cpp.
References clang::NamedDecl::getIdentifier(), and clang::LookupResult::isVisible().
void TypoCorrectionConsumer::FoundName | ( | StringRef | Name | ) |
Definition at line 3961 of file SemaLookup.cpp.
|
inline |
Return the edit distance of the corrections that have the closest/best edit distance from the original typop.
Definition at line 171 of file SemaInternal.h.
References max(), and clang::TypoCorrection::NormalizeEditDistance().
|
inline |
Definition at line 236 of file SemaInternal.h.
|
inline |
Definition at line 242 of file SemaInternal.h.
References clang::Sema::Context, and clang::Sema::CurContext.
|
inline |
Get the last correction returned by getNextCorrection().
Definition at line 194 of file SemaInternal.h.
|
inline |
Definition at line 237 of file SemaInternal.h.
References clang::Result.
Referenced by attemptRecovery().
const TypoCorrection & TypoCorrectionConsumer::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.
Definition at line 4071 of file SemaLookup.cpp.
References clang::TypoCorrection::begin(), clang::TypoCorrection::getCorrectionAsIdentifierInfo(), clang::TypoCorrection::isResolved(), LookupPotentialTypoResult(), and clang::TypoCorrection::requiresImport().
|
inline |
Definition at line 241 of file SemaInternal.h.
Referenced by attemptRecovery().
|
inline |
Definition at line 240 of file SemaInternal.h.
Referenced by attemptRecovery().
|
inlineoverridevirtual |
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 150 of file SemaInternal.h.
|
inline |
Definition at line 239 of file SemaInternal.h.
Referenced by attemptRecovery().
|
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 165 of file SemaInternal.h.
|
inline |
Return the next typo correction like getNextCorrection, but keep the internal state pointed to the current correction (i.e.
the next time getNextCorrection is called, it will return the same correction returned by peekNextcorrection).
Definition at line 204 of file SemaInternal.h.
|
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 214 of file SemaInternal.h.
|
inline |
Restore the saved position in the correction stream.
Definition at line 232 of file SemaInternal.h.
|
inline |
Save the current position in the correction stream (overwriting any previously saved position).
Definition at line 227 of file SemaInternal.h.