diff options
author | Raphael Isemann <teemperor@gmail.com> | 2019-09-23 08:16:19 +0000 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2019-09-23 08:16:19 +0000 |
commit | f8e733f14994cc739f11978d8d901426a3771cbc (patch) | |
tree | 692e7418ec97cfcb7e2fd7d1878c6602e5ab89f8 /lldb/source/Interpreter/CommandInterpreter.cpp | |
parent | c063b0b0d3346d2a50e2ef28ec0147d6d53f399d (diff) | |
download | bcm5719-llvm-f8e733f14994cc739f11978d8d901426a3771cbc.tar.gz bcm5719-llvm-f8e733f14994cc739f11978d8d901426a3771cbc.zip |
[lldb] Reduce some dangerous boilerplate with CompletionRequest::ShiftArguments
We should in general not allow external code to fiddle with the internals of
CompletionRequest, but until this is gone let's at least provide a utility
function that makes this less dangerous.
This also now correct updates the partially parsed argument list,
but it doesn't seem to be used by anything that is behind one of
the current shift/SetCursorIndex calls, so this doesn't seeem to
fix any currently used completion.
llvm-svn: 372556
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r-- | lldb/source/Interpreter/CommandInterpreter.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index e9f22b5ebd2..c8a64b09526 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -1794,8 +1794,7 @@ void CommandInterpreter::HandleCompletionMatches(CompletionRequest &request) { CommandObject *command_object = GetCommandObject(request.GetParsedLine().GetArgumentAtIndex(0)); if (command_object) { - request.GetParsedLine().Shift(); - request.SetCursorIndex(request.GetCursorIndex() - 1); + request.ShiftArguments(); command_object->HandleCompletion(request); } } |