summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandCompletions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Commands/CommandCompletions.cpp')
-rw-r--r--lldb/source/Commands/CommandCompletions.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/lldb/source/Commands/CommandCompletions.cpp b/lldb/source/Commands/CommandCompletions.cpp
index 085531c5c07..9a969d289be 100644
--- a/lldb/source/Commands/CommandCompletions.cpp
+++ b/lldb/source/Commands/CommandCompletions.cpp
@@ -309,12 +309,18 @@ int CommandCompletions::SettingsNames(CommandInterpreter &interpreter,
}
}
- size_t exact_matches_idx = SIZE_MAX;
- StringList matches;
- g_property_names.AutoComplete(request.GetCursorArgumentPrefix(), matches,
- exact_matches_idx);
- request.SetWordComplete(exact_matches_idx != SIZE_MAX);
- request.AddCompletions(matches);
+ bool exact_match = false;
+
+ for (const std::string &s : g_property_names) {
+ if (llvm::StringRef(s).startswith(request.GetCursorArgumentPrefix())) {
+ if (request.GetCursorArgumentPrefix() == s)
+ exact_match = true;
+ request.AddCompletion(s);
+ }
+ }
+
+ request.SetWordComplete(exact_match);
+
return request.GetNumberOfMatches();
}
OpenPOWER on IntegriCloud