clang API Documentation
A builder class used to construct new code-completion strings. More...
#include <CodeCompleteConsumer.h>
Public Types | |
typedef CodeCompletionString::Chunk | Chunk |
Public Member Functions | |
CodeCompletionBuilder (CodeCompletionAllocator &Allocator, CodeCompletionTUInfo &CCTUInfo) | |
CodeCompletionBuilder (CodeCompletionAllocator &Allocator, CodeCompletionTUInfo &CCTUInfo, unsigned Priority, CXAvailabilityKind Availability) | |
CodeCompletionAllocator & | getAllocator () const |
Retrieve the allocator into which the code completion strings should be allocated. | |
CodeCompletionTUInfo & | getCodeCompletionTUInfo () const |
CodeCompletionString * | TakeString () |
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 |
A builder class used to construct new code-completion strings.
Definition at line 556 of file CodeCompleteConsumer.h.
Definition at line 558 of file CodeCompleteConsumer.h.
clang::CodeCompletionBuilder::CodeCompletionBuilder | ( | CodeCompletionAllocator & | Allocator, |
CodeCompletionTUInfo & | CCTUInfo | ||
) | [inline] |
Definition at line 574 of file CodeCompleteConsumer.h.
clang::CodeCompletionBuilder::CodeCompletionBuilder | ( | CodeCompletionAllocator & | Allocator, |
CodeCompletionTUInfo & | CCTUInfo, | ||
unsigned | Priority, | ||
CXAvailabilityKind | Availability | ||
) | [inline] |
Definition at line 580 of file CodeCompleteConsumer.h.
void clang::CodeCompletionBuilder::AddAnnotation | ( | const char * | A | ) | [inline] |
Definition at line 622 of file CodeCompleteConsumer.h.
Referenced by clang::CodeCompletionResult::CreateCodeCompletionString().
void CodeCompletionBuilder::addBriefComment | ( | StringRef | Comment | ) |
Definition at line 394 of file CodeCompleteConsumer.cpp.
References Allocator.
Referenced by clang::CodeCompletionResult::CreateCodeCompletionString().
void CodeCompletionBuilder::AddChunk | ( | CodeCompletionString::ChunkKind | CK, |
const char * | Text = "" |
||
) |
Add a new chunk.
Definition at line 374 of file CodeCompleteConsumer.cpp.
Referenced by AddFunctionParameterChunks(), AddObjCPassingTypeChunk(), AddTemplateParameterChunks(), clang::CodeCompletionResult::CreateCodeCompletionString(), and clang::CodeCompleteConsumer::OverloadCandidate::CreateSignatureString().
void CodeCompletionBuilder::AddCurrentParameterChunk | ( | const char * | CurrentParameter | ) |
Add a new current-parameter chunk.
Definition at line 370 of file CodeCompleteConsumer.cpp.
References clang::CodeCompletionString::Chunk::CreateCurrentParameter().
void CodeCompletionBuilder::AddInformativeChunk | ( | const char * | Text | ) |
Add a new informative chunk.
Definition at line 361 of file CodeCompleteConsumer.cpp.
References clang::CodeCompletionString::Chunk::CreateInformative().
Referenced by AddFunctionTypeQualsToCompletionString(), AddQualifierToCompletionString(), and clang::CodeCompletionResult::CreateCodeCompletionString().
void CodeCompletionBuilder::AddOptionalChunk | ( | CodeCompletionString * | Optional | ) |
Add a new optional chunk.
Definition at line 353 of file CodeCompleteConsumer.cpp.
References clang::CodeCompletionString::Chunk::CreateOptional().
Referenced by AddFunctionParameterChunks(), and AddTemplateParameterChunks().
void CodeCompletionBuilder::addParentContext | ( | const DeclContext * | DC | ) |
Add the parent context information to this code completion.
Definition at line 379 of file CodeCompleteConsumer.cpp.
References clang::DeclContext::isFunctionOrMethod(), and clang::DeclContext::isTranslationUnit().
Referenced by clang::CodeCompletionResult::CreateCodeCompletionString().
void CodeCompletionBuilder::AddPlaceholderChunk | ( | const char * | Placeholder | ) |
Add a new placeholder chunk.
Definition at line 357 of file CodeCompleteConsumer.cpp.
References clang::CodeCompletionString::Chunk::CreatePlaceholder().
Referenced by AddFunctionParameterChunks(), AddTemplateParameterChunks(), and clang::CodeCompletionResult::CreateCodeCompletionString().
void CodeCompletionBuilder::AddResultTypeChunk | ( | const char * | ResultType | ) |
Add a new result-type chunk.
Definition at line 365 of file CodeCompleteConsumer.cpp.
References clang::CodeCompletionString::Chunk::CreateResultType().
Referenced by AddResultTypeChunk().
void CodeCompletionBuilder::AddTextChunk | ( | const char * | Text | ) |
Add a new text chunk.
Definition at line 349 of file CodeCompleteConsumer.cpp.
References clang::CodeCompletionString::Chunk::CreateText().
Referenced by AddObjCPassingTypeChunk(), AddQualifierToCompletionString(), clang::CodeCompletionResult::CreateCodeCompletionString(), clang::CodeCompleteConsumer::OverloadCandidate::CreateSignatureString(), and MaybeAddSentinel().
void CodeCompletionBuilder::AddTypedTextChunk | ( | const char * | Text | ) |
Add a new typed-text chunk.
Definition at line 345 of file CodeCompleteConsumer.cpp.
References clang::CodeCompletionString::CK_TypedText.
Referenced by clang::Sema::CodeCompleteObjCPropertyFlags(), and clang::CodeCompletionResult::CreateCodeCompletionString().
CodeCompletionAllocator& clang::CodeCompletionBuilder::getAllocator | ( | ) | const [inline] |
Retrieve the allocator into which the code completion strings should be allocated.
Definition at line 589 of file CodeCompleteConsumer.h.
Referenced by AddFunctionParameterChunks(), AddFunctionTypeQualsToCompletionString(), AddObjCPassingTypeChunk(), AddQualifierToCompletionString(), AddResultTypeChunk(), AddTemplateParameterChunks(), clang::CodeCompletionResult::CreateCodeCompletionString(), and clang::CodeCompleteConsumer::OverloadCandidate::CreateSignatureString().
const char* clang::CodeCompletionBuilder::getBriefComment | ( | ) | const [inline] |
Definition at line 627 of file CodeCompleteConsumer.h.
Referenced by clang::CodeCompletionResult::CreateCodeCompletionString().
CodeCompletionTUInfo& clang::CodeCompletionBuilder::getCodeCompletionTUInfo | ( | ) | const [inline] |
Definition at line 591 of file CodeCompleteConsumer.h.
Referenced by AddFunctionParameterChunks(), and AddTemplateParameterChunks().
StringRef clang::CodeCompletionBuilder::getParentName | ( | ) | const [inline] |
Definition at line 630 of file CodeCompleteConsumer.h.
Referenced by clang::CodeCompletionResult::CreateCodeCompletionString().
Take the resulting completion string.
This operation can only be performed once.
Definition at line 331 of file CodeCompleteConsumer.cpp.
Referenced by clang::CodeCompletionResult::CreateCodeCompletionString(), and clang::CodeCompleteConsumer::OverloadCandidate::CreateSignatureString().