diff options
author | Med Ismail Bennani <ismail@bennani.ma> | 2023-06-06 10:24:48 -0700 |
---|---|---|
committer | Med Ismail Bennani <ismail@bennani.ma> | 2023-06-06 10:58:34 -0700 |
commit | 6a9c3e611505b7637b46fbaacaf50362c97a263d (patch) | |
tree | ad6cd9ec81eb504e18480d49fd1b616815eaa874 /lldb/source/Commands/CommandObjectFrame.cpp | |
parent | 1e82b20118e31bd6c3844a84e03f701997a9b7ed (diff) | |
download | llvm-6a9c3e611505b7637b46fbaacaf50362c97a263d.zip llvm-6a9c3e611505b7637b46fbaacaf50362c97a263d.tar.gz llvm-6a9c3e611505b7637b46fbaacaf50362c97a263d.tar.bz2 |
[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>
Diffstat (limited to 'lldb/source/Commands/CommandObjectFrame.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectFrame.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp index 71fed65..db31b15 100644 --- a/lldb/source/Commands/CommandObjectFrame.cpp +++ b/lldb/source/Commands/CommandObjectFrame.cpp @@ -292,9 +292,8 @@ public: if (request.GetCursorIndex() != 0) return; - CommandCompletions::InvokeCommonCompletionCallbacks( - GetCommandInterpreter(), CommandCompletions::eFrameIndexCompletion, - request, nullptr); + lldb_private::CommandCompletions::InvokeCommonCompletionCallbacks( + GetCommandInterpreter(), lldb::eFrameIndexCompletion, request, nullptr); } Options *GetOptions() override { return &m_options; } @@ -445,9 +444,9 @@ may even involve JITing and running code in the target program.)"); HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override { // Arguments are the standard source file completer. - CommandCompletions::InvokeCommonCompletionCallbacks( - GetCommandInterpreter(), CommandCompletions::eVariablePathCompletion, - request, nullptr); + lldb_private::CommandCompletions::InvokeCommonCompletionCallbacks( + GetCommandInterpreter(), lldb::eVariablePathCompletion, request, + nullptr); } protected: |