aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/API/SBCommandInterpreter.cpp
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2019-08-15 13:14:10 +0000
committerRaphael Isemann <teemperor@gmail.com>2019-08-15 13:14:10 +0000
commit2fc20f652cd848abdbfc40b6ae7fc0b0b403ea7d (patch)
tree44d036fe01586ba334cff331edceca798c93799c /lldb/source/API/SBCommandInterpreter.cpp
parentdc23c832f4f7e5ae8204acfe800bdb611525c8bd (diff)
downloadllvm-2fc20f652cd848abdbfc40b6ae7fc0b0b403ea7d.zip
llvm-2fc20f652cd848abdbfc40b6ae7fc0b0b403ea7d.tar.gz
llvm-2fc20f652cd848abdbfc40b6ae7fc0b0b403ea7d.tar.bz2
[lldb][NFC] Refactor remaining completion logic to use CompletionRequests
This patch moves the remaining completion functions from the old completion API (that used several variables) to just passing a single CompletionRequest. This is for the most part a simple change as we just replace the old arguments with a single CompletionRequest argument. There are a few places where I had to create new CompletionRequests in the called functions as CompletionRequests itself are immutable and don't expose their internal match list anymore. This means that if a function wanted to change the CompletionRequest or directly access the result list, we need to work around this by creating a new CompletionRequest and a temporary match/description list. Preparation work for rdar://53769355 llvm-svn: 369000
Diffstat (limited to 'lldb/source/API/SBCommandInterpreter.cpp')
-rw-r--r--lldb/source/API/SBCommandInterpreter.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lldb/source/API/SBCommandInterpreter.cpp b/lldb/source/API/SBCommandInterpreter.cpp
index 1c07e85..ccc70b3 100644
--- a/lldb/source/API/SBCommandInterpreter.cpp
+++ b/lldb/source/API/SBCommandInterpreter.cpp
@@ -371,8 +371,11 @@ int SBCommandInterpreter::HandleCompletionWithDescriptions(
if (IsValid()) {
lldb_private::StringList lldb_matches, lldb_descriptions;
- num_completions = m_opaque_ptr->HandleCompletion(
- current_line, cursor, last_char, lldb_matches, lldb_descriptions);
+ CompletionResult result;
+ CompletionRequest request(current_line, cursor - current_line, result);
+ num_completions = m_opaque_ptr->HandleCompletion(request);
+ result.GetMatches(lldb_matches);
+ result.GetDescriptions(lldb_descriptions);
SBStringList temp_matches_list(&lldb_matches);
matches.AppendList(temp_matches_list);