Skip to content

Commit 2b63062

Browse files
committed
[lldb] Customize the statusline for the Swift REPL
Change the satusline format to show "Swift <version>", potentially followed by progress messages. rdar://148769820
1 parent 441f6a5 commit 2b63062

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lldb/source/Plugins/ExpressionParser/Swift/SwiftREPL.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,16 @@ Status SwiftREPL::DoInitialization() {
303303
std::static_pointer_cast<TypeSystemSwiftTypeRefForExpressions>(
304304
*type_system_or_err)
305305
->SetCompilerOptions(m_compiler_options.c_str());
306-
return Status();
306+
307+
std::string format_str = "${ansi.negative}Swift " +
308+
swift::version::getCompilerVersion() +
309+
"{ | {${progress.count} }${progress.message}}";
310+
FormatEntity::Entry format_entry;
311+
Status error = FormatEntity::Parse(format_str, format_entry);
312+
if (error.Success())
313+
m_target.GetDebugger().SetStatuslineFormat(format_entry);
314+
315+
return error;
307316
}
308317

309318
llvm::StringRef SwiftREPL::GetSourceFileBasename() {

0 commit comments

Comments
 (0)