4 instantiations of Script
Microsoft.CodeAnalysis.Scripting (4)
Script.cs (4)
57return new Script<T>(compiler, new ScriptBuilder(assemblyLoaderOpt ?? new InteractiveAssemblyLoader()), sourceText, optionsOpt ?? ScriptOptions.Default, globalsTypeOpt, previousOpt: null); 118return new Script<TResult>(Compiler, Builder, SourceText.From(code ?? "", options.FileEncoding), options, GlobalsType, this); 131return new Script<TResult>(Compiler, Builder, SourceText.From(code, options.FileEncoding), options, GlobalsType, this); 354return (options == Options) ? this : new Script<T>(Compiler, Builder, SourceText, options, GlobalsType, Previous);
124 references to Script
Microsoft.CodeAnalysis.CSharp.Scripting (5)
CSharpScript.cs (4)
33public static Script<T> Create<T>(string code, ScriptOptions options = null, Type globalsType = null, InteractiveAssemblyLoader assemblyLoader = null) 50public static Script<T> Create<T>(Stream code, ScriptOptions options = null, Type globalsType = null, InteractiveAssemblyLoader assemblyLoader = null) 65public static Script<object> Create(string code, ScriptOptions options = null, Type globalsType = null, InteractiveAssemblyLoader assemblyLoader = null) 81public static Script<object> Create(Stream code, ScriptOptions options = null, Type globalsType = null, InteractiveAssemblyLoader assemblyLoader = null)
Hosting\CSharpReplServiceProvider.cs (1)
27public override Script<T> CreateScript<T>(string code, ScriptOptions options, Type globalsTypeOpt, InteractiveAssemblyLoader assemblyLoader)
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (10)
InteractiveSessionReferencesTests.cs (10)
167var script = CSharpScript.Create(@" 253var script = CSharpScript.Create($@" 283var script0 = CSharpScript.Create($@" 286var script1 = script0.ContinueWith($@" 289var script2 = script1.ContinueWith(@" 421var script0 = CSharpScript.Create($@" 429var script1 = script0.ContinueWith($@" 438var script2 = script1.ContinueWith(@" 482var script = CSharpScript.Create("new S1()", options); 580var script = CSharpScript.Create<int>(
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (88)
InteractiveSessionReferencesTests.cs (5)
41var s0 = CSharpScript.Create($@" 45var s1 = s0.ContinueWith($@" 99var s0 = CSharpScript.Create($@" 138var s0 = CSharpScript.Create($@" 147var s1 = s0.ContinueWith($@"
InteractiveSessionTests.cs (48)
45var script = CSharpScript.Create(@" 66var script = CSharpScript.Create(@" 87var script = CSharpScript.Create(@" 104var script = CSharpScript.Create(@" 134var script = CSharpScript.Create(@" 154var script = CSharpScript.Create(@" 173var script = CSharpScript.Create(@" 188var script = CSharpScript.Create(@" 218var script = CSharpScript.Create(@" 234var script = CSharpScript.Create(@" 301var script = CSharpScript.Create<int>(@" 328var script = CSharpScript.Create(@" 364var script = CSharpScript.Create(@" 389var script = CSharpScript.Create( 404var script = CSharpScript.Create("var x = 1;", ScriptOptions).ContinueWith("x"); 447var script = CSharpScript.Create(@" 603var s0 = CSharpScript.Create("int x = 1;", ScriptOptions); 604var s1 = s0.ContinueWith("int y = 2;"); 605var s2 = s1.ContinueWith<int>("x + y"); 716var script = CSharpScript.Create(@" 742var s0 = CSharpScript.Create(@" 1175var script = CSharpScript.Create(@" 1242var script = CSharpScript.Create( 1262var script = CSharpScript.Create( 1341var script = CSharpScript.Create(@"new C()", 1864var script = CSharpScript.Create<bool>(code, options: ScriptOptions, globalsType: typeof(F)); 1886var script = CSharpScript.Create<bool>(code, options: ScriptOptions, globalsType: typeof(F)); 1920var s0 = CSharpScript.Create(@" 1926var s1 = s0.ContinueWith(@" 1943var s0 = CSharpScript.Create(@" 1947var s1 = s0.ContinueWith(@" 1953var s2 = s1.ContinueWith(@" 1970var s0 = CSharpScript.Create(@" 1973var s1 = s0.ContinueWith(@" 1978var s2 = s1.ContinueWith(@" 1981var s3 = s2.ContinueWith(@" 2031var s0 = CSharpScript.Create(@" 2035var s1 = s0.ContinueWith(@" 2041var s2 = s1.ContinueWith(@" 2044var s3 = s2.ContinueWith(@" 2065var s0 = CSharpScript.Create(@" 2069var s1 = s0.ContinueWith(@" 2073var s2 = s1.ContinueWith(@" 2078var s3 = s2.ContinueWith(@" 2099var s0 = CSharpScript.Create(@" 2103var s1 = s0.ContinueWith(@" 2109var s2 = s1.ContinueWith(@" 2112var s3 = s2.ContinueWith(@"
ScriptTests.cs (35)
39var script = CSharpScript.Create("1 + 2", ScriptOptions); 52var script = CSharpScript.Create(new MemoryStream(Encoding.UTF8.GetBytes("1 + 2")), ScriptOptions); 86var script = CSharpScript.Create("1 + 2", options: ScriptOptions.WithEmitDebugInformation(true)); 110var script = CSharpScript.Create("1 + 2", ScriptOptions); 121var script = CSharpScript.Create<int>("X + Y", options: ScriptOptions, globalsType: typeof(Globals)); 139var script = CSharpScript.Create("1 + 2", ScriptOptions); 148var script = CSharpScript.Create(new MemoryStream(Encoding.UTF8.GetBytes("1 + 2")), ScriptOptions); 297var script = CSharpScript.Create("X + Y", options: ScriptOptions, globalsType: typeof(Globals)); 306var script = CSharpScript.Create("X + Y", ScriptOptions); 315var script = CSharpScript.Create("X + Y", options: ScriptOptions, globalsType: typeof(Globals)); 324var script = CSharpScript.Create("X + Y", options: ScriptOptions, globalsType: typeof(Globals)); 391var script = 419var script = CSharpScript.Create("var x = 1;", ScriptOptions); 501var script = CSharpScript.Create<object>($"return {expected};", ScriptOptions); 516var script = CSharpScript.Create<int>("return await System.Threading.Tasks.Task.FromResult(42);", ScriptOptions); 524var script = CSharpScript.Create(@" 537var script = CSharpScript.Create(@" 561var script = CSharpScript.Create<int>(@" 585var script = CSharpScript.Create(@" 609var script = CSharpScript.Create<IEnumerable<int>>(@" 629var script = CSharpScript.Create<int?>(@" 653var script = CSharpScript.Create("#load \"a.csx\"", options); 676var script = CSharpScript.Create("#load \"a.csx\"", options); 699var script = CSharpScript.Create("#load \"a.csx\"", options); 719var script = CSharpScript.Create("#load \"b.csx\"", options); 754var script = CSharpScript.Create("#load \"b.csx\"", options); 792var script = CSharpScript.Create(@" 814var script = CSharpScript.Create("return;", ScriptOptions); 838var script = CSharpScript.Create<int>(@" 948var script = CSharpScript.Create(@"#load ""a.csx""", options); 955var script = CSharpScript.Create(@"string x = default;", ScriptOptions.WithLanguageVersion(LanguageVersion.CSharp7)); 968var script = CSharpScript.Create(@"#nullable enable 991var script = CSharpScript.Create(code, ScriptOptions.WithLanguageVersion(LanguageVersion.CSharp8)); 1110private async Task VerifyStackTraceAsync(Func<Script<object>> scriptProvider, int line = 0, int column = 0, string filename = null) 1114var script = scriptProvider();
Microsoft.CodeAnalysis.InteractiveHost (5)
Interactive\Core\InteractiveHost.Service.cs (5)
364Script<object>? script = TryCompile(state.ScriptState?.Script, text, null, state.ScriptOptions); 649private Script<object>? TryCompile(Script? previousScript, string code, string? path, ScriptOptions options) 673return (Script<object>)script; 719Script<object>? script = TryCompile(state.ScriptState?.Script, content, fullPath, state.ScriptOptions); 748private Task<ScriptState<object>> ExecuteOnUIThreadAsync(Script<object> script, ScriptState<object>? state, bool displayResult)
Microsoft.CodeAnalysis.Scripting (11)
Hosting\CommandLine\CommandLineRunner.cs (4)
207var script = Script.CreateInitialScript<int>(_scriptCompiler, code, options, globals.GetType(), assemblyLoaderOpt: null); 233var script = Script.CreateInitialScript<object>(_scriptCompiler, SourceText.From(initialScriptCodeOpt), options, globals.GetType(), assemblyLoaderOpt: null); 282Script<object> newScript; 296private void BuildAndRun(Script<object> newScript, InteractiveScriptGlobals globals, ref ScriptState<object>? state, ref ScriptOptions options, bool displayResult, CancellationToken cancellationToken)
Hosting\ReplServiceProvider.cs (1)
21public abstract Script<T> CreateScript<T>(string code, ScriptOptions options, Type globalsTypeOpt, InteractiveAssemblyLoader assemblyLoader);
Script.cs (6)
55internal static Script<T> CreateInitialScript<T>(ScriptCompiler compiler, SourceText sourceText, ScriptOptions optionsOpt, Type globalsTypeOpt, InteractiveAssemblyLoader assemblyLoaderOpt) 101public Script<object> ContinueWith(string code, ScriptOptions options = null) 109public Script<object> ContinueWith(Stream code, ScriptOptions options = null) 115public Script<TResult> ContinueWith<TResult>(string code, ScriptOptions options = null) 126public Script<TResult> ContinueWith<TResult>(Stream code, ScriptOptions options = null) 352public new Script<T> WithOptions(ScriptOptions options)
Microsoft.CodeAnalysis.Scripting.TestUtilities (2)
ScriptingTestHelpers.cs (2)
19public static ScriptState<T> RunScriptWithOutput<T>(Script<T> script, string expectedOutput) 34public static T EvaluateScriptWithOutput<T>(Script<T> script, string expectedOutput)
Microsoft.CodeAnalysis.VisualBasic.Scripting (3)
Hosting\VisualBasicReplServiceProvider.vb (1)
38Public Overrides Function CreateScript(Of T)(code As String, options As ScriptOptions, globalsTypeOpt As Type, assemblyLoader As InteractiveAssemblyLoader) As Script(Of T)
VisualBasicScript.vb (2)
26Optional assemblyLoader As InteractiveAssemblyLoader = Nothing) As Script(Of T) 36Optional assemblyLoader As InteractiveAssemblyLoader = Nothing) As Script(Of Object)