diff options
Diffstat (limited to 'lldb/source/Commands/CommandObjectPlatform.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectPlatform.cpp | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/lldb/source/Commands/CommandObjectPlatform.cpp b/lldb/source/Commands/CommandObjectPlatform.cpp index 3a27f34fec7..f822a8b54cb 100644 --- a/lldb/source/Commands/CommandObjectPlatform.cpp +++ b/lldb/source/Commands/CommandObjectPlatform.cpp @@ -179,16 +179,8 @@ public: ~CommandObjectPlatformSelect() override = default; int HandleCompletion(CompletionRequest &request) override { - std::string completion_str( - request.GetParsedLine().GetArgumentAtIndex(request.GetCursorIndex())); - completion_str.erase(request.GetCursorCharPosition()); - - bool word_complete = request.GetWordComplete(); - CommandCompletions::PlatformPluginNames( - GetCommandInterpreter(), completion_str.c_str(), - request.GetMatchStartPoint(), request.GetMaxReturnElements(), nullptr, - word_complete, request.GetMatches()); - request.SetWordComplete(word_complete); + CommandCompletions::PlatformPluginNames(GetCommandInterpreter(), request, + nullptr); return request.GetMatches().GetSize(); } @@ -1562,11 +1554,8 @@ public: } bool HandleOptionArgumentCompletion( - Args &input, int cursor_index, int char_pos, - OptionElementVector &opt_element_vector, int opt_element_index, - int match_start_point, int max_return_elements, - CommandInterpreter &interpreter, bool &word_complete, - StringList &matches) override { + CompletionRequest &request, OptionElementVector &opt_element_vector, + int opt_element_index, CommandInterpreter &interpreter) override { int opt_arg_pos = opt_element_vector[opt_element_index].opt_arg_pos; int opt_defs_index = opt_element_vector[opt_element_index].opt_defs_index; @@ -1579,7 +1568,7 @@ public: // plugin, otherwise use the default plugin. const char *partial_name = nullptr; - partial_name = input.GetArgumentAtIndex(opt_arg_pos); + partial_name = request.GetParsedLine().GetArgumentAtIndex(opt_arg_pos); PlatformSP platform_sp(interpreter.GetPlatform(true)); if (platform_sp) { @@ -1594,7 +1583,7 @@ public: const uint32_t num_matches = process_infos.GetSize(); if (num_matches > 0) { for (uint32_t i = 0; i < num_matches; ++i) { - matches.AppendString( + request.GetMatches().AppendString( process_infos.GetProcessNameAtIndex(i), process_infos.GetProcessNameLengthAtIndex(i)); } |