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)
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (10)
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (88)
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)
Microsoft.CodeAnalysis.Scripting.TestUtilities (2)
Microsoft.CodeAnalysis.VisualBasic.Scripting (3)