4 instantiations of Script
Microsoft.CodeAnalysis.Scripting (4)
Script.cs (4)
56return new Script<T>(compiler, new ScriptBuilder(assemblyLoaderOpt ?? new InteractiveAssemblyLoader()), sourceText, optionsOpt ?? ScriptOptions.Default, globalsTypeOpt, previousOpt: null); 117return new Script<TResult>(Compiler, Builder, SourceText.From(code ?? "", options.FileEncoding), options, GlobalsType, this); 130return new Script<TResult>(Compiler, Builder, SourceText.From(code, options.FileEncoding), options, GlobalsType, this); 353return (options == Options) ? this : new Script<T>(Compiler, Builder, SourceText, options, GlobalsType, Previous);
126 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)
26public override Script<T> CreateScript<T>(string code, ScriptOptions options, Type globalsTypeOpt, InteractiveAssemblyLoader assemblyLoader)
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (10)
InteractiveSessionReferencesTests.cs (10)
165var script = CSharpScript.Create(@" 251var script = CSharpScript.Create($@" 281var script0 = CSharpScript.Create($@" 284var script1 = script0.ContinueWith($@" 287var script2 = script1.ContinueWith(@" 419var script0 = CSharpScript.Create($@" 427var script1 = script0.ContinueWith($@" 436var script2 = script1.ContinueWith(@" 480var script = CSharpScript.Create("new S1()", options); 578var script = CSharpScript.Create<int>(
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (90)
InteractiveSessionReferencesTests.cs (5)
39var s0 = CSharpScript.Create($@" 43var s1 = s0.ContinueWith($@" 97var s0 = CSharpScript.Create($@" 136var s0 = CSharpScript.Create($@" 145var 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 (37)
35var script = CSharpScript.Create("1 + 2", ScriptOptions); 48var script = CSharpScript.Create(new MemoryStream(Encoding.UTF8.GetBytes("1 + 2")), ScriptOptions); 82var script = CSharpScript.Create("1 + 2", options: ScriptOptions.WithEmitDebugInformation(true)); 106var script = CSharpScript.Create("1 + 2", ScriptOptions); 117var script = CSharpScript.Create<int>("X + Y", options: ScriptOptions, globalsType: typeof(Globals)); 135var script = CSharpScript.Create("1 + 2", ScriptOptions); 144var script = CSharpScript.Create(new MemoryStream(Encoding.UTF8.GetBytes("1 + 2")), ScriptOptions); 293var script = CSharpScript.Create("X + Y", options: ScriptOptions, globalsType: typeof(Globals)); 302var script = CSharpScript.Create("X + Y", ScriptOptions); 311var script = CSharpScript.Create("X + Y", options: ScriptOptions, globalsType: typeof(Globals)); 320var script = CSharpScript.Create("X + Y", options: ScriptOptions, globalsType: typeof(Globals)); 387var script = 415var script = CSharpScript.Create("var x = 1;", ScriptOptions); 497var script = CSharpScript.Create<object>($"return {expected};", ScriptOptions); 512var script = CSharpScript.Create<int>("return await System.Threading.Tasks.Task.FromResult(42);", ScriptOptions); 520var script = CSharpScript.Create(@" 533var script = CSharpScript.Create(@" 557var script = CSharpScript.Create<int>(@" 581var script = CSharpScript.Create(@" 605var script = CSharpScript.Create<IEnumerable<int>>(@" 625var script = CSharpScript.Create<int?>(@" 649var script = CSharpScript.Create("#load \"a.csx\"", options); 672var script = CSharpScript.Create("#load \"a.csx\"", options); 695var script = CSharpScript.Create("#load \"a.csx\"", options); 715var script = CSharpScript.Create("#load \"b.csx\"", options); 750var script = CSharpScript.Create("#load \"b.csx\"", options); 788var script = CSharpScript.Create(@" 810var script = CSharpScript.Create("return;", ScriptOptions); 834var script = CSharpScript.Create<int>(@" 944var script = CSharpScript.Create(@"#load ""a.csx""", options); 951var script = CSharpScript.Create(@"string x = default;", ScriptOptions.WithLanguageVersion(LanguageVersion.CSharp7)); 964var script = CSharpScript.Create(@"#nullable enable 987var script = CSharpScript.Create(code, ScriptOptions.WithLanguageVersion(LanguageVersion.CSharp8)); 1069var script = CSharpScript.Create("class partial;", ScriptOptions.WithLanguageVersion(LanguageVersion.Preview)) 1089var script = CSharpScript.Create("class partial;", ScriptOptions.WithLanguageVersion(LanguageVersion.CSharp13)) 1138private async Task VerifyStackTraceAsync(Func<Script<object>> scriptProvider, int line = 0, int column = 0, string filename = null) 1142var script = scriptProvider();
Microsoft.CodeAnalysis.InteractiveHost (5)
Interactive\Core\InteractiveHost.Service.cs (5)
366Script<object>? script = TryCompile(state.ScriptState?.Script, text, null, state.ScriptOptions); 651private Script<object>? TryCompile(Script? previousScript, string code, string? path, ScriptOptions options) 675return (Script<object>)script; 721Script<object>? script = TryCompile(state.ScriptState?.Script, content, fullPath, state.ScriptOptions); 750private Task<ScriptState<object>> ExecuteOnUIThreadAsync(Script<object> script, ScriptState<object>? state, bool displayResult)
Microsoft.CodeAnalysis.Scripting (11)
Hosting\CommandLine\CommandLineRunner.cs (4)
205var script = Script.CreateInitialScript<int>(_scriptCompiler, code, options, globals.GetType(), assemblyLoaderOpt: null); 231var script = Script.CreateInitialScript<object>(_scriptCompiler, SourceText.From(initialScriptCodeOpt), options, globals.GetType(), assemblyLoaderOpt: null); 280Script<object> newScript; 294private 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)
54internal static Script<T> CreateInitialScript<T>(ScriptCompiler compiler, SourceText sourceText, ScriptOptions optionsOpt, Type globalsTypeOpt, InteractiveAssemblyLoader assemblyLoaderOpt) 100public Script<object> ContinueWith(string code, ScriptOptions options = null) 108public Script<object> ContinueWith(Stream code, ScriptOptions options = null) 114public Script<TResult> ContinueWith<TResult>(string code, ScriptOptions options = null) 125public Script<TResult> ContinueWith<TResult>(Stream code, ScriptOptions options = null) 351public 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) 32public static T EvaluateScriptWithOutput<T>(Script<T> script, string expectedOutput)
Microsoft.CodeAnalysis.VisualBasic.Scripting (3)
Hosting\VisualBasicReplServiceProvider.vb (1)
36Public Overrides Function CreateScript(Of T)(code As String, options As ScriptOptions, globalsTypeOpt As Type, assemblyLoader As InteractiveAssemblyLoader) As Script(Of T)
VisualBasicScript.vb (2)
25Optional assemblyLoader As InteractiveAssemblyLoader = Nothing) As Script(Of T) 35Optional assemblyLoader As InteractiveAssemblyLoader = Nothing) As Script(Of Object)