[Lldb-commits] [PATCH] D49322: Narrow the CompletionRequest API to being append-only.

Davide Italiano via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 25 12:59:01 PDT 2018


davide added inline comments.


================
Comment at: source/Commands/CommandCompletions.cpp:251-261
   request.SetWordComplete(false);
   StandardTildeExpressionResolver Resolver;
-  return DiskDirectories(request.GetCursorArgumentPrefix(),
-                         request.GetMatches(), Resolver);
+  StringList matches;
+  int result =
+      DiskDirectories(request.GetCursorArgumentPrefix(), matches, Resolver);
+  request.AddCompletions(matches);
+
----------------
Can you please merge these two functions? They're pretty much the same.


================
Comment at: source/Commands/CommandObjectMultiword.cpp:378
     return proxy_command->HandleArgumentCompletion(request, opt_element_vector);
-  request.GetMatches().Clear();
   return 0;
----------------
I'm not sure not calling `Clear` here is correct.


================
Comment at: source/Interpreter/Options.cpp:731-741
-              // The options definitions table has duplicates because of the
-              // way the grouping information is stored, so only add once.
-              bool duplicate = false;
-              for (size_t k = 0; k < request.GetMatches().GetSize(); k++) {
-                if (request.GetMatches().GetStringAtIndex(k) == full_name) {
-                  duplicate = true;
-                  break;
----------------
Why did you remove this code?


https://reviews.llvm.org/D49322





More information about the lldb-commits mailing list