-
Notifications
You must be signed in to change notification settings - Fork 341
[lldb] Improve wording of Swift expression parser error messages (NFC) #10399
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 |
---|---|---|
|
@@ -738,13 +738,14 @@ bool SwiftUserExpression::Parse(DiagnosticManager &diagnostic_manager, | |
auto ts_or_err = target->GetScratchTypeSystemForLanguage( | ||
lldb::eLanguageTypeSwift, /*create_on_demand=*/true); | ||
if (!ts_or_err) | ||
return error("could not create a Swift scratch context: ", | ||
return error("could not create a Swift scratch typesystem", | ||
llvm::toString(ts_or_err.takeError()).c_str()); | ||
m_swift_scratch_ctx = | ||
std::static_pointer_cast<TypeSystemSwiftTypeRefForExpressions>( | ||
*ts_or_err); | ||
if (!m_swift_scratch_ctx) | ||
return error("could not create a Swift scratch context: ", "unknown error"); | ||
return error("could not create a Swift scratch typesystem", | ||
"unknown error"); | ||
// Notify SwiftASTContext that this is a Playground. | ||
if (m_options.GetPlaygroundTransformEnabled()) | ||
m_swift_scratch_ctx->SetCompilerOptions(""); | ||
|
@@ -765,12 +766,13 @@ bool SwiftUserExpression::Parse(DiagnosticManager &diagnostic_manager, | |
std::static_pointer_cast<SwiftASTContextForExpressions>(swift_ast_ctx); | ||
|
||
if (!m_swift_ast_ctx) | ||
return error("could not create a Swift AST context"); | ||
return error("could not initialize Swift compiler", | ||
"run 'swift-healthcheck' for more details"); | ||
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. These are user facing right? Running swift-healthcheck won't produce anything useful to the user, right? I'd change it to run swift-healthcheck and file a bug with the file. 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. It is user-facing, but it contains, for example compiler errors that users are expected to be familiar with. |
||
|
||
if (m_swift_ast_ctx->HasFatalErrors()) { | ||
m_swift_ast_ctx->PrintDiagnostics(diagnostic_manager); | ||
LLDB_LOG(log, "Swift AST context is in a fatal error state"); | ||
return false; | ||
return error("Swift AST context is in a fatal error state", | ||
"run 'swift-healthcheck' for more details"); | ||
} | ||
|
||
// This may destroy the scratch context. | ||
|
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 think there's a space missing here, it will print "compilerrun"
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.
No, these are separate messages.