[Lldb-commits] [PATCH] D51175: Add support for descriptions with command completions.

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 12 17:36:46 PDT 2018

jingham requested changes to this revision.
jingham added a comment.
This revision now requires changes to proceed.

This looks good.  I agree with Jonas, however that we might have cases where we end up with two identical completions that have different descriptions, and we shouldn't drop them.

Comment at: source/Utility/CompletionRequest.cpp:79
+  // Add the completion if we haven't seen the same value before.
+  if (m_added_values.insert(r.GetUniqueKey()).second)
+    m_results.push_back(r);
JDevlieghere wrote:
> Do you think there's any value in in checking the description? For example, if the description was empty for the existing value but a description is provided for the duplicate?
This seems reasonable.  For instance, for process attach we might want to do something like:

(lldb) process attach -n Foo<TAB>
    Foo - pid 123
    Foo - pid 234
    FooBar - pid 345

But then the two Foo's would have the same unique key and you would only print one.



More information about the lldb-commits mailing list