@@ -738,13 +738,14 @@ bool SwiftUserExpression::Parse(DiagnosticManager &diagnostic_manager,
738
738
auto ts_or_err = target->GetScratchTypeSystemForLanguage (
739
739
lldb::eLanguageTypeSwift, /* create_on_demand=*/ true );
740
740
if (!ts_or_err)
741
- return error (" could not create a Swift scratch context: " ,
741
+ return error (" could not create a Swift scratch typesystem " ,
742
742
llvm::toString (ts_or_err.takeError ()).c_str ());
743
743
m_swift_scratch_ctx =
744
744
std::static_pointer_cast<TypeSystemSwiftTypeRefForExpressions>(
745
745
*ts_or_err);
746
746
if (!m_swift_scratch_ctx)
747
- return error (" could not create a Swift scratch context: " , " unknown error" );
747
+ return error (" could not create a Swift scratch typesystem" ,
748
+ " unknown error" );
748
749
// Notify SwiftASTContext that this is a Playground.
749
750
if (m_options.GetPlaygroundTransformEnabled ())
750
751
m_swift_scratch_ctx->SetCompilerOptions (" " );
@@ -765,12 +766,13 @@ bool SwiftUserExpression::Parse(DiagnosticManager &diagnostic_manager,
765
766
std::static_pointer_cast<SwiftASTContextForExpressions>(swift_ast_ctx);
766
767
767
768
if (!m_swift_ast_ctx)
768
- return error (" could not create a Swift AST context" );
769
+ return error (" could not initialize Swift compiler" ,
770
+ " run 'swift-healthcheck' for more details" );
769
771
770
772
if (m_swift_ast_ctx->HasFatalErrors ()) {
771
773
m_swift_ast_ctx->PrintDiagnostics (diagnostic_manager);
772
- LLDB_LOG (log, " Swift AST context is in a fatal error state" );
773
- return false ;
774
+ return error ( " Swift AST context is in a fatal error state" ,
775
+ " run 'swift-healthcheck' for more details " ) ;
774
776
}
775
777
776
778
// This may destroy the scratch context.
0 commit comments