clang 20.0.0git
|
The context in which code completion occurred, so that the code-completion consumer can process the results accordingly. More...
#include "clang/Sema/CodeCompleteConsumer.h"
Public Member Functions | |
CodeCompletionContext (Kind CCKind) | |
Construct a new code-completion context of the given kind. | |
CodeCompletionContext (Kind CCKind, QualType T, ArrayRef< const IdentifierInfo * > SelIdents=std::nullopt) | |
Construct a new code-completion context of the given kind. | |
bool | isUsingDeclaration () const |
void | setIsUsingDeclaration (bool V) |
Kind | getKind () const |
Retrieve the kind of code-completion context. | |
QualType | getPreferredType () const |
Retrieve the type that this expression would prefer to have, e.g., if the expression is a variable initializer or a function argument, the type of the corresponding variable or function parameter. | |
void | setPreferredType (QualType T) |
QualType | getBaseType () const |
Retrieve the type of the base object in a member-access expression. | |
ArrayRef< const IdentifierInfo * > | getSelIdents () const |
Retrieve the Objective-C selector identifiers. | |
bool | wantConstructorResults () const |
Determines whether we want C++ constructors as results within this context. | |
void | setCXXScopeSpecifier (CXXScopeSpec SS) |
Sets the scope specifier that comes before the completion token. | |
void | addVisitedContext (DeclContext *Ctx) |
Adds a visited context. | |
const VisitedContextSet & | getVisitedContexts () const |
Retrieves all visited contexts. | |
std::optional< const CXXScopeSpec * > | getCXXScopeSpecifier () |
The context in which code completion occurred, so that the code-completion consumer can process the results accordingly.
Definition at line 186 of file CodeCompleteConsumer.h.
Definition at line 347 of file CodeCompleteConsumer.h.
Definition at line 188 of file CodeCompleteConsumer.h.
|
inline |
Construct a new code-completion context of the given kind.
Definition at line 377 of file CodeCompleteConsumer.h.
|
inline |
Construct a new code-completion context of the given kind.
Definition at line 381 of file CodeCompleteConsumer.h.
References CCC_ArrowMemberAccess, CCC_DotMemberAccess, CCC_ObjCClassMessage, CCC_ObjCInstanceMessage, CCC_ObjCPropertyAccess, and clang::T.
|
inline |
Adds a visited context.
Definition at line 424 of file CodeCompleteConsumer.h.
|
inline |
Retrieve the type of the base object in a member-access expression.
Definition at line 407 of file CodeCompleteConsumer.h.
Referenced by AddObjCProperties(), clang::CodeCompletionResult::createCodeCompletionStringForDecl(), clang::DotMemberAccessHandler::handleDeclaration(), and clang::CompletionContextHandler::handleKeyword().
|
inline |
Definition at line 433 of file CodeCompleteConsumer.h.
|
inline |
Retrieve the kind of code-completion context.
Definition at line 397 of file CodeCompleteConsumer.h.
|
inline |
Retrieve the type that this expression would prefer to have, e.g., if the expression is a variable initializer or a function argument, the type of the corresponding variable or function parameter.
Definition at line 402 of file CodeCompleteConsumer.h.
Referenced by clang::CompletionContextHandler::handleDeclaration(), and clang::CompletionContextHandler::handleKeyword().
|
inline |
Retrieve the Objective-C selector identifiers.
Definition at line 410 of file CodeCompleteConsumer.h.
|
inline |
Retrieves all visited contexts.
Definition at line 429 of file CodeCompleteConsumer.h.
|
inline |
Definition at line 393 of file CodeCompleteConsumer.h.
|
inline |
Sets the scope specifier that comes before the completion token.
This is expected to be set in code completions on qualfied specifiers (e.g. "a::b::").
Definition at line 419 of file CodeCompleteConsumer.h.
Referenced by clang::SemaCodeCompletion::CodeCompleteQualifiedId().
|
inline |
Definition at line 394 of file CodeCompleteConsumer.h.
References V.
Referenced by clang::SemaCodeCompletion::CodeCompleteQualifiedId().
|
inline |
Definition at line 403 of file CodeCompleteConsumer.h.
References clang::T.
Referenced by clang::SemaCodeCompletion::CodeCompleteMemberReferenceExpr().
bool CodeCompletionContext::wantConstructorResults | ( | ) | const |
Determines whether we want C++ constructors as results within this context.
Definition at line 45 of file CodeCompleteConsumer.cpp.
References CCC_ArrowMemberAccess, CCC_Attribute, CCC_ClassOrStructTag, CCC_ClassStructUnion, CCC_DotMemberAccess, CCC_EnumTag, CCC_Expression, CCC_IncludedFile, CCC_MacroName, CCC_MacroNameUse, CCC_Namespace, CCC_NaturalLanguage, CCC_NewName, CCC_ObjCCategoryName, CCC_ObjCClassForwardDecl, CCC_ObjCClassMessage, CCC_ObjCImplementation, CCC_ObjCInstanceMessage, CCC_ObjCInterface, CCC_ObjCInterfaceName, CCC_ObjCIvarList, CCC_ObjCMessageReceiver, CCC_ObjCPropertyAccess, CCC_ObjCProtocolName, CCC_Other, CCC_OtherWithMacros, CCC_ParenthesizedExpression, CCC_PreprocessorDirective, CCC_PreprocessorExpression, CCC_Recovery, CCC_SelectorName, CCC_Statement, CCC_Symbol, CCC_SymbolOrNewName, CCC_TopLevel, CCC_TopLevelOrExpression, CCC_Type, CCC_TypeQualifiers, and CCC_UnionTag.