Skip to content

Commit 43978f8

Browse files
committed
[lldb] Use CompletionRequest in REPL::CompleteCode and remove translation code to old API
Any REPL client should just move to CompletionRequest instead of relying on the translation code from the old API, so let's remove that translation code.
1 parent 88be0a0 commit 43978f8

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

lldb/include/lldb/Expression/REPL.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ class REPL : public IOHandlerDelegate {
130130
lldb::ValueObjectSP &valobj_sp,
131131
ExpressionVariable *var = nullptr) = 0;
132132

133-
virtual int CompleteCode(const std::string &current_code,
134-
StringList &matches) = 0;
133+
virtual void CompleteCode(const std::string &current_code,
134+
CompletionRequest &request) = 0;
135135

136136
OptionGroupFormat m_format_options = OptionGroupFormat(lldb::eFormatDefault);
137137
OptionGroupValueObjectDisplay m_varobj_options;

lldb/source/Expression/REPL.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -481,14 +481,7 @@ void REPL::IOHandlerComplete(IOHandler &io_handler,
481481
current_code.append("\n");
482482
current_code += request.GetRawLineUntilCursor();
483483

484-
StringList matches;
485-
int result = CompleteCode(current_code, matches);
486-
if (result == -2) {
487-
assert(matches.GetSize() == 1);
488-
request.AddCompletion(matches.GetStringAtIndex(0), "",
489-
CompletionMode::RewriteLine);
490-
} else
491-
request.AddCompletions(matches);
484+
CompleteCode(current_code, request);
492485
}
493486

494487
bool QuitCommandOverrideCallback(void *baton, const char **argv) {

0 commit comments

Comments
 (0)