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