aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectExpression.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Commands/CommandObjectExpression.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectExpression.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp
index 6fb6b1d..fabc496 100644
--- a/lldb/source/Commands/CommandObjectExpression.cpp
+++ b/lldb/source/Commands/CommandObjectExpression.cpp
@@ -311,7 +311,12 @@ void CommandObjectExpression::HandleCompletion(CompletionRequest &request) {
target = &GetDummyTarget();
unsigned cursor_pos = request.GetRawCursorPos();
- llvm::StringRef code = request.GetRawLine();
+ // Get the full user input including the suffix. The suffix is necessary
+ // as OptionsWithRaw will use it to detect if the cursor is cursor is in the
+ // argument part of in the raw input part of the arguments. If we cut of
+ // of the suffix then "expr -arg[cursor] --" would interpret the "-arg" as
+ // the raw input (as the "--" is hidden in the suffix).
+ llvm::StringRef code = request.GetRawLineWithUnusedSuffix();
const std::size_t original_code_size = code.size();