llvm-project/lldb/unittests/Utility
Raphael Isemann 7f88829cea Add support for descriptions with command completions.
Summary:
This patch adds a framework for adding descriptions to the command completions we provide.
It also adds descriptions for completed top-level commands so that we can test this code.

Completions are in general supposed to be displayed alongside the completion itself. The descriptions
can be used to provide additional information about the completion to the user. Examples for descriptions
are function signatures when completing function calls in the expression command or the binary name
when providing completion for a symbol.

There is still some boilerplate code from the old completion API left in LLDB (mostly because the respective
APIs are reused for non-completion related purposes, so the CompletionRequest doesn't make sense to be
used), so that's why I still had to change some function signatures. Also, as the old API only passes around a
list of matches, and the descriptions are for these functions just another list, I had to add some code that
essentially just ensures that both lists are always the same side (e.g. all the manual calls to
`descriptions->AddString(X)` below a `matches->AddString(Y)` call).

The initial command descriptions that come with this patch are just reusing the existing
short help that is already added in LLDB.

An example completion with descriptions looks like this:
```
(lldb) pl
Available completions:
        platform -- Commands to manage and create platforms.
        plugin   -- Commands for managing LLDB plugins.
```

Reviewers: #lldb, jingham

Reviewed By: #lldb, jingham

Subscribers: jingham, JDevlieghere, lldb-commits

Differential Revision: https://reviews.llvm.org/D51175

llvm-svn: 342181
2018-09-13 21:26:00 +00:00
..
Inputs Move StructuredData from Core to Utility 2017-06-27 10:45:31 +00:00
AnsiTerminalTest.cpp Fix some crashes and deadlocks in FormatAnsiTerminalCodes 2018-07-16 16:38:30 +00:00
ArchSpecTest.cpp [ArchSpec] Add a unittest to complement the change in r321856. 2018-01-05 18:00:44 +00:00
ArgsTest.cpp Move Args.cpp from Interpreter to Utility 2018-04-17 18:53:35 +00:00
CMakeLists.txt Move Predicate.h from Host to Utility 2018-08-30 17:51:10 +00:00
CleanUpTest.cpp [Utility] Simplify and generalize the CleanUp helper, NFC 2018-02-23 22:08:38 +00:00
CompletionRequestTest.cpp Add support for descriptions with command completions. 2018-09-13 21:26:00 +00:00
ConstStringTest.cpp Fix: ConstString::GetConstCStringAndSetMangledCounterPart() should update the value if the key exists already 2018-08-14 11:07:18 +00:00
EnvironmentTest.cpp Add Utility/Environment class for handling... environments 2018-01-10 11:57:31 +00:00
FileSpecTest.cpp [FileSpec] Delegate common operations to llvm::sys::path 2018-06-13 16:23:21 +00:00
FlagsTest.cpp Added unit tests for Flags 2018-07-19 17:45:51 +00:00
JSONTest.cpp Fixup for r311483: Use correct path to StreamString.h 2017-08-22 19:09:39 +00:00
LogTest.cpp [lit] Fix several tests that fail when using Python 3 or on Windows 2018-05-14 21:04:24 +00:00
NameMatchesTest.cpp Fix a couple of corner cases in NameMatches 2017-02-20 11:35:33 +00:00
OptionsWithRawTest.cpp Refactor parsing of option lists with a raw string suffix. 2018-07-10 20:17:38 +00:00
PredicateTest.cpp Move Predicate.h from Host to Utility 2018-08-30 17:51:10 +00:00
RegisterValueTest.cpp Move RegisterValue,Scalar,State from Core to Utility 2018-08-07 11:07:21 +00:00
ScalarTest.cpp Move ScalarTest to follow the class being tested 2018-08-07 13:10:16 +00:00
StateTest.cpp Remove undefined behavior around the use of StateType 2018-09-11 16:08:05 +00:00
StatusTest.cpp Add llvm::Error assignment operator to Status class 2017-06-15 11:23:26 +00:00
StreamTeeTest.cpp Add byte counting mechanism to LLDB's Stream class. 2018-08-02 16:38:34 +00:00
StreamTest.cpp Add byte counting mechanism to LLDB's Stream class. 2018-08-02 16:38:34 +00:00
StringExtractorTest.cpp unittests: Specify types in a bunch of unittest EXPECT's 2016-10-17 18:22:03 +00:00
StringLexerTest.cpp Add unit test for StringLexer 2018-08-22 20:22:34 +00:00
StringListTest.cpp Added unit test for StringList 2018-08-04 17:28:21 +00:00
StructuredDataTest.cpp cmake + xcode: prevent gtests from using includes from project root 2017-10-03 21:20:18 +00:00
TildeExpressionResolverTest.cpp cmake + xcode: prevent gtests from using includes from project root 2017-10-03 21:20:18 +00:00
TimeoutTest.cpp Add a format_provider for the Timeout class 2017-02-10 11:49:33 +00:00
TimerTest.cpp Move Timer and TraceOptions from Core to Utility 2017-06-29 14:32:17 +00:00
UUIDTest.cpp UUID: Add support for arbitrary-sized module IDs 2018-06-29 11:20:29 +00:00
UriParserTest.cpp UriParser cleanup 2017-02-10 12:21:22 +00:00
VASprintfTest.cpp Fix VASprintfTest.cpp for Darwin, add checks 2017-08-09 17:27:02 +00:00
VMRangeTest.cpp Add unit tests for VMRange 2018-07-24 23:52:39 +00:00