[lldb] Reduce some dangerous boilerplate with CompletionRequest::ShiftArguments
authorRaphael Isemann <teemperor@gmail.com>
Mon, 23 Sep 2019 08:16:19 +0000 (08:16 +0000)
committerRaphael Isemann <teemperor@gmail.com>
Mon, 23 Sep 2019 08:16:19 +0000 (08:16 +0000)
commitf8e733f14994cc739f11978d8d901426a3771cbc
tree692e7418ec97cfcb7e2fd7d1878c6602e5ab89f8
parentc063b0b0d3346d2a50e2ef28ec0147d6d53f399d
[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
lldb/include/lldb/Utility/CompletionRequest.h
lldb/source/Commands/CommandObjectHelp.cpp
lldb/source/Commands/CommandObjectMultiword.cpp
lldb/source/Interpreter/CommandInterpreter.cpp
lldb/unittests/Utility/CompletionRequestTest.cpp