clang 22.0.0git
clang::PrintingCodeCompleteConsumer Class Reference

A simple code-completion consumer that prints the results it receives in a simple format. More...

#include "clang/Sema/CodeCompleteConsumer.h"

Inheritance diagram for clang::PrintingCodeCompleteConsumer:
[legend]

Public Member Functions

 PrintingCodeCompleteConsumer (const CodeCompleteOptions &CodeCompleteOpts, raw_ostream &OS)
 Create a new printing code-completion consumer that prints its results to the given raw output stream.
void ProcessCodeCompleteResults (Sema &S, CodeCompletionContext Context, CodeCompletionResult *Results, unsigned NumResults) override
 Prints the finalized code-completion results.
void ProcessOverloadCandidates (Sema &S, unsigned CurrentArg, OverloadCandidate *Candidates, unsigned NumCandidates, SourceLocation OpenParLoc, bool Braced) override
bool isResultFilteredOut (StringRef Filter, CodeCompletionResult Results) override
CodeCompletionAllocatorgetAllocator () override
 Retrieve the allocator that will be used to allocate code completion strings.
CodeCompletionTUInfogetCodeCompletionTUInfo () override
Public Member Functions inherited from clang::CodeCompleteConsumer
 CodeCompleteConsumer (const CodeCompleteOptions &CodeCompleteOpts)
bool includeMacros () const
 Whether the code-completion consumer wants to see macros.
bool includeCodePatterns () const
 Whether the code-completion consumer wants to see code patterns.
bool includeGlobals () const
 Whether to include global (top-level) declaration results.
bool includeNamespaceLevelDecls () const
 Whether to include declarations in namespace contexts (including the global namespace).
bool includeBriefComments () const
 Whether to include brief documentation comments within the set of code completions returned.
bool includeFixIts () const
 Whether to include completion items with small fix-its, e.g.
bool loadExternal () const
 Hint whether to load data from the external AST in order to provide full results.
virtual ~CodeCompleteConsumer ()
 Deregisters and destroys this code-completion consumer.

Additional Inherited Members

Protected Attributes inherited from clang::CodeCompleteConsumer
const CodeCompleteOptions CodeCompleteOpts

Detailed Description

A simple code-completion consumer that prints the results it receives in a simple format.

Definition at line 1262 of file CodeCompleteConsumer.h.

Constructor & Destructor Documentation

◆ PrintingCodeCompleteConsumer()

clang::PrintingCodeCompleteConsumer::PrintingCodeCompleteConsumer ( const CodeCompleteOptions & CodeCompleteOpts,
raw_ostream & OS )
inline

Create a new printing code-completion consumer that prints its results to the given raw output stream.

Definition at line 1271 of file CodeCompleteConsumer.h.

References clang::CodeCompleteConsumer::CodeCompleteConsumer(), and clang::CodeCompleteConsumer::CodeCompleteOpts.

Member Function Documentation

◆ getAllocator()

CodeCompletionAllocator & clang::PrintingCodeCompleteConsumer::getAllocator ( )
inlineoverridevirtual

Retrieve the allocator that will be used to allocate code completion strings.

Implements clang::CodeCompleteConsumer.

Definition at line 1289 of file CodeCompleteConsumer.h.

Referenced by ProcessCodeCompleteResults(), and ProcessOverloadCandidates().

◆ getCodeCompletionTUInfo()

CodeCompletionTUInfo & clang::PrintingCodeCompleteConsumer::getCodeCompletionTUInfo ( )
inlineoverridevirtual

Implements clang::CodeCompleteConsumer.

Definition at line 1293 of file CodeCompleteConsumer.h.

◆ isResultFilteredOut()

bool PrintingCodeCompleteConsumer::isResultFilteredOut ( StringRef Filter,
CodeCompletionResult Results )
overridevirtual

◆ ProcessCodeCompleteResults()

◆ ProcessOverloadCandidates()

void PrintingCodeCompleteConsumer::ProcessOverloadCandidates ( Sema & S,
unsigned CurrentArg,
OverloadCandidate * Candidates,
unsigned NumCandidates,
SourceLocation OpenParLoc,
bool Braced )
overridevirtual
Parameters
Sthe semantic-analyzer object for which code-completion is being done.
CurrentArgthe index of the current argument.
Candidatesan array of overload candidates.
NumCandidatesthe number of overload candidates
OpenParLoclocation of the opening parenthesis of the argument list.

Reimplemented from clang::CodeCompleteConsumer.

Definition at line 751 of file CodeCompleteConsumer.cpp.

References getAllocator(), getOverloadAsString(), clang::Sema::getSourceManager(), clang::CodeCompleteConsumer::includeBriefComments(), and clang::SourceLocation::print().


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