clang 20.0.0git
Public Member Functions | Protected Attributes | List of all members
clang::CompletionContextHandler Class Reference

The class CompletionContextHandler contains four interfaces, each of which handles one type of completion result. More...

Inheritance diagram for clang::CompletionContextHandler:
Inheritance graph
[legend]

Public Member Functions

 CompletionContextHandler (Sema &S, CodeCompletionContext CCC, std::vector< std::string > &Results)
 
virtual ~CompletionContextHandler ()=default
 
virtual void handleDeclaration (const CodeCompletionResult &Result)
 Converts a Declaration completion result to a completion string, and then stores it in Results.
 
virtual void handleKeyword (const CodeCompletionResult &Result)
 Converts a Keyword completion result to a completion string, and then stores it in Results.
 
virtual void handlePattern (const CodeCompletionResult &Result)
 Converts a Pattern completion result to a completion string, and then stores it in Results.
 
virtual void handleMacro (const CodeCompletionResult &Result)
 Converts a Macro completion result to a completion string, and then stores it in Results.
 

Protected Attributes

CodeCompletionContext CCC
 
std::vector< std::string > & Results
 

Detailed Description

The class CompletionContextHandler contains four interfaces, each of which handles one type of completion result.

Its derived classes are used to create concrete handlers based on CodeCompletionContext.

Definition at line 73 of file CodeCompletion.cpp.

Constructor & Destructor Documentation

◆ CompletionContextHandler()

clang::CompletionContextHandler::CompletionContextHandler ( Sema S,
CodeCompletionContext  CCC,
std::vector< std::string > &  Results 
)
inline

Definition at line 82 of file CodeCompletion.cpp.

◆ ~CompletionContextHandler()

virtual clang::CompletionContextHandler::~CompletionContextHandler ( )
virtualdefault

Member Function Documentation

◆ handleDeclaration()

virtual void clang::CompletionContextHandler::handleDeclaration ( const CodeCompletionResult Result)
inlinevirtual

Converts a Declaration completion result to a completion string, and then stores it in Results.

Reimplemented in clang::DotMemberAccessHandler.

Definition at line 89 of file CodeCompletion.cpp.

References clang::Type::castAs(), CCC, getPointeeType(), clang::CodeCompletionContext::getPreferredType(), clang::Sema::Ref_Compatible, clang::Sema::Ref_Incompatible, clang::Sema::Ref_Related, clang::Result, and Results.

◆ handleKeyword()

virtual void clang::CompletionContextHandler::handleKeyword ( const CodeCompletionResult Result)
inlinevirtual

Converts a Keyword completion result to a completion string, and then stores it in Results.

Reimplemented in clang::DotMemberAccessHandler.

Definition at line 120 of file CodeCompletion.cpp.

References CCC, clang::CodeCompletionContext::getBaseType(), clang::CodeCompletionContext::getPreferredType(), clang::QualType::isNull(), clang::Result, and Results.

◆ handleMacro()

virtual void clang::CompletionContextHandler::handleMacro ( const CodeCompletionResult Result)
inlinevirtual

Converts a Macro completion result to a completion string, and then stores it in Results.

Definition at line 136 of file CodeCompletion.cpp.

◆ handlePattern()

virtual void clang::CompletionContextHandler::handlePattern ( const CodeCompletionResult Result)
inlinevirtual

Converts a Pattern completion result to a completion string, and then stores it in Results.

Definition at line 132 of file CodeCompletion.cpp.

Member Data Documentation

◆ CCC

CodeCompletionContext clang::CompletionContextHandler::CCC
protected

◆ Results

std::vector<std::string>& clang::CompletionContextHandler::Results
protected

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