summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/OptionValueBoolean.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Interpreter/OptionValueBoolean.cpp')
-rw-r--r--lldb/source/Interpreter/OptionValueBoolean.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/lldb/source/Interpreter/OptionValueBoolean.cpp b/lldb/source/Interpreter/OptionValueBoolean.cpp
index 43c82338892..8a340792d78 100644
--- a/lldb/source/Interpreter/OptionValueBoolean.cpp
+++ b/lldb/source/Interpreter/OptionValueBoolean.cpp
@@ -76,23 +76,22 @@ lldb::OptionValueSP OptionValueBoolean::DeepCopy() const {
return OptionValueSP(new OptionValueBoolean(*this));
}
-size_t OptionValueBoolean::AutoComplete(
- CommandInterpreter &interpreter, llvm::StringRef s, int match_start_point,
- int max_return_elements, bool &word_complete, StringList &matches) {
- word_complete = false;
- matches.Clear();
+size_t OptionValueBoolean::AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) {
+ request.SetWordComplete(false);
+ request.GetMatches().Clear();
static const llvm::StringRef g_autocomplete_entries[] = {
"true", "false", "on", "off", "yes", "no", "1", "0"};
auto entries = llvm::makeArrayRef(g_autocomplete_entries);
// only suggest "true" or "false" by default
- if (s.empty())
+ if (request.GetCursorArgumentPrefix().empty())
entries = entries.take_front(2);
for (auto entry : entries) {
- if (entry.startswith_lower(s))
- matches.AppendString(entry);
+ if (entry.startswith_lower(request.GetCursorArgumentPrefix()))
+ request.GetMatches().AppendString(entry);
}
- return matches.GetSize();
+ return request.GetMatches().GetSize();
}
OpenPOWER on IntegriCloud