llvm-project/lldb/source/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
..
ARM64_DWARF_Registers.h Break some dependencies in lldbUtility. 2017-02-01 19:45:14 +00:00
ARM64_ehframe_Registers.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
ARM_DWARF_Registers.h Break some dependencies in lldbUtility. 2017-02-01 19:45:14 +00:00
ARM_ehframe_Registers.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
ArchSpec.cpp [ARC] Make char unsigned by default 2018-09-07 14:45:32 +00:00
Args.cpp Refactor parsing of option lists with a raw string suffix. 2018-07-10 20:17:38 +00:00
Baton.cpp iwyu fixes on lldbUtility. 2017-04-06 18:12:24 +00:00
CMakeLists.txt Remove unused FastDemangle sources 2018-08-14 11:32:51 +00:00
CompletionRequest.cpp Add support for descriptions with command completions. 2018-09-13 21:26:00 +00:00
Connection.cpp Move Connection and IOObject interfaces to Utility module 2017-06-27 10:33:14 +00:00
ConstString.cpp Remove asseration from ConstString::GetConstCStringAndSetMangledCounterPart() to fix more tests first 2018-08-14 19:38:54 +00:00
DataBufferHeap.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
DataBufferLLVM.cpp Make sure DataBufferLLVM contents are writable 2017-12-21 10:54:30 +00:00
DataEncoder.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
DataExtractor.cpp Represent invalid UUIDs as UUIDs with length zero 2018-06-26 15:12:20 +00:00
Environment.cpp Add Utility/Environment class for handling... environments 2018-01-10 11:57:31 +00:00
FileSpec.cpp [lldb] Fix lldb build on musl 2018-08-28 22:17:28 +00:00
IOObject.cpp Move Connection and IOObject interfaces to Utility module 2017-06-27 10:33:14 +00:00
JSON.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
LLDBAssert.cpp Terminate debugger if an assert was hit 2018-09-04 17:19:15 +00:00
Log.cpp Adjust thread name column width depending on real name length. 2018-07-13 11:49:28 +00:00
Logging.cpp Logging: Disable logging after fork() 2017-10-23 19:41:17 +00:00
NameMatches.cpp Fix a couple of corner cases in NameMatches 2017-02-20 11:35:33 +00:00
PPC64LE_DWARF_Registers.h Add float/vector registers for ppc64le 2017-11-03 15:22:36 +00:00
PPC64LE_ehframe_Registers.h Add float/vector registers for ppc64le 2017-11-03 15:22:36 +00:00
PPC64_DWARF_Registers.h Add SysV Abi for PPC64le 2018-01-22 11:27:43 +00:00
Range.cpp iwyu fixes on lldbUtility. 2017-04-06 18:12:24 +00:00
RegisterValue.cpp Remove outdated TODOs in RegisterValue 2018-08-16 22:48:46 +00:00
RegularExpression.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
Scalar.cpp [Scalar] Commit the correct patch, forgot `git add`. 2018-09-07 18:22:27 +00:00
SelectHelper.cpp [LLDB] Select helper sign comparison fix 2018-06-25 16:10:20 +00:00
SharingPtr.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
State.cpp Move RegisterValue,Scalar,State from Core to Utility 2018-08-07 11:07:21 +00:00
Status.cpp Typo fixes. 2018-05-29 09:10:46 +00:00
Stream.cpp Remove manual byte counting from internal Stream methods. 2018-09-12 10:20:41 +00:00
StreamCallback.cpp iwyu fixes on lldbUtility. 2017-04-06 18:12:24 +00:00
StreamGDBRemote.cpp iwyu fixes on lldbUtility. 2017-04-06 18:12:24 +00:00
StreamString.cpp Add byte counting mechanism to LLDB's Stream class. 2018-08-02 16:38:34 +00:00
StringExtractor.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
StringExtractorGDBRemote.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
StringLexer.cpp [Utility/StringLexer] Remove dead code. 2017-04-19 18:18:25 +00:00
StringList.cpp iwyu fixes on lldbUtility. 2017-04-06 18:12:24 +00:00
StructuredData.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
TildeExpressionResolver.cpp s/LLVM_ON_WIN32/_WIN32/, lldb 2018-04-10 13:33:45 +00:00
Timer.cpp Move Timer and TraceOptions from Core to Utility 2017-06-29 14:32:17 +00:00
UUID.cpp UUID: Add support for arbitrary-sized module IDs 2018-06-29 11:20:29 +00:00
UriParser.cpp Fix some warnings found by ToT clang 2017-11-02 21:35:26 +00:00
UserID.cpp Move many other files from Core -> Utility. 2017-03-06 18:34:25 +00:00
UuidCompatibility.h
VASprintf.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
VMRange.cpp Fix a bug in VMRange 2018-08-04 02:15:26 +00:00