[Lldb-commits] [lldb] r372946 - [lldb][NFC] Use AppendEmptyArgument in CompletionRequest constructor

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 26 00:06:05 PDT 2019


Author: teemperor
Date: Thu Sep 26 00:06:05 2019
New Revision: 372946

URL: http://llvm.org/viewvc/llvm-project?rev=372946&view=rev
Log:
[lldb][NFC] Use AppendEmptyArgument in CompletionRequest constructor

We now have a utility function for this purpose.

(Also fixing the typo in the related comment while I'm at it.)

Modified:
    lldb/trunk/source/Utility/CompletionRequest.cpp

Modified: lldb/trunk/source/Utility/CompletionRequest.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/CompletionRequest.cpp?rev=372946&r1=372945&r2=372946&view=diff
==============================================================================
--- lldb/trunk/source/Utility/CompletionRequest.cpp (original)
+++ lldb/trunk/source/Utility/CompletionRequest.cpp Thu Sep 26 00:06:05 2019
@@ -35,14 +35,10 @@ CompletionRequest::CompletionRequest(llv
 
   // The cursor is after a space but the space is not part of the argument.
   // Let's add an empty fake argument to the end to make sure the completion
-  // code Note: The space could be part of the last argument when it's quoted.
+  // code. Note: The space could be part of the last argument when it's quoted.
   if (partial_command.endswith(" ") &&
-      !GetCursorArgumentPrefix().endswith(" ")) {
-    m_parsed_line.AppendArgument(llvm::StringRef());
-    // Set the cursor to the start of the fake argument.
-    m_cursor_index++;
-    m_cursor_char_position = 0;
-  }
+      !GetCursorArgumentPrefix().endswith(" "))
+    AppendEmptyArgument();
 }
 
 std::string CompletionResult::Completion::GetUniqueKey() const {




More information about the lldb-commits mailing list