diff options
| -rw-r--r-- | lldb/include/lldb/Utility/CompletionRequest.h | 9 | ||||
| -rw-r--r-- | lldb/source/Expression/REPL.cpp | 4 | ||||
| -rw-r--r-- | lldb/source/Interpreter/Options.cpp | 2 |
3 files changed, 4 insertions, 11 deletions
diff --git a/lldb/include/lldb/Utility/CompletionRequest.h b/lldb/include/lldb/Utility/CompletionRequest.h index 96f202b4b6b..570f626ac54 100644 --- a/lldb/include/lldb/Utility/CompletionRequest.h +++ b/lldb/include/lldb/Utility/CompletionRequest.h @@ -103,9 +103,6 @@ public: CompletionResult &result); llvm::StringRef GetRawLine() const { return m_command; } - llvm::StringRef GetRawLineUntilCursor() const { - return m_command.substr(0, m_cursor_index); - } unsigned GetRawCursorPos() const { return m_raw_cursor_pos; } @@ -192,12 +189,8 @@ public: descriptions.GetStringAtIndex(i)); } - llvm::StringRef GetCursorArgument() const { - return GetParsedLine().GetArgumentAtIndex(GetCursorIndex()); - } - llvm::StringRef GetCursorArgumentPrefix() const { - return GetCursorArgument().substr(0, m_cursor_char_position); + return GetParsedLine().GetArgumentAtIndex(GetCursorIndex()); } private: diff --git a/lldb/source/Expression/REPL.cpp b/lldb/source/Expression/REPL.cpp index 79352513458..f7bd86391f5 100644 --- a/lldb/source/Expression/REPL.cpp +++ b/lldb/source/Expression/REPL.cpp @@ -453,7 +453,7 @@ void REPL::IOHandlerComplete(IOHandler &io_handler, } // Strip spaces from the line and see if we had only spaces - if (request.GetRawLineUntilCursor().trim().empty()) { + if (request.GetRawLine().trim().empty()) { // Only spaces on this line, so just indent request.AddCompletion(m_indent_str); return; @@ -479,7 +479,7 @@ void REPL::IOHandlerComplete(IOHandler &io_handler, } current_code.append("\n"); - current_code += request.GetRawLineUntilCursor(); + current_code += request.GetRawLine(); StringList matches; int result = CompleteCode(current_code, matches); diff --git a/lldb/source/Interpreter/Options.cpp b/lldb/source/Interpreter/Options.cpp index e5fa84f6f2a..465271d2f96 100644 --- a/lldb/source/Interpreter/Options.cpp +++ b/lldb/source/Interpreter/Options.cpp @@ -698,7 +698,7 @@ bool Options::HandleOptionCompletion(CompletionRequest &request, request.AddCompletion("--" + long_option.str(), opt.usage_text); return true; } else - request.AddCompletion(request.GetCursorArgument()); + request.AddCompletion(request.GetCursorArgumentPrefix()); return true; } else { // FIXME - not handling wrong options yet: |

