LLDB  mainline
Public Member Functions | List of all members
lldb_private::CompletionRequest Class Reference

"lldb/Utility/ArgCompletionRequest.h" More...

#include <CompletionRequest.h>

Public Member Functions

 CompletionRequest (llvm::StringRef command_line, unsigned raw_cursor_pos, int match_start_point, int max_return_elements, CompletionResult &result)
 Constructs a completion request. More...
 
llvm::StringRef GetRawLine () const
 
unsigned GetRawCursorPos () const
 
const ArgsGetParsedLine () const
 
ArgsGetParsedLine ()
 
const ArgsGetPartialParsedLine () const
 
void SetCursorIndex (int i)
 
int GetCursorIndex () const
 
void SetCursorCharPosition (int pos)
 
int GetCursorCharPosition () const
 
int GetMatchStartPoint () const
 
int GetMaxReturnElements () const
 
bool GetWordComplete ()
 
void SetWordComplete (bool v)
 
void AddCompletion (llvm::StringRef completion, llvm::StringRef description="")
 Adds a possible completion string. More...
 
void AddCompletions (const StringList &completions)
 Adds multiple possible completion strings. More...
 
void AddCompletions (const StringList &completions, const StringList &descriptions)
 Adds multiple possible completion strings alongside their descriptions. More...
 
std::size_t GetNumberOfMatches () const
 
llvm::StringRef GetCursorArgument () const
 
llvm::StringRef GetCursorArgumentPrefix () const
 

Detailed Description

"lldb/Utility/ArgCompletionRequest.h"

Contains all information necessary to complete an incomplete command for the user. Will be filled with the generated completions by the different completions functions.

Definition at line 59 of file CompletionRequest.h.

Constructor & Destructor Documentation

◆ CompletionRequest()

CompletionRequest::CompletionRequest ( llvm::StringRef  command_line,
unsigned  raw_cursor_pos,
int  match_start_point,
int  max_return_elements,
CompletionResult result 
)

Constructs a completion request.

Parameters
[in]command_lineThe command line the user has typed at this point.
[in]raw_cursor_posThe position of the cursor in the command line string. Index 0 means the cursor is at the start of the line. The completion starts from this cursor position.
[in]match_start_point
[in]max_return_elementsIf there is a match that is expensive to compute, these are here to allow you to compute the completions in batches. Start the completion from match_start_point, and return match_return_elements elements.
[out]resultThe CompletionResult that will be filled with the results after this request has been handled.

Definition at line 14 of file CompletionRequest.cpp.

References lldb_private::Args::GetArgumentAtIndex(), lldb_private::Args::GetArgumentCount(), and lldb_private::Args::InsertArgumentAtIndex().

Member Function Documentation

◆ AddCompletion()

void lldb_private::CompletionRequest::AddCompletion ( llvm::StringRef  completion,
llvm::StringRef  description = "" 
)
inline

◆ AddCompletions() [1/2]

void lldb_private::CompletionRequest::AddCompletions ( const StringList completions)
inline

◆ AddCompletions() [2/2]

void lldb_private::CompletionRequest::AddCompletions ( const StringList completions,
const StringList descriptions 
)
inline

Adds multiple possible completion strings alongside their descriptions.

The number of completions and descriptions must be identical.

Parameters
completionsThe list of completions.
completionsThe list of descriptions.
See also
AddCompletion

Definition at line 140 of file CompletionRequest.h.

References lldb_private::StringList::GetSize(), lldb_private::StringList::GetStringAtIndex(), and lldbassert.

◆ GetCursorArgument()

llvm::StringRef lldb_private::CompletionRequest::GetCursorArgument ( ) const
inline

Definition at line 152 of file CompletionRequest.h.

Referenced by lldb_private::Options::HandleOptionCompletion().

◆ GetCursorArgumentPrefix()

llvm::StringRef lldb_private::CompletionRequest::GetCursorArgumentPrefix ( ) const
inline

◆ GetCursorCharPosition()

int lldb_private::CompletionRequest::GetCursorCharPosition ( ) const
inline

◆ GetCursorIndex()

int lldb_private::CompletionRequest::GetCursorIndex ( ) const
inline

◆ GetMatchStartPoint()

int lldb_private::CompletionRequest::GetMatchStartPoint ( ) const
inline

Definition at line 101 of file CompletionRequest.h.

Referenced by lldb_private::FormatEntity::AutoComplete().

◆ GetMaxReturnElements()

int lldb_private::CompletionRequest::GetMaxReturnElements ( ) const
inline

Definition at line 103 of file CompletionRequest.h.

◆ GetNumberOfMatches()

std::size_t lldb_private::CompletionRequest::GetNumberOfMatches ( ) const
inline

Definition at line 148 of file CompletionRequest.h.

Referenced by lldb_private::OptionValueBoolean::AutoComplete(), lldb_private::OptionValueFileSpec::AutoComplete(), lldb_private::OptionValueUUID::AutoComplete(), lldb_private::OptionValueEnumeration::AutoComplete(), lldb_private::OptionValueArch::AutoComplete(), lldb_private::OptionValue::AutoComplete(), lldb_private::Variable::AutoComplete(), lldb_private::FormatEntity::AutoComplete(), lldb_private::ArchSpec::AutoComplete(), DiskFilesOrDirectories(), lldb_private::CommandCompletions::SourceFileCompleter::DoCompletion(), lldb_private::CommandCompletions::ModuleCompleter::DoCompletion(), lldb_private::CommandCompletions::SymbolCompleter::DoCompletion(), CommandObjectPluginLoad::HandleArgumentCompletion(), CommandObjectProcessLaunch::HandleArgumentCompletion(), CommandObjectSettingsSet::HandleArgumentCompletion(), CommandObjectCommandsSource::HandleArgumentCompletion(), CommandObjectTargetCreate::HandleArgumentCompletion(), CommandObjectSettingsShow::HandleArgumentCompletion(), CommandObjectFrameVariable::HandleArgumentCompletion(), CommandObjectSettingsList::HandleArgumentCompletion(), CommandObjectCommandsScriptImport::HandleArgumentCompletion(), CommandObjectTargetModulesModuleAutoComplete::HandleArgumentCompletion(), CommandObjectTargetModulesSourceFileAutoComplete::HandleArgumentCompletion(), CommandObjectTargetModulesAdd::HandleArgumentCompletion(), CommandObjectTargetSymbolsAdd::HandleArgumentCompletion(), lldb_private::CommandObjectRegexCommand::HandleCompletion(), lldb_private::CommandObjectMultiword::HandleCompletion(), lldb_private::CommandObjectExpression::HandleCompletion(), CommandObjectPlatformSelect::HandleCompletion(), lldb_private::CommandObject::HandleCompletion(), lldb_private::CommandInterpreter::HandleCompletionMatches(), lldb_private::CommandCompletions::Modules(), lldb_private::CommandCompletions::PlatformPluginNames(), lldb_private::CommandCompletions::SettingsNames(), lldb_private::CommandCompletions::SourceFiles(), and lldb_private::CommandCompletions::Symbols().

◆ GetParsedLine() [1/2]

const Args& lldb_private::CompletionRequest::GetParsedLine ( ) const
inline

◆ GetParsedLine() [2/2]

Args& lldb_private::CompletionRequest::GetParsedLine ( )
inline

Definition at line 91 of file CompletionRequest.h.

◆ GetPartialParsedLine()

const Args& lldb_private::CompletionRequest::GetPartialParsedLine ( ) const
inline

Definition at line 93 of file CompletionRequest.h.

◆ GetRawCursorPos()

unsigned lldb_private::CompletionRequest::GetRawCursorPos ( ) const
inline

◆ GetRawLine()

llvm::StringRef lldb_private::CompletionRequest::GetRawLine ( ) const
inline

◆ GetWordComplete()

bool lldb_private::CompletionRequest::GetWordComplete ( )
inline

◆ SetCursorCharPosition()

void lldb_private::CompletionRequest::SetCursorCharPosition ( int  pos)
inline

◆ SetCursorIndex()

void lldb_private::CompletionRequest::SetCursorIndex ( int  i)
inline

◆ SetWordComplete()

void lldb_private::CompletionRequest::SetWordComplete ( bool  v)
inline

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