aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandCompletions.cpp
diff options
context:
space:
mode:
authorDavid Peixotto <peix@meta.com>2025-07-15 12:44:00 -0700
committerGitHub <noreply@github.com>2025-07-15 12:44:00 -0700
commitfccae859bc949ba390184614e07234267a734b86 (patch)
treec73a538cce7754b35134d044ebbbd591fa6ff5c9 /lldb/source/Commands/CommandCompletions.cpp
parentd67d91a9906366585162cebf292f923a3f28c8a6 (diff)
downloadllvm-fccae859bc949ba390184614e07234267a734b86.zip
llvm-fccae859bc949ba390184614e07234267a734b86.tar.gz
llvm-fccae859bc949ba390184614e07234267a734b86.tar.bz2
[lldb] Add completions for plugin list/enable/disable (#147775)
This commit adds completion support for the plugin commands. It will try to complete partial namespaces to the full namespace string. If the completion input is already a full namespace string then it will add all the matching plugins in that namespace as completions. This lets the user complete to the namespace first and then tab-complete to the next level if desired. ``` (lldb) plugin list a<tab> Available completions: abi architecture (lldb) plugin list ab<tab> (lldb) plugin list abi<tab> (lldb) plugin list abi.<tab> Available completions: abi.SysV-arm64 abi.ABIMacOSX_arm64 abi.SysV-arm ... ```
Diffstat (limited to 'lldb/source/Commands/CommandCompletions.cpp')
-rw-r--r--lldb/source/Commands/CommandCompletions.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lldb/source/Commands/CommandCompletions.cpp b/lldb/source/Commands/CommandCompletions.cpp
index 38231a8..3e22309 100644
--- a/lldb/source/Commands/CommandCompletions.cpp
+++ b/lldb/source/Commands/CommandCompletions.cpp
@@ -87,6 +87,7 @@ bool CommandCompletions::InvokeCommonCompletionCallbacks(
{lldb::eTypeCategoryNameCompletion,
CommandCompletions::TypeCategoryNames},
{lldb::eThreadIDCompletion, CommandCompletions::ThreadIDs},
+ {lldb::eManagedPluginCompletion, CommandCompletions::ManagedPlugins},
{lldb::eTerminatorCompletion,
nullptr} // This one has to be last in the list.
};
@@ -850,6 +851,13 @@ void CommandCompletions::ThreadIDs(CommandInterpreter &interpreter,
}
}
+void CommandCompletions::ManagedPlugins(CommandInterpreter &interpreter,
+ CompletionRequest &request,
+ SearchFilter *searcher) {
+ PluginManager::AutoCompletePluginName(request.GetCursorArgumentPrefix(),
+ request);
+}
+
void CommandCompletions::CompleteModifiableCmdPathArgs(
CommandInterpreter &interpreter, CompletionRequest &request,
OptionElementVector &opt_element_vector) {