Skip to content

Commit b8ea404

Browse files
committed
[lldb] Move REPL::CompleteCode interface to use CompletionRequest
1 parent 0f32e4d commit b8ea404

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

lldb/include/lldb/Expression/REPL.h

+2-2
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

+1-8
Original file line numberDiff line numberDiff line change
@@ -501,14 +501,7 @@ void REPL::IOHandlerComplete(IOHandler &io_handler,
501501
current_code.append("\n");
502502
current_code += request.GetRawLineUntilCursor();
503503

504-
StringList matches;
505-
int result = CompleteCode(current_code, matches);
506-
if (result == -2) {
507-
assert(matches.GetSize() == 1);
508-
request.AddCompletion(matches.GetStringAtIndex(0), "",
509-
CompletionMode::RewriteLine);
510-
} else
511-
request.AddCompletions(matches);
504+
CompleteCode(current_code, request);
512505
}
513506

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

0 commit comments

Comments
 (0)