182 references to Options
Microsoft.CodeAnalysis.CSharp (133)
Binder\Binder.cs (5)
34this.Flags = compilation.Options.TopLevelBinderFlags; 138return result == OverflowChecks.Enabled || result == OverflowChecks.Implicit && Compilation.Options.CheckOverflow; 265!csTree.IsGeneratedCode(this.Compilation.Options.SyntaxTreeOptionsProvider, CancellationToken.None), 284switch (Compilation.Options.NullableContextOptions) 295throw ExceptionUtilities.UnexpectedValue(Compilation.Options.NullableContextOptions);
Binder\Binder_Invocation.cs (1)
1632string path = callerSourceLocation.SourceTree.GetDisplayPath(callerSourceLocation.SourceSpan, Compilation.Options.SourceReferenceResolver);
Binder\Binder_Statements.cs (1)
174if (!this.Compilation.Options.AllowUnsafe)
Binder\BinderFactory.cs (1)
79_buckStopsHereBinder = new BuckStopsHereBinder(compilation, FileIdentifier.Create(syntaxTree, compilation.Options.SourceReferenceResolver));
Binder\ExecutableCodeBinder.cs (1)
130&& compilation.Options.AllowUnsafe) // Don't cascade
Compilation\CSharpCompilation.cs (22)
258(Options.NullableContextOptions & NullableContextOptions.Warnings) != 0; 512this.Options.AssemblyIdentityComparer, 657var oldOptions = this.Options; 1071var resolver = Options.SourceReferenceResolver; 1873if (!this.Options.OutputKind.IsApplication() && (this.ScriptClass is null)) 1890if (this.Options.MainTypeName != null && !this.Options.MainTypeName.IsValidClrTypeName()) 1892Debug.Assert(!this.Options.Errors.IsDefaultOrEmpty); 1903if (this.Options.MainTypeName != null && simpleProgramEntryPointSymbol is object) 1929string? mainTypeName = this.Options.MainTypeName; 2946if (this.Options.ConcurrentBuild) 2989builder.AddRange(Options.Errors); 2991if (Options.NullableContextOptions != NullableContextOptions.Disable && LanguageVersion < MessageID.IDS_FeatureNullableReferenceTypes.RequiredVersion() && 2995nameof(Options.NullableContextOptions), Options.NullableContextOptions, LanguageVersion.ToDisplayString(), 3367!this.Options.OutputKind.IsApplication(), 4771if (Options.CheckOverflow) 4773writeValue(CompilationOptionNames.Checked, Options.CheckOverflow.ToString()); 4776if (Options.NullableContextOptions != NullableContextOptions.Disable) 4778writeValue(CompilationOptionNames.Nullable, Options.NullableContextOptions.ToString()); 4781if (Options.AllowUnsafe) 4783writeValue(CompilationOptionNames.Unsafe, Options.AllowUnsafe.ToString());
Compilation\CSharpCompilation.UsingsFromOptionsAndDiagnostics.cs (1)
29var usings = compilation.Options.Usings;
Compilation\CSharpSemanticModel.cs (3)
5232return new InterceptableLocation1(checksum, path, Compilation.Options.SourceReferenceResolver, nameSyntax.Position, lineNumberOneIndexed, characterNumberOneIndexed); 5463=> lazyDefaultState ??= syntaxTree.IsGeneratedCode(Compilation.Options.SyntaxTreeOptionsProvider, CancellationToken.None) 5465: Compilation.Options.NullableContextOptions;
Compiler\ClsComplianceChecker.cs (1)
63private bool ConcurrentAnalysis => _filterTree == null && _compilation.Options.ConcurrentBuild;
Compiler\DocumentationCommentCompiler.cs (1)
186if (!_compilation.Options.OutputKind.IsNetModule())
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (2)
312var resolver = _compilation.Options.XmlReferenceResolver; 549Binder binder = new BuckStopsHereBinder(compilation, FileIdentifier.Create(syntaxTree, compilation.Options.SourceReferenceResolver));
Compiler\MethodCompiler.cs (4)
153if (compilation.Options.ConcurrentBuild) 212if (moduleBeingBuiltOpt != null && entryPoint != null && compilation.Options.OutputKind.IsApplication()) 374if (_compilation.Options.ConcurrentBuild) 420if (_compilation.Options.ConcurrentBuild)
Emitter\EditAndContinue\EmitHelpers.cs (1)
97outputKind: compilation.Options.OutputKind,
Emitter\Model\PEModuleBuilder.cs (2)
645Debug.Assert(OutputKind.IsNetModule() == sourceAssembly.DeclaringCompilation.Options.OutputKind.IsNetModule()); 660if (!sourceAssembly.DeclaringCompilation.Options.OutputKind.IsNetModule())
Errors\LazyMissingNonNullTypesContextDiagnosticInfo.cs (1)
75var code = tree.IsGeneratedCode(binder.Compilation.Options.SyntaxTreeOptionsProvider, CancellationToken.None)
FlowAnalysis\NullableWalker.cs (1)
1611if (compilation.Options.NullableContextOptions != NullableContextOptions.Disable)
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (1)
497if (F.Compilation.Options.EnableEditAndContinue)
Lowering\AsyncRewriter\AsyncRewriter.cs (1)
74var typeKind = (compilationState.Compilation.Options.EnableEditAndContinue || method.IsIterator) ? TypeKind.Class : TypeKind.Struct;
Lowering\ClosureConversion\ClosureConversion.Analysis.cs (1)
95if (compilationState.Compilation.Options.OptimizationLevel == OptimizationLevel.Release)
Lowering\Instrumentation\DebugInfoInjector_SequencePoints.cs (1)
175if (!factory.Compilation.Options.EnableEditAndContinue)
Lowering\LocalRewriter\LocalRewriter.cs (1)
762bool optimize = _compilation.Options.OptimizationLevel == OptimizationLevel.Release;
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (1)
761this._factory.Compilation.Options.OptimizationLevel == OptimizationLevel.Release &&
Lowering\LocalRewriter\LocalRewriter_SwitchExpression.cs (1)
47GenerateInstrumentation && _localRewriter._compilation.Options.OptimizationLevel != OptimizationLevel.Release;
Lowering\LocalRewriter\LocalRewriter_TryStatement.cs (1)
22var optimizing = _compilation.Options.OptimizationLevel == OptimizationLevel.Release;
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (1)
114if (compilation.Options.OptimizationLevel != OptimizationLevel.Release)
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (3)
147F.Compilation.Options.OptimizationLevel == OptimizationLevel.Release) 530if (F.Compilation.Options.OptimizationLevel == OptimizationLevel.Debug) 680if (F.Compilation.Options.OptimizationLevel == OptimizationLevel.Debug)
Lowering\StateMachineRewriter\StateMachineRewriter.cs (2)
146bool isDebugBuild = F.Compilation.Options.OptimizationLevel == OptimizationLevel.Debug; 274var optimizationLevel = F.Compilation.Options.OptimizationLevel;
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TemplateSymbol.cs (1)
167if (Manager.Compilation.Options.OptimizationLevel == OptimizationLevel.Debug)
Symbols\Attributes\AttributeData.cs (2)
245if (!compilation.Options.AllowUnsafe) 528var resolver = compilation.Options.XmlReferenceResolver;
Symbols\Compilation_WellKnownMembers.cs (4)
125bool ignoreCorLibraryDuplicatedTypes = this.Options.TopLevelBinderFlags.Includes(BinderFlags.IgnoreCorLibraryDuplicatedTypes); 490if (Options.OptimizationLevel != OptimizationLevel.Debug) 504if (Options.OptimizationLevel != OptimizationLevel.Debug) 671if (Options.OutputKind == OutputKind.NetModule)
Symbols\ReferenceManager.cs (3)
347bool supersedeLowerVersions = compilation.Options.ReferencesSupersedeLowerVersions; 387compilation.Options.MetadataReferenceResolver, 388compilation.Options.MetadataImportOptions,
Symbols\Retargeting\RetargetingModuleSymbol.cs (1)
211var identityComparer = _underlyingModule.DeclaringCompilation.Options.AssemblyIdentityComparer;
Symbols\Source\SourceAssemblySymbol.cs (49)
133var importOptions = (compilation.Options.MetadataImportOptions == MetadataImportOptions.All) ? 145if (!compilation.Options.CryptoPublicKey.IsEmpty) 148_lazyStrongNameKeys = StrongNameKeys.Create(compilation.Options.CryptoPublicKey, privateKey: null, hasCounterSignature: false, MessageProvider.Instance); 482string keyFile = _compilation.Options.CryptoKeyFile; 485if (DeclaringCompilation.Options.PublicSign) 496Debug.Assert(!DeclaringCompilation.Options.Errors.IsEmpty); 514string keyContainer = _compilation.Options.CryptoKeyContainer; 527return StrongNameKeys.Create(DeclaringCompilation.Options.StrongNameProvider, keyFile, keyContainer, hasCounterSignature, MessageProvider.Instance); 585if (StrongNameKeys.DiagnosticOpt != null && !_compilation.Options.OutputKind.IsNetModule()) 601if (DeclaringCompilation.Options.PublicSign) 603if (_compilation.Options.OutputKind.IsNetModule()) 618if (DeclaringCompilation.Options.OutputKind != OutputKind.NetModule && 619DeclaringCompilation.Options.CryptoPublicKey.IsEmpty && 622!DeclaringCompilation.Options.PublicSign && 647CSharpCompilationOptions compilationOptions = compilation.Options; 686CSharpCompilationOptions compilationOptions = compilation.Options; 771if (_compilation.Options.DelaySign.HasValue && (assemblyDelaySignAttributeSetting != ThreeState.Unknown) && 772(DeclaringCompilation.Options.DelaySign.Value != (assemblyDelaySignAttributeSetting == ThreeState.True))) 777if (_compilation.Options.PublicSign && assemblyDelaySignAttributeSetting == ThreeState.True) 780nameof(_compilation.Options.PublicSign), 784if (!String.IsNullOrEmpty(_compilation.Options.CryptoKeyContainer)) 790if (_compilation.Options.OutputKind == OutputKind.NetModule) 800else if (String.Compare(_compilation.Options.CryptoKeyContainer, assemblyKeyContainerAttributeSetting, StringComparison.OrdinalIgnoreCase) != 0) 813if (_compilation.Options.OutputKind == OutputKind.NetModule) 824if (_compilation.Options.PublicSign && 825!_compilation.Options.OutputKind.IsNetModule() && 831if (!String.IsNullOrEmpty(_compilation.Options.CryptoKeyFile)) 837if (_compilation.Options.OutputKind == OutputKind.NetModule) 847else if (String.Compare(_compilation.Options.CryptoKeyFile, assemblyKeyFileAttributeSetting, StringComparison.OrdinalIgnoreCase) != 0) 850if (_compilation.Options.OutputKind == OutputKind.NetModule) 861if (_compilation.Options.PublicSign && 862!_compilation.Options.OutputKind.IsNetModule() && 874if (_compilation.Options.DelaySign.HasValue) 876return _compilation.Options.DelaySign.Value; 880if (_compilation.Options.PublicSign) 988if (_modules.Length > 1 && !_compilation.Options.OutputKind.IsNetModule()) 1364if (_compilation.Options.OutputKind.IsNetModule()) 1464if (_compilation.Options.OutputKind.IsNetModule()) 1815if (_compilation.Options.AllowUnsafe) 1942CSharpCompilationOptions options = _compilation.Options; 2014if (_compilation.Options.OutputKind == OutputKind.NetModule) 2019if (!string.IsNullOrEmpty(_compilation.Options.CryptoKeyContainer) && 2025var typedConstant = new TypedConstant(stringType, TypedConstantKind.Primitive, _compilation.Options.CryptoKeyContainer); 2029if (!String.IsNullOrEmpty(_compilation.Options.CryptoKeyFile) && 2035var typedConstant = new TypedConstant(stringType, TypedConstantKind.Primitive, _compilation.Options.CryptoKeyFile); 2182VersionHelper.GenerateVersionFromPatternAndCurrentTime(_compilation.Options.CurrentLocalTime, AssemblyVersionAttributeSetting), 2434if (_compilation.Options.OutputKind.IsApplication()) 2659internal override bool IsNetModule() => this._compilation.Options.OutputKind.IsNetModule(); 2865else if (!_compilation.Options.OutputKind.IsNetModule())
Symbols\Source\SourceMemberContainerSymbol.cs (1)
873return FileIdentifier.Create(syntaxTree, DeclaringCompilation?.Options?.SourceReferenceResolver);
Symbols\Source\SourceModuleSymbol.cs (3)
89switch (DeclaringCompilation.Options.Platform) 109return DeclaringCompilation.Options.Platform == Platform.X86; 629if (compilation.Options.AllowUnsafe)
Symbols\Source\SourceNamespaceSymbol_Completion.cs (1)
59if (this.DeclaringCompilation.Options.ConcurrentBuild)
Symbols\Source\SourcePropertyAccessorSymbol.cs (1)
472(DeclaringCompilation.Options.OutputKind != OutputKind.NetModule &&
Symbols\SymbolDistinguisher.cs (1)
170string path = tree.GetDisplayPath(span, (compilation != null) ? compilation.Options.SourceReferenceResolver : null);
Symbols\SymbolExtensions.cs (2)
27return comp != null && comp.Options.OutputKind == OutputKind.WindowsRuntimeMetadata; 288return symbol.DeclaringCompilation.Options.AllowUnsafe;
Symbols\Synthesized\SynthesizedInteractiveInitializerMethod.cs (1)
251bool value = (compilation.Options.NullableContextOptions != NullableContextOptions.Disable) ||
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (1)
222Binder result = new BuckStopsHereBinder(compilation, FileIdentifier.Create(syntaxNode.SyntaxTree, compilation.Options.SourceReferenceResolver));
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
43var compilationOptions = compilation.Options;
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (4)
CodeGen\CodeGenTests.cs (1)
13271var options = compilation.Options;
CodeGen\CodeGenTupleTest.cs (2)
25333var comp2 = comp.WithOptions(comp.Options.WithTopLevelBinderFlags(BinderFlags.IgnoreCorLibraryDuplicatedTypes)); 25339.WithOptions(comp.Options.WithTopLevelBinderFlags(BinderFlags.IgnoreCorLibraryDuplicatedTypes));
Emit\CompilationEmitTests.cs (1)
4749useCompilation = useCompilation.WithOptions(useCompilation.Options.WithSpecificDiagnosticOptions(warnings));
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (36)
Attributes\AttributeTests_Assembly.cs (3)
184other = other.WithOptions(other.Options.WithSpecificDiagnosticOptions(warnings)); 216other = other.WithOptions(other.Options.WithSpecificDiagnosticOptions(warnings)); 432compilation = compilation.WithOptions(compilation.Options.WithSpecificDiagnosticOptions(warnings));
Attributes\InternalsVisibleToAndStrongNameTests.cs (19)
565Assert.True(c.Options.PublicSign); 585Assert.True(c.Options.PublicSign); 616Assert.True(comp.Options.PublicSign); 617Assert.Null(comp.Options.DelaySign); 619Assert.NotNull(comp.Options.CryptoKeyFile); 638Assert.True(comp.Options.PublicSign); 639Assert.Null(comp.Options.DelaySign); 641Assert.NotNull(comp.Options.CryptoKeyFile); 664Assert.True(comp.Options.PublicSign); 665Assert.Null(comp.Options.DelaySign); 667Assert.NotNull(comp.Options.CryptoKeyFile); 705Assert.True(comp.Options.PublicSign); 706Assert.Null(comp.Options.DelaySign); 708Assert.NotNull(comp.Options.CryptoKeyContainer); 728Assert.True(comp.Options.PublicSign); 729Assert.True(comp.Options.DelaySign); 747Assert.True(comp.Options.PublicSign); 748Assert.False(comp.Options.DelaySign); 762Assert.True(comp.Options.PublicSign);
Diagnostics\DiagnosticAnalyzerTests.cs (5)
1379var options = compilation.Options.WithConcurrentBuild(true); 1552var options = compilation.Options.WithGeneralDiagnosticOption(ReportDiagnostic.Error); 4184options = compilation.Options.WithSyntaxTreeOptionsProvider( 4194options = compilation.Options 4225var options = compilation.Options.WithSyntaxTreeOptionsProvider(new CancellingSyntaxTreeOptionsProvider());
Diagnostics\DiagnosticSuppressorTests.cs (4)
313var specificDiagnosticOptions = compilation.Options.SpecificDiagnosticOptions.Add(suppressionId, ReportDiagnostic.Suppress); 314compilation = compilation.WithOptions(compilation.Options.WithSpecificDiagnosticOptions(specificDiagnosticOptions)); 328var originalSpecificDiagnosticOptions = compilation.Options.SpecificDiagnosticOptions; 362compilation = compilation.WithOptions(compilation.Options.WithSpecificDiagnosticOptions(specificDiagnosticOptions));
Diagnostics\GetDiagnosticsTests.cs (3)
660compilation = compilation.WithOptions(compilation.Options.WithConcurrentBuild(true)); 713compilation = compilation.WithOptions(compilation.Options.WithConcurrentBuild(true)); 740compilation = compilation.WithOptions(compilation.Options.WithConcurrentBuild(concurrent));
Semantics\ParamsCollectionTests.cs (2)
12815if (comp.Options.OutputKind == OutputKind.NetModule && memberName.StartsWith("<>")) 12839verify: comp.Options.OutputKind != OutputKind.NetModule ?
Microsoft.CodeAnalysis.CSharp.Features (1)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
43var compilationOptions = compilation.Options;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\NullableReferenceTypesTests.cs (1)
111692string bangOrEmpty = comp0.Options.NullableContextOptions == NullableContextOptions.Disable ? "" : "!";
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (4)
Compilation\CompilationAPITests.cs (3)
361Assert.Equal(ops, comp.Options); 2005var c3 = c1.WithOptions(TestOptions.ReleaseDll.WithMetadataReferenceResolver(c1.Options.MetadataReferenceResolver)); 2017var c3 = c1.WithOptions(TestOptions.ReleaseDll.WithXmlReferenceResolver(c1.Options.XmlReferenceResolver));
Symbols\GenericConstraintTests.cs (1)
7312comp.WithOptions(comp.Options.WithSpecificDiagnosticOptions("CS1701", ReportDiagnostic.Suppress)),
Microsoft.CodeAnalysis.Scripting.UnitTests (1)
ScriptOptionsTests.cs (1)
220Assert.Equal(scriptOptions.AllowUnsafe, compilation.Options.AllowUnsafe);
System.Text.RegularExpressions.Generator (1)
RegexGenerator.Parser.cs (1)
210var compilationData = compilation is CSharpCompilation { LanguageVersion: LanguageVersion langVersion, Options: CSharpCompilationOptions compilationOptions }