clang  13.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. More...
 
CodeCompletionTUInfogetCodeCompletionTUInfo () const
 
CodeCompletionStringTakeString ()
 Take the resulting completion string. More...
 
void AddTypedTextChunk (const char *Text)
 Add a new typed-text chunk. More...
 
void AddTextChunk (const char *Text)
 Add a new text chunk. More...
 
void AddOptionalChunk (CodeCompletionString *Optional)
 Add a new optional chunk. More...
 
void AddPlaceholderChunk (const char *Placeholder)
 Add a new placeholder chunk. More...
 
void AddInformativeChunk (const char *Text)
 Add a new informative chunk. More...
 
void AddResultTypeChunk (const char *ResultType)
 Add a new result-type chunk. More...
 
void AddCurrentParameterChunk (const char *CurrentParameter)
 Add a new current-parameter chunk. More...
 
void AddChunk (CodeCompletionString::ChunkKind CK, const char *Text="")
 Add a new chunk. More...
 
void AddAnnotation (const char *A)
 
void addParentContext (const DeclContext *DC)
 Add the parent context information to this code completion. More...
 
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 671 of file CodeCompleteConsumer.h.

Member Typedef Documentation

◆ Chunk

Definition at line 673 of file CodeCompleteConsumer.h.

Constructor & Destructor Documentation

◆ CodeCompletionBuilder() [1/2]

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

Definition at line 689 of file CodeCompleteConsumer.h.

◆ CodeCompletionBuilder() [2/2]

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

Definition at line 693 of file CodeCompleteConsumer.h.

References Priority.

Member Function Documentation

◆ AddAnnotation()

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

Definition at line 734 of file CodeCompleteConsumer.h.

◆ addBriefComment()

void CodeCompletionBuilder::addBriefComment ( StringRef  Comment)

Definition at line 478 of file CodeCompleteConsumer.cpp.

◆ AddChunk()

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

Add a new chunk.

Definition at line 460 of file CodeCompleteConsumer.cpp.

References Text.

Referenced by AddFunctionParameterChunks(), AddOverloadParameterChunks(), and AddTemplateParameterChunks().

◆ AddCurrentParameterChunk()

void CodeCompletionBuilder::AddCurrentParameterChunk ( const char *  CurrentParameter)

Add a new current-parameter chunk.

Definition at line 455 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 447 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 439 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 465 of file CodeCompleteConsumer.cpp.

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

◆ AddPlaceholderChunk()

void CodeCompletionBuilder::AddPlaceholderChunk ( const char *  Placeholder)

Add a new placeholder chunk.

Definition at line 443 of file CodeCompleteConsumer.cpp.

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

Referenced by AddOverloadParameterChunks().

◆ AddResultTypeChunk()

void CodeCompletionBuilder::AddResultTypeChunk ( const char *  ResultType)

Add a new result-type chunk.

Definition at line 451 of file CodeCompleteConsumer.cpp.

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

◆ AddTextChunk()

void CodeCompletionBuilder::AddTextChunk ( const char *  Text)

Add a new text chunk.

Definition at line 435 of file CodeCompleteConsumer.cpp.

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

◆ AddTypedTextChunk()

void CodeCompletionBuilder::AddTypedTextChunk ( const char *  Text)

Add a new typed-text chunk.

Definition at line 431 of file CodeCompleteConsumer.cpp.

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

◆ getAllocator()

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

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

Definition at line 701 of file CodeCompleteConsumer.h.

◆ getBriefComment()

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

Definition at line 739 of file CodeCompleteConsumer.h.

◆ getCodeCompletionTUInfo()

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

Definition at line 703 of file CodeCompleteConsumer.h.

◆ getParentName()

StringRef clang::CodeCompletionBuilder::getParentName ( ) const
inline

Definition at line 742 of file CodeCompleteConsumer.h.

◆ TakeString()

CodeCompletionString * CodeCompletionBuilder::TakeString ( )

Take the resulting completion string.

This operation can only be performed once.

Definition at line 419 of file CodeCompleteConsumer.cpp.

References Priority.

Referenced by AddFunctionParameterChunks(), AddOverloadParameterChunks(), and AddTemplateParameterChunks().


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