clang 10.0.0git

Classes | Public Member Functions | Protected Attributes | List of all members
clang::CodeCompleteConsumer Class Referenceabstract

Abstract interface for a consumer of code-completion information. More...

`#include "clang/Sema/CodeCompleteConsumer.h"`

Inheritance diagram for clang::CodeCompleteConsumer:
[legend]
Collaboration diagram for clang::CodeCompleteConsumer:
[legend]

## Classes
class | OverloadCandidate

## Public Member Functions
| CodeCompleteConsumer (const CodeCompleteOptions &CodeCompleteOpts)
bool | includeMacros () const
| Whether the code-completion consumer wants to see macros. More...
bool | includeCodePatterns () const
| Whether the code-completion consumer wants to see code patterns. More...
bool | includeGlobals () const
| Whether to include global (top-level) declaration results. More...
bool | includeNamespaceLevelDecls () const
| Whether to include declarations in namespace contexts (including the global namespace). More...
bool | includeBriefComments () const
| Whether to include brief documentation comments within the set of code completions returned. More...
bool | includeFixIts () const
| Whether to include completion items with small fix-its, e.g. More...
bool | loadExternal () const
| Hint whether to load data from the external AST in order to provide full results. More...
virtual | ~CodeCompleteConsumer ()
| Deregisters and destroys this code-completion consumer. More...
virtual CodeCompletionAllocator & | getAllocator ()=0
| Retrieve the allocator that will be used to allocate code completion strings. More...
virtual CodeCompletionTUInfo & | getCodeCompletionTUInfo ()=0
Code-completion filtering
Check if the result should be filtered out.
virtual bool | isResultFilteredOut (StringRef Filter, CodeCompletionResult Results)
Code-completion callbacks
virtual void | ProcessCodeCompleteResults (Sema &S, CodeCompletionContext Context, CodeCompletionResult *Results, unsigned NumResults)
| Process the finalized code-completion results. More...
virtual void | ProcessOverloadCandidates (Sema &S, unsigned CurrentArg, OverloadCandidate *Candidates, unsigned NumCandidates, SourceLocation OpenParLoc)

## Protected Attributes
const CodeCompleteOptions | CodeCompleteOpts

## Detailed Description

Abstract interface for a consumer of code-completion information.

Definition at line 1000 of file CodeCompleteConsumer.h.

## Constructor & Destructor Documentation

## ◆ CodeCompleteConsumer()

clang::CodeCompleteConsumer::CodeCompleteConsumer | ( | const CodeCompleteOptions & | CodeCompleteOpts | ) |
| inline

Definition at line 1074 of file CodeCompleteConsumer.h.

## ◆ ~CodeCompleteConsumer()

CodeCompleteConsumer::~CodeCompleteConsumer | ( |  | ) |
| virtual default

Deregisters and destroys this code-completion consumer.

Referenced by clang::CodeCompleteConsumer::OverloadCandidate::getFunctionType().

## Member Function Documentation

## ◆ getAllocator()

virtual CodeCompletionAllocator& clang::CodeCompleteConsumer::getAllocator | ( |  | ) |
| pure virtual

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

Implemented in clang::PrintingCodeCompleteConsumer.

## ◆ getCodeCompletionTUInfo()

virtual CodeCompletionTUInfo& clang::CodeCompleteConsumer::getCodeCompletionTUInfo | ( |  | ) |
| pure virtual

Implemented in clang::PrintingCodeCompleteConsumer.

## ◆ includeBriefComments()

bool clang::CodeCompleteConsumer::includeBriefComments | ( |  | ) | const
| inline

Whether to include brief documentation comments within the set of code completions returned.

Definition at line 1099 of file CodeCompleteConsumer.h.

References clang::CodeCompleteOptions::IncludeBriefComments.

## ◆ includeCodePatterns()

bool clang::CodeCompleteConsumer::includeCodePatterns | ( |  | ) | const
| inline

Whether the code-completion consumer wants to see code patterns.

Definition at line 1083 of file CodeCompleteConsumer.h.

References clang::CodeCompleteOptions::IncludeCodePatterns.

## ◆ includeFixIts()

bool clang::CodeCompleteConsumer::includeFixIts | ( |  | ) | const
| inline

Whether to include completion items with small fix-its, e.g.

change '.' to '->' on member access, etc.

Definition at line 1105 of file CodeCompleteConsumer.h.

References clang::CodeCompleteOptions::IncludeFixIts.

Referenced by clang::ASTUnit::CodeComplete().

## ◆ includeGlobals()

bool clang::CodeCompleteConsumer::includeGlobals | ( |  | ) | const
| inline

Whether to include global (top-level) declaration results.

Definition at line 1088 of file CodeCompleteConsumer.h.

References clang::CodeCompleteOptions::IncludeGlobals.

Referenced by AddRecordMembersCompletionResults().

## ◆ includeMacros()

bool clang::CodeCompleteConsumer::includeMacros | ( |  | ) | const
| inline

Whether the code-completion consumer wants to see macros.

Definition at line 1078 of file CodeCompleteConsumer.h.

References clang::CodeCompleteOptions::IncludeMacros.

## ◆ includeNamespaceLevelDecls()

bool clang::CodeCompleteConsumer::includeNamespaceLevelDecls | ( |  | ) | const
| inline

Whether to include declarations in namespace contexts (including the global namespace).

If this is false, `includeGlobals()` will be ignored.

Definition at line 1093 of file CodeCompleteConsumer.h.

References clang::CodeCompleteOptions::IncludeNamespaceLevelDecls.

## ◆ isResultFilteredOut()

virtual bool clang::CodeCompleteConsumer::isResultFilteredOut | ( | StringRef | Filter,
|  | CodeCompletionResult | Results
| ) |  |
| inline virtual

Reimplemented in clang::PrintingCodeCompleteConsumer.

Definition at line 1118 of file CodeCompleteConsumer.h.

## ◆ loadExternal()

bool clang::CodeCompleteConsumer::loadExternal | ( |  | ) | const
| inline

Hint whether to load data from the external AST in order to provide full results.

If false, declarations from the preamble may be omitted.

Definition at line 1109 of file CodeCompleteConsumer.h.

References clang::CodeCompleteOptions::LoadExternal.

Referenced by AddRecordMembersCompletionResults(), and clang::ASTUnit::CodeComplete().

## ◆ ProcessCodeCompleteResults()

virtual void clang::CodeCompleteConsumer::ProcessCodeCompleteResults | ( | Sema & | S,
|  | CodeCompletionContext | Context,
|  | CodeCompletionResult * | Results,
|  | unsigned | NumResults
| ) |  |
| inline virtual

Process the finalized code-completion results.

Reimplemented in clang::PrintingCodeCompleteConsumer.

Definition at line 1126 of file CodeCompleteConsumer.h.

## ◆ ProcessOverloadCandidates()

virtual void clang::CodeCompleteConsumer::ProcessOverloadCandidates | ( | Sema & | S,
|  | unsigned | CurrentArg,
|  | OverloadCandidate * | Candidates,
|  | unsigned | NumCandidates,
|  | SourceLocation | OpenParLoc
| ) |  |
| inline virtual

Parameters

  S | the semantic-analyzer object for which code-completion is being done.
  CurrentArg | the index of the current argument.
  Candidates | an array of overload candidates.
  NumCandidates | the number of overload candidates
  OpenParLoc | location of the opening parenthesis of the argument list.

Reimplemented in clang::PrintingCodeCompleteConsumer.

Definition at line 1142 of file CodeCompleteConsumer.h.

Referenced by ProduceSignatureHelp().

## Member Data Documentation

## ◆ CodeCompleteOpts

const CodeCompleteOptions clang::CodeCompleteConsumer::CodeCompleteOpts
| protected

Definition at line 1002 of file CodeCompleteConsumer.h.

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

- include/clang/Sema/CodeCompleteConsumer.h
- lib/Sema/CodeCompleteConsumer.cpp