clang 17.0.0git
Public Types | Public Member Functions | List of all members
clang::CodeCompletionBuilder Class Reference

A builder class used to construct new code-completion strings. More...

#include "clang/Sema/CodeCompleteConsumer.h"

Public Types

using Chunk = CodeCompletionString::Chunk

Public Member Functions

 CodeCompletionBuilder (CodeCompletionAllocator &Allocator, CodeCompletionTUInfo &CCTUInfo)
 CodeCompletionBuilder (CodeCompletionAllocator &Allocator, CodeCompletionTUInfo &CCTUInfo, unsigned Priority, CXAvailabilityKind Availability)
CodeCompletionAllocatorgetAllocator () const
 Retrieve the allocator into which the code completion strings should be allocated.
CodeCompletionTUInfogetCodeCompletionTUInfo () const
CodeCompletionStringTakeString ()
 Take the resulting completion string.
void AddTypedTextChunk (const char *Text)
 Add a new typed-text chunk.
void AddTextChunk (const char *Text)
 Add a new text chunk.
void AddOptionalChunk (CodeCompletionString *Optional)
 Add a new optional chunk.
void AddPlaceholderChunk (const char *Placeholder)
 Add a new placeholder chunk.
void AddInformativeChunk (const char *Text)
 Add a new informative chunk.
void AddResultTypeChunk (const char *ResultType)
 Add a new result-type chunk.
void AddCurrentParameterChunk (const char *CurrentParameter)
 Add a new current-parameter chunk.
void AddChunk (CodeCompletionString::ChunkKind CK, const char *Text="")
 Add a new chunk.
void AddAnnotation (const char *A)
void addParentContext (const DeclContext *DC)
 Add the parent context information to this code completion.
const char * getBriefComment () const
void addBriefComment (StringRef Comment)
StringRef getParentName () const

Detailed Description

A builder class used to construct new code-completion strings.

Definition at line 676 of file CodeCompleteConsumer.h.

Member Typedef Documentation

◆ Chunk

Definition at line 678 of file CodeCompleteConsumer.h.

Constructor & Destructor Documentation

◆ CodeCompletionBuilder() [1/2]

clang::CodeCompletionBuilder::CodeCompletionBuilder ( CodeCompletionAllocator Allocator,
CodeCompletionTUInfo CCTUInfo 

Definition at line 694 of file CodeCompleteConsumer.h.

◆ CodeCompletionBuilder() [2/2]

clang::CodeCompletionBuilder::CodeCompletionBuilder ( CodeCompletionAllocator Allocator,
CodeCompletionTUInfo CCTUInfo,
unsigned  Priority,
CXAvailabilityKind  Availability 

Definition at line 698 of file CodeCompleteConsumer.h.

References Priority.

Member Function Documentation

◆ AddAnnotation()

void clang::CodeCompletionBuilder::AddAnnotation ( const char *  A)

Definition at line 739 of file CodeCompleteConsumer.h.

◆ addBriefComment()

void CodeCompletionBuilder::addBriefComment ( StringRef  Comment)

Definition at line 489 of file CodeCompleteConsumer.cpp.

◆ AddChunk()

void CodeCompletionBuilder::AddChunk ( CodeCompletionString::ChunkKind  CK,
const char *  Text = "" 

◆ AddCurrentParameterChunk()

void CodeCompletionBuilder::AddCurrentParameterChunk ( const char *  CurrentParameter)

Add a new current-parameter chunk.

Definition at line 466 of file CodeCompleteConsumer.cpp.

References clang::CodeCompletionString::Chunk::CreateCurrentParameter().

Referenced by AddOverloadParameterChunks().

◆ AddInformativeChunk()

void CodeCompletionBuilder::AddInformativeChunk ( const char *  Text)

Add a new informative chunk.

Definition at line 458 of file CodeCompleteConsumer.cpp.

References clang::CodeCompletionString::Chunk::CreateInformative(), and Text.

◆ AddOptionalChunk()

void CodeCompletionBuilder::AddOptionalChunk ( CodeCompletionString Optional)

Add a new optional chunk.

Definition at line 450 of file CodeCompleteConsumer.cpp.

References clang::CodeCompletionString::Chunk::CreateOptional().

◆ addParentContext()

void CodeCompletionBuilder::addParentContext ( const DeclContext DC)

Add the parent context information to this code completion.

Definition at line 476 of file CodeCompleteConsumer.cpp.

References clang::DeclContext::isFunctionOrMethod(), and clang::DeclContext::isTranslationUnit().

◆ AddPlaceholderChunk()

void CodeCompletionBuilder::AddPlaceholderChunk ( const char *  Placeholder)

◆ AddResultTypeChunk()

void CodeCompletionBuilder::AddResultTypeChunk ( const char *  ResultType)

Add a new result-type chunk.

Definition at line 462 of file CodeCompleteConsumer.cpp.

References clang::CodeCompletionString::Chunk::CreateResultType().

◆ AddTextChunk()

void CodeCompletionBuilder::AddTextChunk ( const char *  Text)

◆ AddTypedTextChunk()

void CodeCompletionBuilder::AddTypedTextChunk ( const char *  Text)

Add a new typed-text chunk.

Definition at line 442 of file CodeCompleteConsumer.cpp.

References clang::CodeCompletionString::CK_TypedText, and Text.

Referenced by clang::Sema::CodeCompleteObjCPropertyFlags().

◆ getAllocator()

CodeCompletionAllocator & clang::CodeCompletionBuilder::getAllocator ( ) const

Retrieve the allocator into which the code completion strings should be allocated.

Definition at line 706 of file CodeCompleteConsumer.h.

Referenced by AddLambdaCompletion().

◆ getBriefComment()

const char * clang::CodeCompletionBuilder::getBriefComment ( ) const

Definition at line 744 of file CodeCompleteConsumer.h.

◆ getCodeCompletionTUInfo()

CodeCompletionTUInfo & clang::CodeCompletionBuilder::getCodeCompletionTUInfo ( ) const

Definition at line 708 of file CodeCompleteConsumer.h.

◆ getParentName()

StringRef clang::CodeCompletionBuilder::getParentName ( ) const

Definition at line 747 of file CodeCompleteConsumer.h.

◆ TakeString()

CodeCompletionString * CodeCompletionBuilder::TakeString ( )

Take the resulting completion string.

This operation can only be performed once.

Definition at line 430 of file CodeCompleteConsumer.cpp.

References Priority, and clang::Result.

Referenced by AddFunctionParameterChunks(), AddLambdaCompletion(), AddOverloadParameterChunks(), AddTemplateParameterChunks(), clang::Sema::CodeCompleteObjCPropertyFlags(), and createTemplateSignatureString().

The documentation for this class was generated from the following files: