diff --git a/Cauldron.Core/RoslynHost.cs b/Cauldron.Core/RoslynHost.cs
index c840291..4233ab0 100644
--- a/Cauldron.Core/RoslynHost.cs
+++ b/Cauldron.Core/RoslynHost.cs
@@ -1,4 +1,6 @@
-using Microsoft.CodeAnalysis.CSharp.Scripting;
+using System.Collections.Immutable;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Scripting;
using Microsoft.CodeAnalysis.Scripting;
namespace Cauldron.Core;
@@ -13,8 +15,7 @@ public class RoslynHost
/// Values that will be made available to the script
///
public static async Task RunScript(string code, string[] imports,
- RoslynHostGlobals globals,
- CancellationToken cancellationToken = default)
+ RoslynHostGlobals globals, CancellationToken cancellationToken = default)
{
ScriptOptions options = ScriptOptions.Default
.AddImports(imports);
@@ -22,6 +23,16 @@ public class RoslynHost
await CSharpScript.RunAsync(code, options, globals,
cancellationToken: cancellationToken);
}
+
+ public static ImmutableArray BuildScript(string code, string[] imports,
+ RoslynHostGlobals globals)
+ {
+ ScriptOptions options = ScriptOptions.Default
+ .AddImports(imports);
+
+ Script