llvm-project/lldb/unittests
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
..
Breakpoint Rename Error -> Status. 2017-05-12 04:51:55 +00:00
Core Move Predicate.h from Host to Utility 2018-08-30 17:51:10 +00:00
Disassembler If we fail to get an armv7em-- disassembler from llvm, skip the 2018-09-12 19:30:03 +00:00
Editline Move PseudoTerminal to the lldb_private namespace 2017-12-11 10:09:14 +00:00
Expression Really fix ClangParserTest 2018-06-05 10:29:48 +00:00
Host Move Predicate.h from Host to Utility 2018-08-30 17:51:10 +00:00
Interpreter Change TestCompletion to only ever look inside of BaseDir 2018-09-04 23:09:49 +00:00
Language Move the column marking functionality to the Highlighter framework 2018-08-30 00:09:21 +00:00
ObjectFile ELF: Replace the header-extension unit test with a lit one 2018-07-19 14:38:30 +00:00
Platform Use llvm::VersionTuple instead of manual version marshalling 2018-06-18 15:02:23 +00:00
Process Add support for parsing Breakpad minidump files that can have extra padding in the module, thread and memory lists. 2018-07-23 14:16:08 +00:00
ScriptInterpreter Added new API to SBStructuredData class 2017-05-29 08:25:46 +00:00
Signals Make LLDB skip server-client roundtrip for signals that don't require any actions 2017-03-07 21:34:40 +00:00
Symbol Refactor ExecuteAndWait to take StringRefs. 2018-06-12 17:43:52 +00:00
SymbolFile [PDB] Fix problems after rL341782 2018-09-11 14:03:12 +00:00
Target Remove UUID::SetFromCString 2018-06-21 15:24:39 +00:00
TestingSupport cmake + xcode: prevent gtests from using includes from project root 2017-10-03 21:20:18 +00:00
UnwindAssembly [LLDB] Initial version of PPC64 InstEmulation 2018-02-27 18:42:46 +00:00
Utility Add support for descriptions with command completions. 2018-09-13 21:26:00 +00:00
debugserver [CMake] Need to set WITH_LOCKDOWN on debugserver target 2017-09-06 20:15:43 +00:00
tools [cmake] Add option to skip building lldb-server 2018-08-23 18:05:45 +00:00
CMakeLists.txt Add the Disassembler unit test dir. 2018-09-07 18:51:10 +00:00
gtest_common.h [Windows] Remove the #include <eh.h> hack. 2017-03-03 20:21:59 +00:00