233 references to Options
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\Specs\InterceptorInfo.cs (1)
192SourceReferenceResolver? sourceReferenceResolver = invocation.SemanticModel?.Compilation.Options.SourceReferenceResolver;
Microsoft.Analyzers.Extra (1)
MakeExeTypesInternalAnalyzer.cs (1)
89if (compilationStartContext.Compilation.Options.OutputKind == OutputKind.ConsoleApplication)
Microsoft.AspNetCore.Analyzer.Testing (4)
DiagnosticAnalyzerRunner.cs (2)
65var options = ConfigureCompilationOptions(compilation.Options); 68options = compilation.Options
DiagnosticVerifier.cs (2)
85var options = compilation.Options; 88options = compilation.Options
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
StaticRouteHandlerModel\Endpoint.cs (1)
166var filePath = operation.Syntax.SyntaxTree.GetInterceptorFilePath(operation.SemanticModel?.Compilation.Options.SourceReferenceResolver);
Microsoft.CodeAnalysis (79)
CodeGen\PermissionSetAttribute.cs (1)
93var resolver = context.Module.CommonCompilation.Options.XmlReferenceResolver;
CommandLine\CommonCompiler.cs (7)
426Debug.Assert(compilation.Options.SourceReferenceResolver is object); 453ResolveEmbeddedFilesFromExternalSourceDirectives(tree, compilation.Options.SourceReferenceResolver, embeddedFileOrderedSet, diagnostics); 946ResolveAnalyzersFromArguments(diagnosticInfos, MessageProvider, compilation.Options, Arguments.SkipAnalyzers, out var analyzers, out var generators); 1002ReportAnalyzerUtil.Report(consoleOutput, analyzerDriver, driverTimingInfo, Culture, compilation.Options.ConcurrentBuild); 1441if (compilation.Options.StrongNameProvider != null && compilation.SignUsingBuilder && !compilation.Options.PublicSign) 1664using (Stream? manifestStream = OpenManifestStream(fileSystem, messageProvider, compilation.Options.OutputKind, arguments, diagnostics))
Compilation\Compilation.cs (22)
218Options, 417return Options.ModuleName ?? 418(AssemblyName != null ? AssemblyName + Options.OutputKind.GetDefaultExtension() : UnspecifiedModuleAssemblyName); 1034string scriptClassName = this.Options.ScriptClassName ?? ""; 1876bool reportSuppressedDiagnostics = Options.ReportSuppressedDiagnostics; 1885var filtered = Options.FilterDiagnostic(d, cancellationToken); 1925if (this.Options.OutputKind.IsApplication()) 1941Win32ResourceConversions.AppendManifestToResourceStream(result, manifestContents, !this.Options.OutputKind.IsApplication()); 2123if (Options.OutputKind == OutputKind.NetModule && !(manifestResources != null && manifestResources.Any())) 2157if (Options.OutputKind != OutputKind.NetModule) 2195CompilationOptions compilationOptions = this.Options; 2434&& Options.OutputKind != OutputKind.NetModule 2448&& !Options.PublicSign 2449&& Options.OutputKind != OutputKind.NetModule 2867if (this.Options.OutputKind == OutputKind.NetModule) 2994if (Options.StrongNameProvider != null && SignUsingBuilder && !Options.PublicSign) 3149options.ValidateOptions(diagnostics, MessageProvider, Options.Deterministic); 3156if (Options.OutputKind == OutputKind.NetModule && manifestResources != null) 3195internal bool IsEmitDeterministic => this.Options.Deterministic; 3243emitPeStream = new EmitStream(peStreamProvider, signKind, StrongNameKeys, Options.StrongNameProvider); 3246: new EmitStream(metadataPEStreamProvider, signKind, StrongNameKeys, Options.StrongNameProvider);
Compilation\DeterministicKeyBuilder.cs (2)
326var builder = compilation.Options.CreateDeterministicKeyBuilder(); 329compilation.Options,
DiagnosticAnalyzer\AnalysisScope.cs (1)
106return Create(compilation, analyzerOptions, analyzers, hasAllAnalyzers: true, concurrentAnalysis: compilation.Options.ConcurrentBuild);
DiagnosticAnalyzer\AnalyzerDriver.cs (14)
878var reportSuppressedDiagnostics = compilation.Options.ReportSuppressedDiagnostics; 953if (compilation.Options.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var severity) || 954compilation.Options.SyntaxTreeOptionsProvider?.TryGetGlobalDiagnosticValue(descriptor.Id, cancellationToken, out severity) == true) 964compilation.Options.GeneralDiagnosticOption == ReportDiagnostic.Error) 969if (compilation.Options.SyntaxTreeOptionsProvider is not { } syntaxTreeProvider || 987compilation.Options.GeneralDiagnosticOption == ReportDiagnostic.Error) 1059executeSuppressionActions(suppressableDiagnostics, concurrent: compilation.Options.ConcurrentBuild); 1207var reportSuppressedDiagnostics = compilation.Options.ReportSuppressedDiagnostics; 1237if (compilation.Options.ReportSuppressedDiagnostics || diagnostics.All(d => !d.IsSuppressed)) 1393var configuredSeverity = descriptor.GetEffectiveSeverity(AnalyzerExecutor.Compilation.Options); 1995var filteredDiagnostic = compilation.Options.FilterDiagnostic(diagnostic, cancellationToken); 2035if (!IsDiagnosticAnalyzerSuppressed(analyzer, analyzerExecutor.Compilation.Options, analyzerManager, analyzerExecutor, analysisScope, severityFilter, cancellationToken)) 2235Debug.Assert(!IsDiagnosticAnalyzerSuppressed(analyzer, analyzerExecutor.Compilation.Options, analyzerManager, analyzerExecutor, analysisScope, severityFilter, cancellationToken)); 2260Debug.Assert(!IsDiagnosticAnalyzerSuppressed(analyzer, analyzerExecutor.Compilation.Options, analyzerManager, analyzerExecutor, analysisScope, severityFilter, cancellationToken));
DiagnosticAnalyzer\AnalyzerExecutor.cs (1)
63return _isAnalyzerSuppressedForTree(analyzer, tree, Compilation.Options.SyntaxTreeOptionsProvider, cancellationToken);
DiagnosticAnalyzer\AnalyzerManager.cs (1)
317if (analyzerExecutor.Compilation.Options.SyntaxTreeOptionsProvider is { } treeOptions)
DiagnosticAnalyzer\AnalyzerOptionsExtensions.cs (5)
53if (compilation.Options.SpecificDiagnosticOptions.ContainsKey(descriptor.Id) || 54compilation.Options.SyntaxTreeOptionsProvider?.TryGetDiagnosticValue(tree, descriptor.Id, cancellationToken, out _) == true || 55compilation.Options.SyntaxTreeOptionsProvider?.TryGetGlobalDiagnosticValue(descriptor.Id, cancellationToken, out _) == true) 70if (severity == ReportDiagnostic.Warn && compilation.Options.GeneralDiagnosticOption == ReportDiagnostic.Error) 82if (severity == ReportDiagnostic.Warn && compilation.Options.GeneralDiagnosticOption == ReportDiagnostic.Error)
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (4)
99.WithOptions(compilation.Options.WithReportSuppressedDiagnostics(analysisOptions.ReportSuppressedDiagnostics)) 843var actionCounts = await driver.GetAnalyzerActionCountsAsync(analyzer, compilation.Options, analysisScope, cancellationToken).ConfigureAwait(false); 1199var effectiveDiagnostic = compilation.Options.FilterDiagnostic(diagnostic, CancellationToken.None); 1301return await driver.GetAnalyzerActionCountsAsync(analyzer, _compilation.Options, analysisScope, cancellationToken).ConfigureAwait(false);
DiagnosticAnalyzer\DiagnosticAnalysisContext.cs (1)
1951if (suppression.Descriptor.IsDisabled(Compilation.Options))
Emit\CommonPEModuleBuilder.cs (1)
63DebugDocumentsBuilder = new DebugDocumentsBuilder(compilation.Options.SourceReferenceResolver, compilation.IsCaseSensitive);
MetadataReference\CompilationReference.cs (1)
39if (compilation.Options.OutputKind == OutputKind.NetModule)
NativePdbWriter\PdbWriter.cs (1)
81var compilationOptions = Context.Module.CommonCompilation.Options;
PEWriter\MetadataWriter.PortablePdb.cs (6)
158if (Context.Module.CommonCompilation.Options.EnableEditAndContinue && IsFullMetadata) 890WriteValue(CompilationOptionNames.Language, module.CommonCompilation.Options.Language); 905if (module.CommonCompilation.Options.AssemblyIdentityComparer is DesktopAssemblyIdentityComparer identityComparer) 916var optimizationLevel = module.CommonCompilation.Options.OptimizationLevel; 917var debugPlusMode = module.CommonCompilation.Options.DebugPlusMode; 923var platform = module.CommonCompilation.Options.Platform;
PEWriter\PeWriter.cs (1)
271var strongNameProvider = context.Module.CommonCompilation.Options.StrongNameProvider;
ReferenceManager\CommonReferenceManager.Resolution.cs (6)
241bool supersedeLowerVersions = compilation.Options.ReferencesSupersedeLowerVersions; 356compilation.Options.MetadataImportOptions, 805if (compilation.Options.MetadataReferenceResolver == null) 874Debug.Assert(compilation.Options.MetadataReferenceResolver != null); 876var references = compilation.Options.MetadataReferenceResolver.ResolveReference(reference, basePath, MetadataReferenceProperties.Assembly.WithRecursiveAliases(true)); 1033sourceCompilation?.Options.OutputKind == OutputKind.WindowsRuntimeMetadata &&
SourceGeneration\GeneratorDriver.cs (2)
389var filtered = compilation.Options.FilterDiagnostic(diagnostic, cancellationToken); 430if (compilation.Options.FilterDiagnostic(diag, cancellationToken) is { } filtered &&
SourceGeneration\Nodes\SharedInputNodes.cs (1)
20public static readonly InputNode<CompilationOptions> CompilationOptions = new(b => ImmutableArray.Create(b.Compilation.Options), ReferenceEqualityComparer.Instance);
Symbols\ISymbolExtensions.cs (1)
107assembly is ISourceAssemblySymbol sourceAssembly && sourceAssembly.Compilation.Options.OutputKind.IsNetModule();
Microsoft.CodeAnalysis.CodeStyle (23)
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (5)
91=> ShouldSkipAnalysis(context.FilterTree, context.Options, context.SemanticModel.Compilation.Options, notification, context.CancellationToken); 94=> ShouldSkipAnalysis(context.Node.SyntaxTree, context.Options, context.Compilation.Options, notification, context.CancellationToken); 100=> ShouldSkipAnalysis(context.FilterTree, context.Options, context.SemanticModel.Compilation.Options, notification, context.CancellationToken); 103=> ShouldSkipAnalysis(context.FilterTree, context.Options, context.Compilation.Options, notification, context.CancellationToken); 106=> ShouldSkipAnalysis(context.FilterTree, context.Options, context.Compilation.Options, notification, context.CancellationToken);
src\Analyzers\Core\Analyzers\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersDiagnosticAnalyzer.cs (1)
32context.RegisterSyntaxTreeAction(treeContext => AnalyzeTree(treeContext, context.Compilation.Options)));
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (1)
40context.RegisterSyntaxTreeAction(treeContext => HandleSyntaxTree(treeContext, context.Compilation.Options)));
src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (1)
32context.RegisterSyntaxTreeAction(treeContext => AnalyzeSyntaxTree(treeContext, context.Compilation.Options)));
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
226|| ShouldSkipAnalysis(location.SourceTree!, options, context.Compilation.Options, option.Notification, cancellationToken))
src\Analyzers\Core\Analyzers\NamingStyle\NamingStyleDiagnosticAnalyzerBase.cs (1)
62|| ShouldSkipAnalysis(sourceTree, symbolContext.Options, symbolContext.Compilation.Options, notification: null, symbolContext.CancellationToken))
src\Analyzers\Core\Analyzers\NewLines\ConsecutiveStatementPlacement\AbstractConsecutiveStatementPlacementDiagnosticAnalyzer.cs (1)
39context.RegisterSyntaxTreeAction(treeContext => AnalyzeTree(treeContext, context.Compilation.Options)));
src\Analyzers\Core\Analyzers\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesDiagnosticAnalyzer.cs (1)
34context.RegisterSyntaxTreeAction(treeContext => AnalyzeTree(treeContext, context.Compilation.Options)));
src\Analyzers\Core\Analyzers\OrderModifiers\AbstractOrderModifiersDiagnosticAnalyzer.cs (1)
38context.RegisterSyntaxTreeAction(treeContext => AnalyzeSyntaxTree(treeContext, context.Compilation.Options)));
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (2)
133if (ShouldSkipAnalysis(tree, context.Options, compilation.Options, notification: null, context.CancellationToken)) 136var effectiveSeverity = _classificationIdDescriptor.GetEffectiveSeverity(compilation.Options, tree, context.Options);
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (5)
93if (!compilationWithAnalyzers.Compilation.Options.ReportSuppressedDiagnostics) 103if (compilationWithAnalyzers.Compilation.Options.SyntaxTreeOptionsProvider != null && 104compilationWithAnalyzers.Compilation.Options.SyntaxTreeOptionsProvider.TryGetDiagnosticValue(tree, IDEDiagnosticIds.RemoveUnnecessarySuppressionDiagnosticId, cancellationToken, out var severity) || 105compilationWithAnalyzers.Compilation.Options.SpecificDiagnosticOptions.TryGetValue(IDEDiagnosticIds.RemoveUnnecessarySuppressionDiagnosticId, out severity)) 454Debug.Assert(semanticModel.Compilation.Options.ReportSuppressedDiagnostics);
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
101context.Compilation.Options,
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
197return preferAutoProps.Value && !ShouldSkipAnalysis(tree, context.Options, context.Compilation.Options, preferAutoProps.Notification, context.CancellationToken);
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (1)
135&& !ShouldSkipAnalysis(context.FilterTree, context.Options, context.Compilation.Options,
Microsoft.CodeAnalysis.CSharp.CodeStyle (12)
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_ProgramMain.cs (1)
18=> IsApplication(compilation.Options);
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_TopLevelStatements.cs (1)
39var mainTypeFullName = compilation.Options.MainTypeName;
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
73if (!option.Value || ShouldSkipAnalysis(declaration.SyntaxTree, context.Options, context.Compilation.Options, option.Notification, cancellationToken))
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
97if (!option.Value || ShouldSkipAnalysis(typeDeclaration.SyntaxTree, context.Options, context.Compilation.Options, option.Notification, cancellationToken))
src\Analyzers\CSharp\Analyzers\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementDiagnosticAnalyzer.cs (1)
33context.RegisterSyntaxTreeAction(treeContext => AnalyzeTree(treeContext, context.Compilation.Options)));
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (1)
33context.RegisterSyntaxTreeAction(treeContext => AnalyzeTree(treeContext, context.Compilation.Options)));
src\Analyzers\CSharp\Analyzers\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementDiagnosticAnalyzer.cs (1)
34context.RegisterSyntaxTreeAction(treeContext => AnalyzeTree(treeContext, context.Compilation.Options)));
src\Analyzers\CSharp\Analyzers\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementDiagnosticAnalyzer.cs (1)
33context.RegisterSyntaxTreeAction(treeContext => AnalyzeTree(treeContext, context.Compilation.Options)));
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (2)
105var compilationOptions = ((CSharpCompilationOptions)context.SemanticModel.Compilation.Options).NullableContextOptions; 329(defaultCompleted, options: ((CSharpCompilationOptions)semanticModel.Compilation.Options).NullableContextOptions, cancellationToken));
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
268|| diagnosticAnalyzer.ShouldSkipAnalysis(reference.SyntaxTree, context.Options, context.Compilation.Options, styleOption.Notification, cancellationToken))
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (1)
110if (!currentOption.Value || ShouldSkipAnalysis(currentSyntaxTree, context.Options, context.Compilation.Options, currentOption.Notification, cancellationToken))
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (1)
CommandLineTests.cs (1)
305var compilerTreeOptions = comp.Options.SyntaxTreeOptionsProvider;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Diagnostics\DiagnosticAnalyzerTests.cs (1)
1830if (compilation.Options.GeneralDiagnosticOption == ReportDiagnostic.Error)
Microsoft.CodeAnalysis.CSharp.Features (14)
Diagnostics\Analyzers\CSharpSimplifyTypeNamesDiagnosticAnalyzer.cs (2)
59if (ShouldSkipAnalysis(context.FilterTree, context.Options, context.SemanticModel.Compilation.Options, GetAllNotifications(options), cancellationToken)) 70if (ShouldSkipAnalysis(context.FilterTree, context.Options, context.SemanticModel.Compilation.Options, GetAllNotifications(options), context.CancellationToken))
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_ProgramMain.cs (1)
18=> IsApplication(compilation.Options);
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_TopLevelStatements.cs (1)
39var mainTypeFullName = compilation.Options.MainTypeName;
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
73if (!option.Value || ShouldSkipAnalysis(declaration.SyntaxTree, context.Options, context.Compilation.Options, option.Notification, cancellationToken))
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
97if (!option.Value || ShouldSkipAnalysis(typeDeclaration.SyntaxTree, context.Options, context.Compilation.Options, option.Notification, cancellationToken))
src\Analyzers\CSharp\Analyzers\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementDiagnosticAnalyzer.cs (1)
33context.RegisterSyntaxTreeAction(treeContext => AnalyzeTree(treeContext, context.Compilation.Options)));
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (1)
33context.RegisterSyntaxTreeAction(treeContext => AnalyzeTree(treeContext, context.Compilation.Options)));
src\Analyzers\CSharp\Analyzers\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementDiagnosticAnalyzer.cs (1)
34context.RegisterSyntaxTreeAction(treeContext => AnalyzeTree(treeContext, context.Compilation.Options)));
src\Analyzers\CSharp\Analyzers\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementDiagnosticAnalyzer.cs (1)
33context.RegisterSyntaxTreeAction(treeContext => AnalyzeTree(treeContext, context.Compilation.Options)));
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (2)
105var compilationOptions = ((CSharpCompilationOptions)context.SemanticModel.Compilation.Options).NullableContextOptions; 329(defaultCompleted, options: ((CSharpCompilationOptions)semanticModel.Compilation.Options).NullableContextOptions, cancellationToken));
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
268|| diagnosticAnalyzer.ShouldSkipAnalysis(reference.SyntaxTree, context.Options, context.Compilation.Options, styleOption.Notification, cancellationToken))
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (1)
110if (!currentOption.Value || ShouldSkipAnalysis(currentSyntaxTree, context.Options, context.Compilation.Options, currentOption.Notification, cancellationToken))
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (5)
SourceGeneration\GeneratorDriverTests.cs (5)
1168var options = ((CSharpCompilationOptions)compilation.Options); 1831var newCompilation = compilation.WithOptions(compilation.Options.WithModuleName("newComp")); 1966Compilation newCompilation = compilation.WithOptions(compilation.Options.WithModuleName("newCompilation")); 2081Compilation newCompilation = compilation.WithOptions(compilation.Options.WithModuleName("newCompilation")); 3369compilation = compilation.WithOptions(compilation.Options.WithModuleName("newName"));
Microsoft.CodeAnalysis.Features (25)
GenerateEqualsAndGetHashCodeFromMembers\AbstractGenerateEqualsAndGetHashCodeService.cs (1)
172if (!compilation.Options.CheckOverflow)
PreferFrameworkType\PreferFrameworkTypeDiagnosticAnalyzerBase.cs (1)
60&& ShouldSkipAnalysis(context.FilterTree, context.Options, context.Compilation.Options,
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (5)
91=> ShouldSkipAnalysis(context.FilterTree, context.Options, context.SemanticModel.Compilation.Options, notification, context.CancellationToken); 94=> ShouldSkipAnalysis(context.Node.SyntaxTree, context.Options, context.Compilation.Options, notification, context.CancellationToken); 100=> ShouldSkipAnalysis(context.FilterTree, context.Options, context.SemanticModel.Compilation.Options, notification, context.CancellationToken); 103=> ShouldSkipAnalysis(context.FilterTree, context.Options, context.Compilation.Options, notification, context.CancellationToken); 106=> ShouldSkipAnalysis(context.FilterTree, context.Options, context.Compilation.Options, notification, context.CancellationToken);
src\Analyzers\Core\Analyzers\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersDiagnosticAnalyzer.cs (1)
32context.RegisterSyntaxTreeAction(treeContext => AnalyzeTree(treeContext, context.Compilation.Options)));
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (1)
40context.RegisterSyntaxTreeAction(treeContext => HandleSyntaxTree(treeContext, context.Compilation.Options)));
src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (1)
32context.RegisterSyntaxTreeAction(treeContext => AnalyzeSyntaxTree(treeContext, context.Compilation.Options)));
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
226|| ShouldSkipAnalysis(location.SourceTree!, options, context.Compilation.Options, option.Notification, cancellationToken))
src\Analyzers\Core\Analyzers\NamingStyle\NamingStyleDiagnosticAnalyzerBase.cs (1)
62|| ShouldSkipAnalysis(sourceTree, symbolContext.Options, symbolContext.Compilation.Options, notification: null, symbolContext.CancellationToken))
src\Analyzers\Core\Analyzers\NewLines\ConsecutiveStatementPlacement\AbstractConsecutiveStatementPlacementDiagnosticAnalyzer.cs (1)
39context.RegisterSyntaxTreeAction(treeContext => AnalyzeTree(treeContext, context.Compilation.Options)));
src\Analyzers\Core\Analyzers\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesDiagnosticAnalyzer.cs (1)
34context.RegisterSyntaxTreeAction(treeContext => AnalyzeTree(treeContext, context.Compilation.Options)));
src\Analyzers\Core\Analyzers\OrderModifiers\AbstractOrderModifiersDiagnosticAnalyzer.cs (1)
38context.RegisterSyntaxTreeAction(treeContext => AnalyzeSyntaxTree(treeContext, context.Compilation.Options)));
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (2)
133if (ShouldSkipAnalysis(tree, context.Options, compilation.Options, notification: null, context.CancellationToken)) 136var effectiveSeverity = _classificationIdDescriptor.GetEffectiveSeverity(compilation.Options, tree, context.Options);
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (5)
93if (!compilationWithAnalyzers.Compilation.Options.ReportSuppressedDiagnostics) 103if (compilationWithAnalyzers.Compilation.Options.SyntaxTreeOptionsProvider != null && 104compilationWithAnalyzers.Compilation.Options.SyntaxTreeOptionsProvider.TryGetDiagnosticValue(tree, IDEDiagnosticIds.RemoveUnnecessarySuppressionDiagnosticId, cancellationToken, out var severity) || 105compilationWithAnalyzers.Compilation.Options.SpecificDiagnosticOptions.TryGetValue(IDEDiagnosticIds.RemoveUnnecessarySuppressionDiagnosticId, out severity)) 454Debug.Assert(semanticModel.Compilation.Options.ReportSuppressedDiagnostics);
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
101context.Compilation.Options,
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
197return preferAutoProps.Value && !ShouldSkipAnalysis(tree, context.Options, context.Compilation.Options, preferAutoProps.Notification, context.CancellationToken);
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (1)
135&& !ShouldSkipAnalysis(context.FilterTree, context.Options, context.Compilation.Options,
Microsoft.CodeAnalysis.Rebuild.UnitTests (5)
RebuildCommandLineTests.cs (1)
111RoundTripUtil.VerifyCompilationOptions(commonCompiler.Arguments.CompilationOptions, compilation.Options);
RoundTripUtil.cs (4)
72Assert.True(original.Options.Deterministic); 83var assemblyFileExtension = original.Options.OutputKind switch 98VerifyCompilationOptions(original.Options, rebuild.Options);
Microsoft.CodeAnalysis.Scripting.UnitTests (3)
ScriptOptionsTests.cs (3)
247Assert.Equal(scriptOptions.CheckOverflow, compilation.Options.CheckOverflow); 275Assert.Equal(scriptOptions.OptimizationLevel, compilation.Options.OptimizationLevel); 312Assert.Equal(scriptOptions.WarningLevel, compilation.Options.WarningLevel);
Microsoft.CodeAnalysis.Test.Utilities (16)
CommonTestBase.cs (3)
92(compilation.Options.OutputKind == OutputKind.ConsoleApplication || compilation.Options.OutputKind == OutputKind.WindowsApplication), 170var moduleSymbol = verifier.GetSymbolFromMetadata(reference, verifier.Compilation.Options.MetadataImportOptions);
Compilation\CompilationExtensions.cs (2)
64if (pdbStream == null && compilation.Options.OptimizationLevel == OptimizationLevel.Debug && options?.DebugInformationFormat != DebugInformationFormat.Embedded) 130if (comp.Options.OutputKind == OutputKind.NetModule)
CompilationVerifier.cs (3)
66if (_compilation.Options.OutputKind.IsNetModule()) 659var targetReference = LoadTestEmittedExecutableForSymbolValidation(EmittedAssemblyData, _compilation.Options.OutputKind, display: _compilation.AssemblyName); 694.WithOptions(_compilation.Options.WithMetadataImportOptions(importOptions));
Diagnostics\CommonDiagnosticAnalyzers.cs (1)
1147Assert.True(context.Compilation.Options.ConcurrentBuild, "This analyzer is intended to be used only when concurrent build is enabled.");
Diagnostics\DiagnosticExtensions.cs (6)
213if (c.Options.GeneralDiagnosticOption == ReportDiagnostic.Default && 214c.Options.SpecificDiagnosticOptions.IsEmpty) 234var toggledOption = c.Options.GeneralDiagnosticOption == ReportDiagnostic.Error ? 237c = (TCompilation)c.WithOptions(c.Options.WithGeneralDiagnosticOption(toggledOption)); 307if (reportSuppressedDiagnostics != c.Options.ReportSuppressedDiagnostics) 309c = (TCompilation)c.WithOptions(c.Options.WithReportSuppressedDiagnostics(reportSuppressedDiagnostics));
Platform\Desktop\DesktopRuntimeEnvironment.cs (1)
223mainCompilation.Options.OutputKind,
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (1)
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicCommonGenerationServiceMethods.vb (1)
20Dim options = TryCast(semanticModel.Compilation.Options, VisualBasicCompilationOptions)
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (4)
CommandLineTests.vb (4)
133Dim syntaxTreeOptions = comp.Options.SyntaxTreeOptionsProvider 390Assert.IsType(Of DesktopStrongNameProvider)(comp.Options.StrongNameProvider) 409Assert.True(TypeOf comp.Options.StrongNameProvider Is DesktopStrongNameProvider) 428Assert.True(TypeOf comp.Options.StrongNameProvider Is DesktopStrongNameProvider)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (2)
Attributes\InternalsVisibleToAndStrongNameTests.vb (2)
1956Assert.True(compilation.Options.PublicSign) 1957Assert.Null(compilation.Options.DelaySign)
Microsoft.CodeAnalysis.VisualBasic.Features (4)
Debugging\LocationInfoGetter.vb (1)
34Dim options = CType(compilation.Options, VisualBasicCompilationOptions)
Diagnostics\Analyzers\VisualBasicSimplifyTypeNamesDiagnosticAnalyzer.vb (2)
45If (ShouldSkipAnalysis(context.FilterTree, context.Options, context.SemanticModel.Compilation.Options, GetAllNotifications(simplifierOptions), cancellationToken)) Then 56If (ShouldSkipAnalysis(context.FilterTree, context.Options, context.SemanticModel.Compilation.Options, GetAllNotifications(simplifierOptions), context.CancellationToken)) Then
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicCommonGenerationServiceMethods.vb (1)
20Dim options = TryCast(semanticModel.Compilation.Options, VisualBasicCompilationOptions)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (5)
Diagnostics\DiagnosticAnalyzerTests.vb (1)
1291If compilation.Options.GeneralDiagnosticOption = ReportDiagnostic.Error Then
SourceGeneration\GeneratorDriverTests.vb (4)
197VerifyDiagnosticsWithOptions(gen, compilation.WithOptions(compilation.Options.WithSpecificDiagnosticOptions(warnings)), 202VerifyDiagnosticsWithOptions(gen, compilation.WithOptions(compilation.Options.WithSpecificDiagnosticOptions(warnings)), 207VerifyDiagnosticsWithOptions(gen, compilation.WithOptions(compilation.Options.WithSpecificDiagnosticOptions(warnings)), 213VerifyDiagnosticsWithOptions(gen, compilation.WithOptions(compilation.Options.WithSpecificDiagnosticOptions(warnings)),
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (11)
NetCoreTests.cs (1)
512var option = compilation.Options as VisualBasicCompilationOptions;
VisualStudioMSBuildWorkspaceTests.cs (10)
492Assert.Equal(Platform.AnyCpu, compilation.Options.Platform); 507Assert.Equal(Platform.AnyCpu, compilation.Options.Platform); 521Assert.Equal(Platform.AnyCpu32BitPreferred, compilation.Options.Platform); 536Assert.Equal(Platform.AnyCpu, compilation.Options.Platform); 551Assert.Equal(Platform.AnyCpu, compilation.Options.Platform); 616Assert.Equal(Platform.AnyCpu, compilation.Options.Platform); 631Assert.Equal(Platform.AnyCpu, compilation.Options.Platform); 645Assert.Equal(Platform.AnyCpu32BitPreferred, compilation.Options.Platform); 660Assert.Equal(Platform.AnyCpu, compilation.Options.Platform); 675Assert.Equal(Platform.AnyCpu, compilation.Options.Platform);
Microsoft.CodeAnalysis.Workspaces.UnitTests (8)
SolutionTests\SolutionTests.cs (8)
339var provider = compilation.Options.SyntaxTreeOptionsProvider!; 2848Assert.Equal(project.CompilationOptions, compilation.Options); 4696Assert.NotEqual(originalCompilation.Options, newCompilation.Options); 4768Assert.Equal(provider, (await project.GetCompilationAsync()).Options.SyntaxTreeOptionsProvider); 4781Assert.Equal(provider, (await project.GetCompilationAsync()).Options.SyntaxTreeOptionsProvider); 4863Assert.NotEqual(originalCompilation.Options, newCompilation.Options);
Microsoft.Interop.ComInterfaceGenerator (2)
ComClassGenerator.cs (1)
21var unsafeCodeIsEnabled = context.CompilationProvider.Select((comp, ct) => comp.Options is CSharpCompilationOptions { AllowUnsafe: true }); // Unsafe code enabled
ComInterfaceInfo.cs (1)
57if (env.Compilation.Options is not CSharpCompilationOptions { AllowUnsafe: true }) // Unsafe code enabled
Microsoft.Interop.JavaScript.JSImportGenerator (2)
JSExportGenerator.cs (1)
67|| data.Left.Compilation.Options is CSharpCompilationOptions { AllowUnsafe: true }) // Unsafe code enabled
JSImportGenerator.cs (1)
65|| data.Left.Compilation.Options is CSharpCompilationOptions { AllowUnsafe: true }) // Unsafe code enabled
Microsoft.Interop.LibraryImportGenerator (1)
LibraryImportGenerator.cs (1)
73.Select((comp, ct) => comp.Options is CSharpCompilationOptions { AllowUnsafe: true })
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
CodeModel\VisualBasicCodeModelService.vb (1)
686Dim rootNamespace = DirectCast(compilation.Options, VisualBasicCompilationOptions).RootNamespace
System.Windows.Forms.Analyzers.CSharp (1)
System\Windows\Forms\CSharp\Generators\ApplicationConfiguration\ApplicationConfigurationGenerator.cs (1)
75=> compilation.Options.OutputKind);