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); 327return (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)
166var script = CSharpScript.Create(@" 252var script = CSharpScript.Create($@" 282var script0 = CSharpScript.Create($@" 285var script1 = script0.ContinueWith($@" 288var script2 = script1.ContinueWith(@" 420var script0 = CSharpScript.Create($@" 428var script1 = script0.ContinueWith($@" 437var script2 = script1.ContinueWith(@" 481var script = CSharpScript.Create("new S1()", options); 579var script = CSharpScript.Create<int>(
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (88)
InteractiveSessionReferencesTests.cs (5)
40var s0 = CSharpScript.Create($@" 44var s1 = s0.ContinueWith($@" 98var s0 = CSharpScript.Create($@" 137var s0 = CSharpScript.Create($@" 146var s1 = s0.ContinueWith($@"
InteractiveSessionTests.cs (48)
44var script = CSharpScript.Create(@" 65var script = CSharpScript.Create(@" 86var script = CSharpScript.Create(@" 103var script = CSharpScript.Create(@" 133var script = CSharpScript.Create(@" 153var script = CSharpScript.Create(@" 172var script = CSharpScript.Create(@" 187var script = CSharpScript.Create(@" 217var script = CSharpScript.Create(@" 233var script = CSharpScript.Create(@" 300var script = CSharpScript.Create<int>(@" 327var script = CSharpScript.Create(@" 363var script = CSharpScript.Create(@" 388var script = CSharpScript.Create( 403var script = CSharpScript.Create("var x = 1;").ContinueWith("x"); 446var script = CSharpScript.Create(@" 602var s0 = CSharpScript.Create("int x = 1;"); 603var s1 = s0.ContinueWith("int y = 2;"); 604var s2 = s1.ContinueWith<int>("x + y"); 715var script = CSharpScript.Create(@" 741var s0 = CSharpScript.Create(@" 1174var script = CSharpScript.Create(@" 1241var script = CSharpScript.Create( 1261var script = CSharpScript.Create( 1340var script = CSharpScript.Create(@"new C()", 1863var script = CSharpScript.Create<bool>(code, globalsType: typeof(F)); 1885var script = CSharpScript.Create<bool>(code, globalsType: typeof(F)); 1919var s0 = CSharpScript.Create(@" 1925var s1 = s0.ContinueWith(@" 1942var s0 = CSharpScript.Create(@" 1946var s1 = s0.ContinueWith(@" 1952var s2 = s1.ContinueWith(@" 1969var s0 = CSharpScript.Create(@" 1972var s1 = s0.ContinueWith(@" 1977var s2 = s1.ContinueWith(@" 1980var s3 = s2.ContinueWith(@" 2030var s0 = CSharpScript.Create(@" 2034var s1 = s0.ContinueWith(@" 2040var s2 = s1.ContinueWith(@" 2043var s3 = s2.ContinueWith(@" 2064var s0 = CSharpScript.Create(@" 2068var s1 = s0.ContinueWith(@" 2072var s2 = s1.ContinueWith(@" 2077var s3 = s2.ContinueWith(@" 2098var s0 = CSharpScript.Create(@" 2102var s1 = s0.ContinueWith(@" 2108var s2 = s1.ContinueWith(@" 2111var s3 = s2.ContinueWith(@"
ScriptTests.cs (35)
36var script = CSharpScript.Create("1 + 2"); 49var script = CSharpScript.Create(new MemoryStream(Encoding.UTF8.GetBytes("1 + 2"))); 83var script = CSharpScript.Create("1 + 2", options: ScriptOptions.Default.WithEmitDebugInformation(true)); 107var script = CSharpScript.Create("1 + 2"); 118var script = CSharpScript.Create<int>("X + Y", globalsType: typeof(Globals)); 136var script = CSharpScript.Create("1 + 2"); 145var script = CSharpScript.Create(new MemoryStream(Encoding.UTF8.GetBytes("1 + 2"))); 294var script = CSharpScript.Create("X + Y", globalsType: typeof(Globals)); 303var script = CSharpScript.Create("X + Y"); 312var script = CSharpScript.Create("X + Y", globalsType: typeof(Globals)); 321var script = CSharpScript.Create("X + Y", globalsType: typeof(Globals)); 388var script = 415var script = CSharpScript.Create("var x = 1;"); 497var script = CSharpScript.Create<object>($"return {expected};"); 512var script = CSharpScript.Create<int>("return await System.Threading.Tasks.Task.FromResult(42);"); 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;"); 834var script = CSharpScript.Create<int>(@" 944var script = CSharpScript.Create(@"#load ""a.csx""", options); 951var script = CSharpScript.Create(@"string x = default;", ScriptOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7)); 964var script = CSharpScript.Create(@"#nullable enable 987var script = CSharpScript.Create(code, ScriptOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8)); 1106private async Task VerifyStackTraceAsync(Func<Script<object>> scriptProvider, int line = 0, int column = 0, string filename = null) 1110var 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)
195var script = Script.CreateInitialScript<int>(_scriptCompiler, code, options, globals.GetType(), assemblyLoaderOpt: null); 221var script = Script.CreateInitialScript<object>(_scriptCompiler, SourceText.From(initialScriptCodeOpt), options, globals.GetType(), assemblyLoaderOpt: null); 270Script<object> newScript; 284private 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) 325public 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)