diff options
author | Raphael Isemann <teemperor@gmail.com> | 2018-07-13 18:28:14 +0000 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2018-07-13 18:28:14 +0000 |
commit | a2e76c0bfc5bec8d50e8d13f71b72a66eaa0a386 (patch) | |
tree | 55563c896d181a4de6dc254f335c10a379e0eac0 /lldb/source/Commands/CommandObjectFrame.cpp | |
parent | d6c062bce1e499f52500cc759a7c0846dd178cda (diff) | |
download | llvm-a2e76c0bfc5bec8d50e8d13f71b72a66eaa0a386.zip llvm-a2e76c0bfc5bec8d50e8d13f71b72a66eaa0a386.tar.gz llvm-a2e76c0bfc5bec8d50e8d13f71b72a66eaa0a386.tar.bz2 |
Replaced more boilerplate code with CompletionRequest (NFC)
Summary:
As suggested in D48796, this patch replaces even more internal calls that were using the old
completion API style with a single CompletionRequest. In some cases we also pass an option
vector/index, but as we don't always have this information, it currently is not part of the
CompletionRequest class.
The constructor of the CompletionRequest is now also more sensible. You only pass the
user input, cursor position and your list of matches to the request and the rest will be
inferred (using the same code we used before to calculate this). You also have to pass these
match window parameters to it, even though they are unused right now.
The patch shouldn't change any behavior.
Reviewers: jingham
Reviewed By: jingham
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D48976
llvm-svn: 337031
Diffstat (limited to 'lldb/source/Commands/CommandObjectFrame.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectFrame.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp index 6860021..0183c43 100644 --- a/lldb/source/Commands/CommandObjectFrame.cpp +++ b/lldb/source/Commands/CommandObjectFrame.cpp @@ -467,16 +467,9 @@ public: CompletionRequest &request, OptionElementVector &opt_element_vector) override { // Arguments are the standard source file completer. - auto completion_str = request.GetParsedLine()[request.GetCursorIndex()].ref; - completion_str = completion_str.take_front(request.GetCursorCharPosition()); - - bool word_complete = request.GetWordComplete(); CommandCompletions::InvokeCommonCompletionCallbacks( GetCommandInterpreter(), CommandCompletions::eVariablePathCompletion, - completion_str, request.GetMatchStartPoint(), - request.GetMaxReturnElements(), nullptr, word_complete, - request.GetMatches()); - request.SetWordComplete(word_complete); + request, nullptr); return request.GetMatches().GetSize(); } |