Go to the documentation of this file.
13 #ifndef LLVM_CLANG_SEMA_CODECOMPLETECONSUMER_H
14 #define LLVM_CLANG_SEMA_CODECOMPLETECONSUMER_H
22 #include "llvm/ADT/ArrayRef.h"
23 #include "llvm/ADT/DenseMap.h"
24 #include "llvm/ADT/None.h"
25 #include "llvm/ADT/Optional.h"
26 #include "llvm/ADT/SmallPtrSet.h"
27 #include "llvm/ADT/SmallVector.h"
28 #include "llvm/ADT/StringRef.h"
29 #include "llvm/Support/Allocator.h"
30 #include "llvm/Support/type_traits.h"
42 class FunctionTemplateDecl;
46 class NestedNameSpecifier;
50 class UsingShadowDecl;
178 const LangOptions &LangOpts,
179 bool PreferredTypeIsPointer =
false);
345 bool IsUsingDeclaration;
368 : CCKind(CCKind), IsUsingDeclaration(
false), SelIdents(None) {}
373 : CCKind(CCKind), IsUsingDeclaration(
false), SelIdents(SelIdents) {
409 this->ScopeSpecifier = std::move(SS);
414 VisitedContexts.insert(Ctx);
419 return VisitedContexts;
424 return ScopeSpecifier.getPointer();
565 unsigned NumChunks : 16;
568 unsigned NumAnnotations : 16;
574 unsigned Availability : 2;
577 StringRef ParentName;
581 const char *BriefComment;
585 const char **Annotations,
unsigned NumAnnotations,
586 StringRef ParentName,
587 const char *BriefComment);
598 bool empty()
const {
return NumChunks == 0; }
599 unsigned size()
const {
return NumChunks; }
602 assert(I <
size() &&
"Chunk index out-of-range");
646 llvm::DenseMap<const DeclContext *, StringRef> ParentNames;
647 std::shared_ptr<GlobalCodeCompletionAllocator> AllocatorRef;
651 std::shared_ptr<GlobalCodeCompletionAllocator> Allocator)
652 : AllocatorRef(
std::move(Allocator)) {}
659 assert(AllocatorRef);
660 return *AllocatorRef;
678 unsigned Priority = 0;
680 StringRef ParentName;
681 const char *BriefComment =
nullptr;
691 : Allocator(Allocator), CCTUInfo(CCTUInfo) {}
697 Availability(Availability) {}
867 bool Accessible =
true,
868 std::vector<FixItHint>
FixIts = std::vector<FixItHint>())
875 computeCursorKindAndAvailability(Accessible);
915 computeCursorKindAndAvailability();
922 "Not a declaration or pattern result");
943 bool IncludeBriefComments);
949 bool IncludeBriefComments);
975 void computeCursorKindAndAvailability(
bool Accessible =
true);
978 bool operator<(
const CodeCompletionResult &
X,
const CodeCompletionResult &Y);
1068 bool IncludeBriefComments)
const;
1126 unsigned NumResults) {}
1141 unsigned NumCandidates,
1155 const NamedDecl *Decl);
1160 const NamedDecl *Decl);
1166 const CodeCompleteConsumer::OverloadCandidate &Result,
1188 unsigned NumResults)
override;
1192 unsigned NumCandidates,
1206 #endif // LLVM_CLANG_SEMA_CODECOMPLETECONSUMER_H
OverloadCandidate(FunctionDecl *Function)
@ CCC_SymbolOrNewName
Code completion occurred where both a new name and an existing symbol is permissible.
@ CCF_ExactTypeMatch
Divide by this factor when a code-completion result's type exactly matches the type we expect.
@ CK_FunctionTemplate
The candidate is a function template.
unsigned IncludeMacros
Show macros in code completion results.
@ CCC_Other
An unspecified code-completion context.
@ CK_Function
The candidate is a function declaration.
bool includeCodePatterns() const
Whether the code-completion consumer wants to see code patterns.
void addParentContext(const DeclContext *DC)
Add the parent context information to this code completion.
const char * Keyword
When Kind == RK_Keyword, the string representing the keyword or symbol's spelling.
unsigned getAnnotationCount() const
Retrieve the number of annotations for this code completion result.
unsigned getPriority() const
Retrieve the priority of this code completion result.
bool loadExternal() const
Hint whether to load data from the external AST in order to provide full results.
CodeCompletionContext(Kind CCKind)
Construct a new code-completion context of the given kind.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
bool includeNamespaceLevelDecls() const
Whether to include declarations in namespace contexts (including the global namespace).
CodeCompletionString * TakeString()
Take the resulting completion string.
@ CCC_ObjCInstanceMessage
Code completion where an Objective-C instance message is expected.
@ CCC_Expression
Code completion occurred where an expression is expected.
CodeCompletionResult(const IdentifierInfo *Macro, const MacroInfo *MI=nullptr, unsigned Priority=CCP_Macro)
Build a result that refers to a macro.
void AddOptionalChunk(CodeCompletionString *Optional)
Add a new optional chunk.
const char * CopyString(const Twine &String)
Copy the given string into this allocator.
bool isResultFilteredOut(StringRef Filter, CodeCompletionResult Results) override
A simple code-completion consumer that prints the results it receives in a simple format.
OverloadCandidate(FunctionTemplateDecl *FunctionTemplateDecl)
Encodes a location in the source.
bool includeGlobals() const
Whether to include global (top-level) declaration results.
unsigned IncludeBriefComments
Show brief documentation comments in code completion results.
@ CCC_Type
Code completion occurred where a type name is expected.
This represents a decl that may have a name.
unsigned IncludeFixIts
Include results after corrections (small fix-its), e.g.
@ CCC_ObjCImplementation
Code completion occurred within an Objective-C implementation or category implementation.
CodeCompletionString * CreateCodeCompletionString(Sema &S, const CodeCompletionContext &CCContext, CodeCompletionAllocator &Allocator, CodeCompletionTUInfo &CCTUInfo, bool IncludeBriefComments)
Create a new code-completion string that describes how to insert this result into a program.
A (possibly-)qualified type.
@ CCP_Constant
Priority for a constant value (e.g., enumerator).
void AddChunk(CodeCompletionString::ChunkKind CK, const char *Text="")
Add a new chunk.
@ CK_Text
A piece of text that should be placed in the buffer, e.g., parentheses or a comma in a function call.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
CodeCompletionString * CreateCodeCompletionStringForMacro(Preprocessor &PP, CodeCompletionAllocator &Allocator, CodeCompletionTUInfo &CCTUInfo)
Creates a new code-completion string for the macro result.
const FunctionType * getFunctionType() const
Retrieve the function type of the entity, regardless of how the function is stored.
@ CCP_Macro
Priority for a preprocessor macro.
CodeCompletionTUInfo & getCodeCompletionTUInfo() const
@ CCD_ObjectQualifierMatch
The result is a C++ non-static member function whose qualifiers exactly match the object type on whic...
CandidateKind getKind() const
Determine the kind of overload candidate.
@ CCP_CodePattern
Priority for a code pattern.
@ CK_RightParen
A right parenthesis (')').
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
virtual CodeCompletionTUInfo & getCodeCompletionTUInfo()=0
@ CCP_EnumInCase
Priority for an enumeration constant inside a switch whose condition is of the enumeration type.
const char * getBriefComment() const
@ CK_TypedText
The piece of text that the user is expected to type to match the code-completion string,...
@ CCC_IncludedFile
Code completion inside the filename part of a include directive.
CodeCompletionString * Pattern
When Kind == RK_Pattern, the code-completion string that describes the completion text to insert.
@ CCP_ObjC_cmd
Priority for the Objective-C "_cmd" implicit parameter.
Encapsulates the data about a macro definition (e.g.
@ RK_Keyword
Refers to a keyword or symbol.
unsigned Priority
The priority of this particular code-completion result.
@ CK_VerticalSpace
Vertical whitespace ('\n' or '\r\n', depending on the platform).
Represents a C++ nested-name-specifier or a global scope specifier.
CandidateKind
Describes the type of overload candidate.
Describes how types, statements, expressions, and declarations should be printed.
bool StartsNestedNameSpecifier
Whether this declaration is the beginning of a nested-name-specifier and, therefore,...
void AddTypedTextChunk(const char *Text)
Add a new typed-text chunk.
FunctionType - C99 6.7.5.3 - Function Declarators.
unsigned getMacroUsagePriority(StringRef MacroName, const LangOptions &LangOpts, bool PreferredTypeIsPointer=false)
Determine the priority to be given to a macro code completion result with the given name.
@ CK_HorizontalSpace
Horizontal whitespace (' ').
QualType getBaseType() const
Retrieve the type of the base object in a member-access expression.
FunctionTemplateDecl * FunctionTemplate
The function template overload candidate, available when Kind == CK_FunctionTemplate.
const RawComment * getPatternCompletionComment(const ASTContext &Ctx, const NamedDecl *Decl)
Get the documentation comment used to produce CodeCompletionString::BriefComment for RK_Pattern.
@ CK_ResultType
A piece of text that describes the type of an entity or, for functions and methods,...
@ CCP_NestedNameSpecifier
Priority for a nested-name-specifier.
Captures a result of code completion.
@ CCD_MethodAsProperty
An Objective-C method being used as a property.
The base class of the type hierarchy.
ChunkKind
The different kinds of "chunks" that can occur within a code completion string.
FunctionTemplateDecl * getFunctionTemplate() const
Retrieve the function template overload candidate.
@ Decl
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
@ CCC_ObjCCategoryName
Code completion where an Objective-C category name is expected.
CodeCompletionBuilder(CodeCompletionAllocator &Allocator, CodeCompletionTUInfo &CCTUInfo)
@ CCC_TopLevel
Code completion occurred within a "top-level" completion context, e.g., at namespace or global scope.
Declaration of a template function.
@ CCD_ProbablyNotObjCCollection
Adjustment for KVC code pattern priorities when it doesn't look like the.
@ CK_LeftAngle
A left angle bracket ('<').
const UsingShadowDecl * ShadowDecl
If this Decl was unshadowed by using declaration, this can store a pointer to the UsingShadowDecl whi...
virtual void ProcessOverloadCandidates(Sema &S, unsigned CurrentArg, OverloadCandidate *Candidates, unsigned NumCandidates, SourceLocation OpenParLoc)
bool operator>(DeclarationName LHS, DeclarationName RHS)
Ordering on two declaration names.
void AddCurrentParameterChunk(const char *CurrentParameter)
Add a new current-parameter chunk.
CXAvailabilityKind Availability
The availability of this result.
unsigned IncludeGlobals
Show top-level decls in code completion results.
@ CCC_Recovery
An unknown context, in which we are recovering from a parsing error and don't know which completions ...
@ CK_RightBracket
A right bracket (']').
@ CCC_ObjCProtocolName
Code completion occurred where a protocol name is expected.
@ CCC_EnumTag
Code completion occurred after the "enum" keyword, to indicate an enumeration name.
static Chunk CreateOptional(CodeCompletionString *Optional)
Create a new optional chunk.
unsigned IncludeCodePatterns
Show code patterns in code completion results.
A builder class used to construct new code-completion strings.
@ CXCursor_NotImplemented
CodeCompletionResult(CodeCompletionString *Pattern, const NamedDecl *D, unsigned Priority)
Build a result that refers to a pattern with an associated declaration.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
@ CCC_ArrowMemberAccess
Code completion occurred on the right-hand side of a member access expression using the arrow operato...
@ CCC_Symbol
Code completion occurred where an existing name(such as type, function or variable) is expected.
void AddTextChunk(const char *Text)
Add a new text chunk.
static Chunk CreateResultType(const char *ResultType)
Create a new result type chunk.
StringRef getParentContextName() const
Retrieve the name of the parent context.
CodeCompletionTUInfo & getCodeCompletionTUInfo() override
@ CCP_Keyword
Priority for a language keyword (that isn't any of the other categories).
virtual bool isResultFilteredOut(StringRef Filter, CodeCompletionResult Results)
FunctionDecl * Function
The function overload candidate, available when Kind == CK_Function.
CanQual< Type > CanQualType
Represents a canonical, potentially-qualified type.
@ CCP_LocalDeclaration
Priority for a declaration that is in the local scope.
@ CCC_ObjCInterfaceName
Code completion where the name of an Objective-C class is expected.
@ CK_Informative
A piece of text that describes something about the result but should not be inserted into the buffer.
void setCXXScopeSpecifier(CXXScopeSpec SS)
Sets the scope specifier that comes before the completion token.
@ CK_LeftParen
A left parenthesis ('(').
@ CCD_InBaseClass
The result is in a base class.
@ CK_FunctionType
The "candidate" is actually a variable, expression, or block for which we only have a function protot...
CodeCompletionString * Optional
The code completion string associated with a CK_Optional chunk.
@ CCC_ObjCMessageReceiver
Code completion occurred where an Objective-C message receiver is expected.
const MacroInfo * MacroDefInfo
If the result is RK_Macro, this can store the information about the macro definition.
@ CCP_Type
Priority for a type.
bool QualifierIsInformative
Whether this result was found via lookup into a base class.
void setPreferredType(QualType T)
CodeCompletionAllocator & getAllocator() const
Retrieve the allocator into which the code completion strings should be allocated.
CodeCompletionString & operator=(const CodeCompletionString &)=delete
const RawComment * getParameterComment(const ASTContext &Ctx, const CodeCompleteConsumer::OverloadCandidate &Result, unsigned ArgIndex)
Get the documentation comment used to produce CodeCompletionString::BriefComment for OverloadCandidat...
unsigned StartParameter
Specifies which parameter (of a function, Objective-C method, macro, etc.) we should start with when ...
std::string getAsString() const
Retrieve a string representation of the code completion string, which is mainly useful for debugging.
CodeCompletionString * CreateSignatureString(unsigned CurrentArg, Sema &S, CodeCompletionAllocator &Allocator, CodeCompletionTUInfo &CCTUInfo, bool IncludeBriefComments) const
Create a new code-completion string that describes the function signature of this overload candidate.
A "string" used to describe how code completion can be performed for an entity.
static Chunk CreateCurrentParameter(const char *CurrentParameter)
Create a new current-parameter chunk.
bool includeMacros() const
Whether the code-completion consumer wants to see macros.
virtual void ProcessCodeCompleteResults(Sema &S, CodeCompletionContext Context, CodeCompletionResult *Results, unsigned NumResults)
Process the finalized code-completion results.
@ CCC_OtherWithMacros
An unspecified code-completion context where we should also add macro completions.
CodeCompletionString * createCodeCompletionStringForOverride(Preprocessor &PP, ASTContext &Ctx, CodeCompletionBuilder &Result, bool IncludeBriefComments, const CodeCompletionContext &CCContext, PrintingPolicy &Policy)
void AddResultTypeChunk(const char *ResultType)
Add a new result-type chunk.
@ CCP_SuperCompletion
Priority for a send-to-super completion.
@ CCC_Namespace
Code completion occurred where a namespace or namespace alias is expected.
@ RK_Macro
Refers to a macro.
unsigned IncludeNamespaceLevelDecls
Show decls in namespace (including the global namespace) in code completion results.
const Chunk & operator[](unsigned I) const
SimplifiedTypeClass getSimplifiedTypeClass(CanQualType T)
Determine the simplified type class of the given canonical type.
const NamedDecl * Declaration
When Kind == RK_Declaration or RK_Pattern, the declaration we are referring to.
PrintingCodeCompleteConsumer(const CodeCompleteOptions &CodeCompleteOpts, raw_ostream &OS)
Create a new printing code-completion consumer that prints its results to the given raw output stream...
@ CK_RightBrace
A right brace ('}').
std::shared_ptr< GlobalCodeCompletionAllocator > getAllocatorRef() const
@ CCC_ObjCPropertyAccess
Code completion occurred on the right-hand side of an Objective-C property access expression.
ChunkKind Kind
The kind of data stored in this piece of the code completion string.
@ CK_SemiColon
A semicolon (';').
@ CCD_bool_in_ObjC
Adjustment to the "bool" type in Objective-C, where the typedef "BOOL" is preferred.
bool operator<=(DeclarationName LHS, DeclarationName RHS)
Ordering on two declaration names.
llvm::Optional< const CXXScopeSpec * > getCXXScopeSpecifier()
@ CCC_PreprocessorExpression
Code completion occurred within a preprocessor expression.
void AddAnnotation(const char *A)
Kind getKind() const
Retrieve the kind of code-completion context.
@ CXCursor_MacroDefinition
@ CXAvailability_Available
The entity is available.
void ProcessOverloadCandidates(Sema &S, unsigned CurrentArg, OverloadCandidate *Candidates, unsigned NumCandidates, SourceLocation OpenParLoc) override
CXAvailabilityKind
Describes the availability of a particular entity, which indicates whether the use of this entity wil...
NestedNameSpecifier * Qualifier
If the result should have a nested-name-specifier, this is it.
const char * getTypedText() const
Returns the text in the TypedText chunk.
@ CCC_PreprocessorDirective
Code completion occurred where a preprocessor directive is expected.
bool includeFixIts() const
Whether to include completion items with small fix-its, e.g.
bool isUsingDeclaration() const
CXCursorKind
Describes the kind of entity that a cursor refers to.
OverloadCandidate - A single candidate in an overload set (C++ 13.3).
void ProcessCodeCompleteResults(Sema &S, CodeCompletionContext Context, CodeCompletionResult *Results, unsigned NumResults) override
Prints the finalized code-completion results.
Sema - This implements semantic analysis and AST building for C.
const char * getKeyword() const
Retrieve the keyword stored in this result.
@ CCC_ClassStructUnion
Code completion occurred within a class, struct, or union.
@ CCC_Statement
Code completion occurred where a statement (or declaration) is expected in a function,...
Abstract interface for a consumer of code-completion information.
@ CCC_DotMemberAccess
Code completion occurred on the right-hand side of a member access expression using the dot operator.
bool Hidden
Whether this result is hidden by another name.
unsigned getAvailability() const
Retrieve the availability of this code completion result.
CodeCompletionResult(CodeCompletionString *Pattern, unsigned Priority=CCP_CodePattern, CXCursorKind CursorKind=CXCursor_NotImplemented, CXAvailabilityKind Availability=CXAvailability_Available, const NamedDecl *D=nullptr)
Build a result that refers to a pattern.
CodeCompletionString * createCodeCompletionStringForDecl(Preprocessor &PP, ASTContext &Ctx, CodeCompletionBuilder &Result, bool IncludeBriefComments, const CodeCompletionContext &CCContext, PrintingPolicy &Policy)
const IdentifierInfo * Macro
When Kind == RK_Macro, the identifier that refers to a macro.
@ CK_CurrentParameter
A piece of text that describes the parameter that corresponds to the code-completion location within ...
const NamedDecl * getDeclaration() const
Retrieve the declaration stored in this result.
@ CCF_SimilarTypeMatch
Divide by this factor when a code-completion result's type is similar to the type we expect (e....
const char * getAnnotation(unsigned AnnotationNr) const
Retrieve the annotation string specified by AnnotationNr.
One of these records is kept for each identifier that is lexed.
SimplifiedTypeClass
A simplified classification of types used when determining "similar" types for code completion.
const CodeCompleteOptions CodeCompleteOpts
@ CK_LeftBracket
A left bracket ('[').
CodeCompletionContext(Kind CCKind, QualType T, ArrayRef< IdentifierInfo * > SelIdents=None)
Construct a new code-completion context of the given kind.
bool includeBriefComments() const
Whether to include brief documentation comments within the set of code completions returned.
const char * getBriefComment() const
@ RK_Pattern
Refers to a precomputed pattern.
ResultKind
Describes the kind of result generated.
CodeCompletionBuilder(CodeCompletionAllocator &Allocator, CodeCompletionTUInfo &CCTUInfo, unsigned Priority, CXAvailabilityKind Availability)
bool AllParametersAreInformative
Whether all parameters (of a function, Objective-C method, etc.) should be considered "informative".
static Chunk CreatePlaceholder(const char *Placeholder)
Create a new placeholder chunk.
@ CCC_NaturalLanguage
Code completion occurred in a context where natural language is expected, e.g., a comment or string l...
@ CK_Placeholder
A string that acts as a placeholder for, e.g., a function call argument.
@ CCP_Declaration
Priority for a non-type declaration.
Dataflow Directional Tag Classes.
const RawComment * getCompletionComment(const ASTContext &Ctx, const NamedDecl *Decl)
Get the documentation comment used to produce CodeCompletionString::BriefComment for RK_Declaration.
@ CCP_NextInitializer
Priority for the next initialization in a constructor initializer list.
virtual CodeCompletionAllocator & getAllocator()=0
Retrieve the allocator that will be used to allocate code completion strings.
OverloadCandidate(const FunctionType *Type)
bool InBaseClass
Whether this is a class member from base class.
@ CCC_NewName
Code completion occurred where a new name is expected.
static Chunk CreateInformative(const char *Informative)
Create a new informative chunk.
QualType getDeclUsageType(ASTContext &C, const NamedDecl *ND)
Determine the type that this declaration will have if it is used as a type or in an expression.
@ CCD_SelectorMatch
The selector of the given message exactly matches the selector of the current method,...
StringRef getOrderedName(std::string &Saved) const
Retrieve the name that should be used to order a result.
bool operator<(DeclarationName LHS, DeclarationName RHS)
Ordering on two declaration names.
void setIsUsingDeclaration(bool V)
void AddPlaceholderChunk(const char *Placeholder)
Add a new placeholder chunk.
void addBriefComment(StringRef Comment)
CodeCompletionTUInfo(std::shared_ptr< GlobalCodeCompletionAllocator > Allocator)
@ CCC_ObjCIvarList
Code completion occurred within the instance variable list of an Objective-C interface,...
@ CK_RightAngle
A right angle bracket ('>').
@ RK_Declaration
Refers to a declaration.
Options controlling the behavior of code completion.
@ CCD_BlockPropertySetter
An Objective-C block property completed as a setter with a block placeholder.
An allocator used specifically for the purpose of code completion.
@ CCC_ParenthesizedExpression
Code completion in a parenthesized expression, which means that we may also have types here in C and ...
const FunctionType * Type
The function type that describes the entity being called, when Kind == CK_FunctionType.
bool DeclaringEntity
Whether we're completing a declaration of the given entity, rather than a use of that entity.
static Chunk CreateText(const char *Text)
Create a new text chunk.
bool wantConstructorResults() const
Determines whether we want C++ constructors as results within this context.
One piece of the code completion string.
@ CCC_SelectorName
Code completion for a selector, as in an @selector expression.
virtual ~CodeCompleteConsumer()
Deregisters and destroys this code-completion consumer.
ResultKind Kind
The kind of result stored here.
@ CK_Optional
A code completion string that is entirely optional.
Allocator for a cached set of global code completions.
CXCursorKind getCursorKindForDecl(const Decl *D)
Determine the libclang cursor kind associated with the given declaration.
The context in which code completion occurred, so that the code-completion consumer can process the r...
unsigned LoadExternal
Hint whether to load data from the external AST to provide full results.
@ CCP_MemberDeclaration
Priority for a member declaration found from the current method or member function.
llvm::StringRef getCompletionKindString(CodeCompletionContext::Kind Kind)
Get string representation of Kind, useful for for debugging.
void AddInformativeChunk(const char *Text)
Add a new informative chunk.
bool operator>=(DeclarationName LHS, DeclarationName RHS)
Ordering on two declaration names.
@ CK_LeftBrace
A left brace ('{').
std::vector< FixItHint > FixIts
Fix-its that must be applied before inserting the text for the corresponding completion.
StringRef getParentName(const DeclContext *DC)
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
CodeCompletionAllocator & getAllocator() const
CodeCompletionResult(const char *Keyword, unsigned Priority=CCP_Keyword)
Build a result that refers to a keyword or symbol.
CodeCompleteConsumer(const CodeCompleteOptions &CodeCompleteOpts)
StringRef getParentName() const
CXCursorKind CursorKind
The cursor kind that describes this result.
QualType getPreferredType() const
Retrieve the type that this expression would prefer to have, e.g., if the expression is a variable in...
CodeCompletionResult(const NamedDecl *Declaration, unsigned Priority, NestedNameSpecifier *Qualifier=nullptr, bool QualifierIsInformative=false, bool Accessible=true, std::vector< FixItHint > FixIts=std::vector< FixItHint >())
Build a result that refers to a declaration.
@ CK_Comma
A comma separator (',').
const char * Text
The text string associated with a CK_Text, CK_Placeholder, CK_Informative, or CK_Comma chunk.
Represents a function declaration or definition.
@ CCP_Unlikely
Priority for a result that isn't likely to be what the user wants, but is included for completeness.
@ CCC_UnionTag
Code completion occurred after the "union" keyword, to indicate a union name.
FunctionDecl * getFunction() const
Retrieve the function overload candidate or the templated function declaration for a function templat...
CodeCompletionAllocator & getAllocator() override
Retrieve the allocator that will be used to allocate code completion strings.
@ CCC_MacroName
Code completion occurred where an macro is being defined.
void addVisitedContext(DeclContext *Ctx)
Adds a visited context.
const VisitedContextSet & getVisitedContexts() const
Retrieves all visited contexts.
@ CCC_ObjCClassMessage
Code completion where an Objective-C class message is expected.
@ CCC_ObjCInterface
Code completion occurred within an Objective-C interface, protocol, or category interface.
@ CCC_ClassOrStructTag
Code completion occurred after the "struct" or "class" keyword, to indicate a struct or class name.
@ CCC_TypeQualifiers
Code completion within a type-qualifier list.
@ CCC_MacroNameUse
Code completion occurred where a macro name is expected (without any arguments, in the case of a func...
ArrayRef< IdentifierInfo * > getSelIdents() const
Retrieve the Objective-C selector identifiers.