aboutsummaryrefslogtreecommitdiff
path: root/source/Interpreter/OptionValueEnumeration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Interpreter/OptionValueEnumeration.cpp')
-rw-r--r--source/Interpreter/OptionValueEnumeration.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/source/Interpreter/OptionValueEnumeration.cpp b/source/Interpreter/OptionValueEnumeration.cpp
index 0b76bd0601aa..26933aa78240 100644
--- a/source/Interpreter/OptionValueEnumeration.cpp
+++ b/source/Interpreter/OptionValueEnumeration.cpp
@@ -102,21 +102,16 @@ lldb::OptionValueSP OptionValueEnumeration::DeepCopy() const {
return OptionValueSP(new OptionValueEnumeration(*this));
}
-size_t OptionValueEnumeration::AutoComplete(CommandInterpreter &interpreter,
- CompletionRequest &request) {
- request.SetWordComplete(false);
-
+void OptionValueEnumeration::AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) {
const uint32_t num_enumerators = m_enumerations.GetSize();
if (!request.GetCursorArgumentPrefix().empty()) {
for (size_t i = 0; i < num_enumerators; ++i) {
llvm::StringRef name = m_enumerations.GetCStringAtIndex(i).GetStringRef();
- if (name.startswith(request.GetCursorArgumentPrefix()))
- request.AddCompletion(name);
+ request.TryCompleteCurrentArg(name);
}
- } else {
- // only suggest "true" or "false" by default
+ return;
+ }
for (size_t i = 0; i < num_enumerators; ++i)
request.AddCompletion(m_enumerations.GetCStringAtIndex(i).GetStringRef());
- }
- return request.GetNumberOfMatches();
}