class CodeCompletionContext

Declaration

class CodeCompletionContext { /* full declaration omitted */ };

Description

The context in which code completion occurred, so that the code-completion consumer can process the results accordingly.

Declared at: clang/include/clang/Sema/CodeCompleteConsumer.h:187

Member Variables

private clang::CodeCompletionContext::Kind CCKind
private bool IsUsingDeclaration
Indicates whether we are completing a name of a using declaration, e.g. using ^; using a::^;
private clang::QualType PreferredType
The type that would prefer to see at this point (e.g., the type of an initializer or function parameter).
private clang::QualType BaseType
The type of the base object in a member access expression.
private ArrayRef<clang::IdentifierInfo*> SelIdents
The identifiers for Objective-C selector parts.
private llvm::Optional<CXXScopeSpec> ScopeSpecifier
The scope specifier that comes before the completion token e.g. "a::b::"
private clang::CodeCompletionContext::VisitedContextSet VisitedContexts
A set of declaration contexts visited by Sema when doing lookup for code completion.

Method Overview

Methods

CodeCompletionContext(
    clang::CodeCompletionContext::Kind CCKind)

Description

Construct a new code-completion context of the given kind.

Declared at: clang/include/clang/Sema/CodeCompleteConsumer.h:370

Parameters

clang::CodeCompletionContext::Kind CCKind

CodeCompletionContext(
    clang::CodeCompletionContext::Kind CCKind,
    clang::QualType T,
    ArrayRef<clang::IdentifierInfo*> SelIdents =
        None)

Description

Construct a new code-completion context of the given kind.

Declared at: clang/include/clang/Sema/CodeCompleteConsumer.h:374

Parameters

clang::CodeCompletionContext::Kind CCKind
clang::QualType T
ArrayRef<clang::IdentifierInfo*> SelIdents = None

void addVisitedContext(clang::DeclContext* Ctx)

Description

Adds a visited context.

Declared at: clang/include/clang/Sema/CodeCompleteConsumer.h:416

Parameters

clang::DeclContext* Ctx

clang::QualType getBaseType() const

Description

Retrieve the type of the base object in a member-access expression.

Declared at: clang/include/clang/Sema/CodeCompleteConsumer.h:399

llvm::Optional<const CXXScopeSpec*>
getCXXScopeSpecifier()

Declared at: clang/include/clang/Sema/CodeCompleteConsumer.h:425

clang::CodeCompletionContext::Kind getKind() const

Description

Retrieve the kind of code-completion context.

Declared at: clang/include/clang/Sema/CodeCompleteConsumer.h:389

clang::QualType getPreferredType() const

Description

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.

Declared at: clang/include/clang/Sema/CodeCompleteConsumer.h:394

ArrayRef<clang::IdentifierInfo*> getSelIdents()
    const

Description

Retrieve the Objective-C selector identifiers.

Declared at: clang/include/clang/Sema/CodeCompleteConsumer.h:402

const clang::CodeCompletionContext::
    VisitedContextSet&
    getVisitedContexts() const

Description

Retrieves all visited contexts.

Declared at: clang/include/clang/Sema/CodeCompleteConsumer.h:421

bool isUsingDeclaration() const

Declared at: clang/include/clang/Sema/CodeCompleteConsumer.h:385

void setCXXScopeSpecifier(clang::CXXScopeSpec SS)

Description

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::").

Declared at: clang/include/clang/Sema/CodeCompleteConsumer.h:411

Parameters

clang::CXXScopeSpec SS

void setIsUsingDeclaration(bool V)

Declared at: clang/include/clang/Sema/CodeCompleteConsumer.h:386

Parameters

bool V

void setPreferredType(clang::QualType T)

Declared at: clang/include/clang/Sema/CodeCompleteConsumer.h:395

Parameters

clang::QualType T

bool wantConstructorResults() const

Description

Determines whether we want C++ constructors as results within this context.

Declared at: clang/include/clang/Sema/CodeCompleteConsumer.h:406