[lldb/Commands] Add support to auto-completion for user commands
authorMed Ismail Bennani <ismail@bennani.ma>
Tue, 6 Jun 2023 17:24:48 +0000 (10:24 -0700)
committerMed Ismail Bennani <ismail@bennani.ma>
Tue, 6 Jun 2023 17:58:34 +0000 (10:58 -0700)
commit6a9c3e611505b7637b46fbaacaf50362c97a263d
treead6cd9ec81eb504e18480d49fd1b616815eaa874
parent1e82b20118e31bd6c3844a84e03f701997a9b7ed
[lldb/Commands] Add support to auto-completion for user commands

This patch should allow the user to set specific auto-completion type
for their custom commands.

To do so, we had to hoist the `CompletionType` enum so the user can
access it and add a new completion type flag to the CommandScriptAdd
Command Object.

So now, the user can specify which completion type will be used with
their custom command, when they register it.

This also makes the `crashlog` custom commands use disk-file completion
type, to browse through the user file system and load the report.

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

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
37 files changed:
lldb/docs/python_api_enums.rst
lldb/examples/python/crashlog.py
lldb/include/lldb/Interpreter/CommandCompletions.h
lldb/include/lldb/Interpreter/CommandObject.h
lldb/include/lldb/Interpreter/CommandOptionArgumentTable.h
lldb/include/lldb/Interpreter/OptionValueFileColonLine.h
lldb/include/lldb/Interpreter/OptionValueFileSpec.h
lldb/include/lldb/Utility/OptionDefinition.h
lldb/include/lldb/lldb-enumerations.h
lldb/source/Commands/CommandCompletions.cpp
lldb/source/Commands/CommandObjectBreakpoint.cpp
lldb/source/Commands/CommandObjectCommands.cpp
lldb/source/Commands/CommandObjectDWIMPrint.cpp
lldb/source/Commands/CommandObjectFrame.cpp
lldb/source/Commands/CommandObjectPlatform.cpp
lldb/source/Commands/CommandObjectPlugin.cpp
lldb/source/Commands/CommandObjectProcess.cpp
lldb/source/Commands/CommandObjectRegexCommand.cpp
lldb/source/Commands/CommandObjectRegister.cpp
lldb/source/Commands/CommandObjectSession.cpp
lldb/source/Commands/CommandObjectSettings.cpp
lldb/source/Commands/CommandObjectTarget.cpp
lldb/source/Commands/CommandObjectThread.cpp
lldb/source/Commands/CommandObjectTrace.cpp
lldb/source/Commands/CommandObjectType.cpp
lldb/source/Commands/CommandObjectWatchpoint.cpp
lldb/source/Commands/Options.td
lldb/source/Core/IOHandler.cpp
lldb/source/Core/IOHandlerCursesGUI.cpp
lldb/source/Interpreter/CommandInterpreter.cpp
lldb/source/Interpreter/OptionValueArch.cpp
lldb/source/Interpreter/OptionValueFileColonLine.cpp
lldb/source/Interpreter/OptionValueFileSpec.cpp
lldb/source/Interpreter/Options.cpp
lldb/test/API/functionalities/completion/TestCompletion.py
lldb/test/API/functionalities/completion/my_test_cmd.py [new file with mode: 0644]
lldb/utils/TableGen/LLDBOptionDefEmitter.cpp