-
Notifications
You must be signed in to change notification settings - Fork 342
[lldb] Change some Swift REPL intro text #3125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,6 +100,7 @@ lldb::REPLSP SwiftREPL::CreateInstanceFromTarget(Status &err, Target &target, | |
lldb::REPLSP SwiftREPL::CreateInstanceFromDebugger(Status &err, | ||
Debugger &debugger, | ||
const char *repl_options) { | ||
printf("Starting the Swift REPL...\n"); | ||
const char *bp_name = "repl_main"; | ||
|
||
FileSpec repl_executable = HostInfo::GetSupportExeDir(); | ||
|
@@ -262,9 +263,8 @@ lldb::REPLSP SwiftREPL::CreateInstanceFromDebugger(Status &err, | |
// Disable the cleanup, since we have a valid repl session now. | ||
cleanup.release(); | ||
|
||
std::string swift_full_version(swift::version::getSwiftFullVersion()); | ||
printf("Welcome to %s.\nType :help for assistance.\n", | ||
swift_full_version.c_str()); | ||
printf("You are now in an interactive environment powered by the LLDB debugger where you can type, run, and debug Swift code.\n\n"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure about this message, seems a bit superfluous in my opinion. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I went over this a little bit in the forum post. The reason for this message is that a lot of folks "end up" in the REPL, either intentionally or unintentionally through some default behavior. For folks learning Swift for the first time or someone who doesn't have a lot of command line experience with Swift, it can be rather mysterious as to what they are looking at. I thought it was also nice to call out that this is actually LLDB and not some other thing, so people start to understand the context they are in. Again, if the REPL becomes an explicit choice, then of course the user should know where they are. |
||
printf("Type \x1B[1m:help\x1B[0m for debugger assistance. Type \x1B[1m:exit\x1B[0m to quit.\n"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like this message. Maybe while we're at it, could we tell users that they can run any LLDB commands with I think we should definitely keep the swift version though, as that may be helpful to users. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So the reason why I removed the version print is that I pushed it up to the driver so that it appears consistently at the top when running other sort of "automatic" commands. If the Swift REPL is no longer run by default (something I eventually want to change), then running the REPL will be an explicit command without the larger context. It wouldn't hurt to print the version twice in the meantime but that was the reason, anyway. |
||
|
||
return repl_sp; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems ok since there's a bit of a delay before the REPL is available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, a cold module cache can create some pretty long wait times on slower machines.