-
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
[lldb] Change some Swift REPL intro text #3125
Conversation
8e5ec4e
to
b12b558
Compare
For more context: https://forums.swift.org/t/command-line-ux-enhancements-for-swift/50670 |
@swift-ci Please test |
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"); | ||
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 comment
The 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 :command
? I feel that many users don't know that's possible,
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 comment
The 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.
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 comment
The 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 comment
The 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.
@@ -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"); |
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.
Print a "starting up" message as it might take a long time for everything to load, especially with cold module caches. Clarify that :help is for help with debugger commands, not the Swift language. Tell people how to exit in case they don't know the EOF escape. Remove the version print as that will be now be handled with the `swift` command.
b12b558
to
fdc6cc4
Compare
@swift-ci Please test |
Print a "starting up" message as it might take a long time for
everything to load, especially with cold module caches.
Clarify that :help is for help with debugger commands, not the
Swift language.
Tell people how to exit in case they don't know the EOF escape.
Remove the version print as that will be now be handled with
the
swift
command.See https://forums.swift.org/t/command-line-ux-enhancements-for-swift/50670 for more context.