Skip to content

Commit a497e1b

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 bc15bf6 commit a497e1b

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
@@ -488,14 +488,7 @@ void REPL::IOHandlerComplete(IOHandler &io_handler,
488488
current_code.append("\n");
489489
current_code += request.GetRawLine();
490490

491-
StringList matches;
492-
int result = CompleteCode(current_code, matches);
493-
if (result == -2) {
494-
assert(matches.GetSize() == 1);
495-
request.AddCompletion(matches.GetStringAtIndex(0), "",
496-
CompletionMode::RewriteLine);
497-
} else
498-
request.AddCompletions(matches);
491+
CompleteCode(current_code, request);
499492
}
500493

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

0 commit comments

Comments
 (0)