15 instantiations of ScriptOptions
Microsoft.CodeAnalysis.Scripting (15)
Hosting\CommandLine\CommandLineRunner.cs (1)
164return new ScriptOptions(
ScriptOptions.cs (14)
25public static ScriptOptions Default { get; } = new ScriptOptions( 206=> (FilePath == filePath) ? this : new ScriptOptions(this) { FilePath = filePath ?? "" }; 216=> MetadataReferences.Equals(references) ? this : new ScriptOptions(this) { MetadataReferences = CheckImmutableArray(references, nameof(references)) }; 311=> MetadataResolver == resolver ? this : new ScriptOptions(this) { MetadataResolver = resolver }; 317=> SourceResolver == resolver ? this : new ScriptOptions(this) { SourceResolver = resolver }; 324=> Imports.Equals(imports) ? this : new ScriptOptions(this) { Imports = CheckImmutableArray(imports, nameof(imports)) }; 358=> emitDebugInformation == EmitDebugInformation ? this : new ScriptOptions(this) { EmitDebugInformation = emitDebugInformation }; 364=> encoding == FileEncoding ? this : new ScriptOptions(this) { FileEncoding = encoding }; 370=> optimizationLevel == OptimizationLevel ? this : new ScriptOptions(this) { OptimizationLevel = optimizationLevel }; 376=> allowUnsafe == AllowUnsafe ? this : new ScriptOptions(this) { AllowUnsafe = allowUnsafe }; 382=> checkOverflow == CheckOverflow ? this : new ScriptOptions(this) { CheckOverflow = checkOverflow }; 388=> warningLevel == WarningLevel ? this : new ScriptOptions(this) { WarningLevel = warningLevel }; 391=> parseOptions == ParseOptions ? this : new ScriptOptions(this) { ParseOptions = parseOptions }; 394=> new ScriptOptions(this) { CreateFromFileFunc = createFromFileFunc };
106 references to ScriptOptions
Microsoft.CodeAnalysis.CSharp.Scripting (11)
CSharpScript.cs (8)
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) 98public static Task<ScriptState<T>> RunAsync<T>(string code, ScriptOptions options = null, object globals = null, Type globalsType = null, CancellationToken cancellationToken = default(CancellationToken)) 112public static Task<ScriptState<object>> RunAsync(string code, ScriptOptions options = null, object globals = null, Type globalsType = null, CancellationToken cancellationToken = default(CancellationToken)) 128public static Task<T> EvaluateAsync<T>(string code, ScriptOptions options = null, object globals = null, Type globalsType = null, CancellationToken cancellationToken = default(CancellationToken)) 143public static Task<object> EvaluateAsync(string code, ScriptOptions options = null, object globals = null, Type globalsType = null, CancellationToken cancellationToken = default(CancellationToken))
Hosting\CSharpReplServiceProvider.cs (1)
26public override Script<T> CreateScript<T>(string code, ScriptOptions options, Type globalsTypeOpt, InteractiveAssemblyLoader assemblyLoader)
ScriptOptionsExtensions.cs (2)
14public static ScriptOptions WithLanguageVersion(this ScriptOptions options, LanguageVersion languageVersion)
Microsoft.CodeAnalysis.Scripting (88)
Hosting\CommandLine\CommandLineHelpers.cs (2)
20internal static ScriptOptions RemoveImportsAndReferences(this ScriptOptions options)
Hosting\CommandLine\CommandLineRunner.cs (7)
128var scriptOptions = GetScriptOptions(Compiler.Arguments, scriptPathOpt, Compiler.MessageProvider, diagnosticsInfos, emitDebugInformation); 150private ScriptOptions? GetScriptOptions(CommandLineArguments arguments, string? scriptPathOpt, CommonMessageProvider messageProvider, List<DiagnosticInfo> diagnostics, bool emitDebugInformation) 200private int RunScript(ScriptOptions? options, SourceText? code, ErrorLogger? errorLogger, CancellationToken cancellationToken) 222private void RunInteractiveLoop(ScriptOptions options, string? initialScriptCodeOpt, CancellationToken cancellationToken) 294private void BuildAndRun(Script<object> newScript, InteractiveScriptGlobals globals, ref ScriptState<object>? state, ref ScriptOptions options, bool displayResult, CancellationToken cancellationToken) 320private static ScriptOptions UpdateOptions(ScriptOptions options, InteractiveScriptGlobals globals)
Hosting\ReplServiceProvider.cs (1)
21public abstract Script<T> CreateScript<T>(string code, ScriptOptions options, Type globalsTypeOpt, InteractiveAssemblyLoader assemblyLoader);
Script.cs (16)
39internal Script(ScriptCompiler compiler, ScriptBuilder builder, SourceText sourceText, ScriptOptions options, Type globalsTypeOpt, Script previousOpt) 54internal static Script<T> CreateInitialScript<T>(ScriptCompiler compiler, SourceText sourceText, ScriptOptions optionsOpt, Type globalsTypeOpt, InteractiveAssemblyLoader assemblyLoaderOpt) 56return new Script<T>(compiler, new ScriptBuilder(assemblyLoaderOpt ?? new InteractiveAssemblyLoader()), sourceText, optionsOpt ?? ScriptOptions.Default, globalsTypeOpt, previousOpt: null); 69public ScriptOptions Options { get; } 94public Script WithOptions(ScriptOptions options) => WithOptionsInternal(options); 95internal abstract Script WithOptionsInternal(ScriptOptions options); 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) 133private static ScriptOptions InheritOptions(ScriptOptions previous) 243/// This can be different than the list of references defined by the <see cref="ScriptOptions"/> instance. 344internal Script(ScriptCompiler compiler, ScriptBuilder builder, SourceText sourceText, ScriptOptions options, Type globalsTypeOpt, Script previousOpt) 351public new Script<T> WithOptions(ScriptOptions options) 356internal override Script WithOptionsInternal(ScriptOptions options) => WithOptions(options);
ScriptOptions.cs (58)
25public static ScriptOptions Default { get; } = new ScriptOptions( 181private ScriptOptions(ScriptOptions other) 203/// Creates a new <see cref="ScriptOptions"/> with the <see cref="FilePath"/> changed. 205public ScriptOptions WithFilePath(string? filePath) 212/// Creates a new <see cref="ScriptOptions"/> with the references changed. 215private ScriptOptions WithReferences(ImmutableArray<MetadataReference> references) 219/// Creates a new <see cref="ScriptOptions"/> with the references changed. 222public ScriptOptions WithReferences(IEnumerable<MetadataReference> references) 226/// Creates a new <see cref="ScriptOptions"/> with the references changed. 229public ScriptOptions WithReferences(params MetadataReference[] references) 233/// Creates a new <see cref="ScriptOptions"/> with references added. 236public ScriptOptions AddReferences(IEnumerable<MetadataReference> references) 240/// Creates a new <see cref="ScriptOptions"/> with references added. 242public ScriptOptions AddReferences(params MetadataReference[] references) 246/// Creates a new <see cref="ScriptOptions"/> with the references changed. 250public ScriptOptions WithReferences(IEnumerable<Assembly> references) 254/// Creates a new <see cref="ScriptOptions"/> with the references changed. 258public ScriptOptions WithReferences(params Assembly[] references) 262/// Creates a new <see cref="ScriptOptions"/> with references added. 266public ScriptOptions AddReferences(IEnumerable<Assembly> references) 273/// Creates a new <see cref="ScriptOptions"/> with references added. 277public ScriptOptions AddReferences(params Assembly[] references) 281/// Creates a new <see cref="ScriptOptions"/> with the references changed. 284public ScriptOptions WithReferences(IEnumerable<string> references) 288/// Creates a new <see cref="ScriptOptions"/> with the references changed. 291public ScriptOptions WithReferences(params string[] references) 295/// Creates a new <see cref="ScriptOptions"/> with references added. 298public ScriptOptions AddReferences(IEnumerable<string> references) 302/// Creates a new <see cref="ScriptOptions"/> with references added. 304public ScriptOptions AddReferences(params string[] references) 308/// Creates a new <see cref="ScriptOptions"/> with specified <see cref="MetadataResolver"/>. 310public ScriptOptions WithMetadataResolver(MetadataReferenceResolver resolver) 314/// Creates a new <see cref="ScriptOptions"/> with specified <see cref="SourceResolver"/>. 316public ScriptOptions WithSourceResolver(SourceReferenceResolver resolver) 320/// Creates a new <see cref="ScriptOptions"/> with the <see cref="Imports"/> changed. 323private ScriptOptions WithImports(ImmutableArray<string> imports) 327/// Creates a new <see cref="ScriptOptions"/> with the <see cref="Imports"/> changed. 330public ScriptOptions WithImports(IEnumerable<string> imports) 334/// Creates a new <see cref="ScriptOptions"/> with the <see cref="Imports"/> changed. 337public ScriptOptions WithImports(params string[] imports) 341/// Creates a new <see cref="ScriptOptions"/> with <see cref="Imports"/> added. 344public ScriptOptions AddImports(IEnumerable<string> imports) 348/// Creates a new <see cref="ScriptOptions"/> with <see cref="Imports"/> added. 351public ScriptOptions AddImports(params string[] imports) 355/// Creates a new <see cref="ScriptOptions"/> with debugging information enabled. 357public ScriptOptions WithEmitDebugInformation(bool emitDebugInformation) 361/// Creates a new <see cref="ScriptOptions"/> with specified <see cref="FileEncoding"/>. 363public ScriptOptions WithFileEncoding(Encoding encoding) 367/// Create a new <see cref="ScriptOptions"/> with the specified <see cref="OptimizationLevel"/>. 369public ScriptOptions WithOptimizationLevel(OptimizationLevel optimizationLevel) 373/// Create a new <see cref="ScriptOptions"/> with unsafe code regions allowed. 375public ScriptOptions WithAllowUnsafe(bool allowUnsafe) 379/// Create a new <see cref="ScriptOptions"/> with bounds checking on integer arithmetic enforced. 381public ScriptOptions WithCheckOverflow(bool checkOverflow) 385/// Create a new <see cref="ScriptOptions"/> with the specific <see cref="WarningLevel"/>. 387public ScriptOptions WithWarningLevel(int warningLevel) 390internal ScriptOptions WithParseOptions(ParseOptions parseOptions) 393internal ScriptOptions WithCreateFromFileFunc(Func<string, PEStreamOptions, MetadataReferenceProperties, MetadataImageReference> createFromFileFunc)
ScriptState.cs (4)
142public Task<ScriptState<object>> ContinueWithAsync(string code, ScriptOptions options, CancellationToken cancellationToken) 156public Task<ScriptState<object>> ContinueWithAsync(string code, ScriptOptions options = null, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken)) 166public Task<ScriptState<TResult>> ContinueWithAsync<TResult>(string code, ScriptOptions options, CancellationToken cancellationToken) 180public Task<ScriptState<TResult>> ContinueWithAsync<TResult>(string code, ScriptOptions options = null, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken))
Microsoft.CodeAnalysis.VisualBasic.Scripting (7)
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 (6)
23Optional options As ScriptOptions = Nothing, 33Optional options As ScriptOptions = Nothing, 43Optional options As ScriptOptions = Nothing, 53Optional options As ScriptOptions = Nothing, 63Optional options As ScriptOptions = Nothing, 73Optional options As ScriptOptions = Nothing,