68 references to CompilationOptions
AnalyzerRunner (2)
DiagnosticAnalyzerRunner.cs (2)
49var modifiedSpecificDiagnosticOptions = project.CompilationOptions.SpecificDiagnosticOptions 52var modifiedCompilationOptions = project.CompilationOptions.WithSpecificDiagnosticOptions(modifiedSpecificDiagnosticOptions);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Analyzers\CSharp\CodeFixes\UpdateProjectToAllowUnsafe\CSharpUpdateProjectToAllowUnsafeCodeFixProvider.cs (1)
41var compilationOptions = (CSharpCompilationOptions?)project.CompilationOptions;
Microsoft.CodeAnalysis.CSharp.Features (3)
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (2)
65CompilationOptions.NullableContextOptions: NullableContextOptions.Disable, 89var compilationOptions = (CSharpCompilationOptions)project.CompilationOptions!;
src\Analyzers\CSharp\CodeFixes\UpdateProjectToAllowUnsafe\CSharpUpdateProjectToAllowUnsafeCodeFixProvider.cs (1)
41var compilationOptions = (CSharpCompilationOptions?)project.CompilationOptions;
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (2)
Diagnostics\Suppression\SuppressionTests.cs (2)
759var compilationOptions = solution.Projects.Single().CompilationOptions; 1001var compilationOptions = solution.Projects.Single().CompilationOptions;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
Diagnostics\DiagnosticAnalyzerServiceTests.cs (2)
341var newSpecificOptions = project.CompilationOptions.SpecificDiagnosticOptions.Add(NamedTypeAnalyzer.DiagnosticId, ReportDiagnostic.Warn); 342project = project.WithCompilationOptions(project.CompilationOptions.WithSpecificDiagnosticOptions(newSpecificOptions));
Microsoft.CodeAnalysis.Features (8)
Completion\Providers\Scripting\AbstractDirectivePathCompletionProvider.cs (1)
167if (document.Project.CompilationOptions?.MetadataReferenceResolver is RuntimeMetadataReferenceResolver resolver)
Completion\Providers\Scripting\AbstractReferenceDirectiveCompletionProvider.cs (1)
51var resolver = context.Document.Project.CompilationOptions.MetadataReferenceResolver as RuntimeMetadataReferenceResolver;
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (2)
438!object.Equals(oldProject.CompilationOptions, newProject.CompilationOptions) ||
ExtractInterface\AbstractExtractInterfaceService.cs (1)
153var containingNamespaceDisplay = GetContainingNamespaceDisplay(refactoringResult.TypeToExtractFrom, refactoringResult.DocumentToExtractFrom.Project.CompilationOptions);
GenerateType\AbstractGenerateTypeService.Editor.cs (3)
207var rootNamespace = targetLanguageService.GetRootNamespace(targetProject.CompilationOptions).Trim(); 497? _service.GetRootNamespace(_generateTypeOptionsResult.Project.CompilationOptions).Trim() 498: _targetLanguageService.GetRootNamespace(_generateTypeOptionsResult.Project.CompilationOptions).Trim();
Microsoft.CodeAnalysis.LanguageServer (1)
LanguageServer\Handler\DebugConfiguration\WorkspaceDebugConfigurationHandler.cs (1)
48var isExe = project.CompilationOptions?.OutputKind is OutputKind.ConsoleApplication or OutputKind.WindowsApplication;
Microsoft.CodeAnalysis.LanguageServer.Protocol (3)
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (1)
214var options = project.CompilationOptions;
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_IncrementalAnalyzer.cs (2)
137if (project.CompilationOptions is null) 147return descriptors.Any(static (d, arg) => d.GetEffectiveSeverity(arg.CompilationOptions, arg.isHostAnalyzer ? arg.analyzerConfigOptions?.ConfigOptionsWithFallback : arg.analyzerConfigOptions?.ConfigOptionsWithoutFallback, arg.analyzerConfigOptions?.TreeOptions) != ReportDiagnostic.Hidden, (project.CompilationOptions, isHostAnalyzer, analyzerConfigOptions));
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (1)
CodeGeneration\AddImportsTests.vb (1)
43project = project.WithCompilationOptions(DirectCast(project.CompilationOptions, VisualBasicCompilationOptions).WithGlobalImports(gi))
Microsoft.CodeAnalysis.Workspaces (16)
Diagnostics\DiagnosticData.cs (1)
291var reportDiagnostic = descriptor.GetEffectiveSeverity(project.CompilationOptions!);
FindSymbols\FindReferences\DependentProjectsFinder.cs (1)
403.CreateCompilation(project.AssemblyName, project.CompilationOptions!)
Workspace\Workspace.cs (14)
1654projectChanges.OldProject.CompilationOptions != projectChanges.NewProject.CompilationOptions) 1660Contract.ThrowIfNull(projectChanges.OldProject.CompilationOptions); 1661Contract.ThrowIfNull(projectChanges.NewProject.CompilationOptions); 1668projectChanges.NewProject.CompilationOptions.WithSyntaxTreeOptionsProvider( 1669projectChanges.OldProject.CompilationOptions.SyntaxTreeOptionsProvider); 1671if (projectChanges.OldProject.CompilationOptions != newOptionsWithoutSyntaxTreeOptionsChange) 1677if (!CanApplyCompilationOptionChange(projectChanges.OldProject.CompilationOptions, newOptionsWithoutSyntaxTreeOptionsChange, projectChanges.NewProject)) 1788/// Called during a call to <see cref="TryApplyChanges(Solution)"/> to determine if a specific change to <see cref="Project.CompilationOptions"/> is allowed. 1829projectChanges.NewProject.CompilationOptions?.WithSyntaxTreeOptionsProvider( 1830projectChanges.OldProject.CompilationOptions!.SyntaxTreeOptionsProvider); 1831if (projectChanges.OldProject.CompilationOptions != newOptionsWithoutSyntaxTreeOptionsChange) 1999project.CompilationOptions, 2059CanApplyCompilationOptionChange(oldProject.CompilationOptions!, options, newProjectForAssert));
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (4)
MSBuildWorkspaceTestBase.cs (2)
62return (CS.CSharpCompilationOptions)project.CompilationOptions; 80return (VB.VisualBasicCompilationOptions)project.CompilationOptions;
VisualStudioMSBuildWorkspaceTests.cs (2)
411var solution2 = solution1.WithProjectCompilationOptions(project.Id, project.CompilationOptions.WithOutputKind(OutputKind.NetModule)); 1837var options = (VB.VisualBasicCompilationOptions)project.CompilationOptions;
Microsoft.CodeAnalysis.Workspaces.UnitTests (16)
CommandLineProject\CommandLineProjectWorkspaceTests.cs (2)
34Assert.Equal(OutputKind.DynamicallyLinkedLibrary, project.CompilationOptions.OutputKind); 62Assert.Equal(OutputKind.DynamicallyLinkedLibrary, project.CompilationOptions.OutputKind);
SolutionTests\SolutionTests.cs (11)
1742var originalSyntaxTreeOptionsProvider = solution.Projects.Single().CompilationOptions!.SyntaxTreeOptionsProvider; 1752var newSyntaxTreeOptionsProvider = solution.Projects.Single().CompilationOptions!.SyntaxTreeOptionsProvider; 2848Assert.Equal(project.CompilationOptions, compilation.Options); 4698var provider = project.CompilationOptions.SyntaxTreeOptionsProvider; 4727var provider = project.CompilationOptions.SyntaxTreeOptionsProvider; 4736provider = project.CompilationOptions.SyntaxTreeOptionsProvider; 4767var provider = project.CompilationOptions.SyntaxTreeOptionsProvider; 4780provider = project.CompilationOptions.SyntaxTreeOptionsProvider; 4801var originalProvider = solution.GetProject(projectId).CompilationOptions.SyntaxTreeOptionsProvider; 4812var newProvider = solution.GetProject(projectId).CompilationOptions.SyntaxTreeOptionsProvider; 4817var finalProvider = solution.GetProject(projectId).CompilationOptions.SyntaxTreeOptionsProvider;
SolutionTests\TryApplyChangesTests.cs (3)
79Assert.True(workspace.TryApplyChanges(project.WithCompilationOptions(project.CompilationOptions!.WithMainTypeName("Test")).Solution)); 92Assert.True(workspace.TryApplyChanges(project.WithCompilationOptions(project.CompilationOptions!.WithMainTypeName("Test")).Solution)); 106() => workspace.TryApplyChanges(project.WithCompilationOptions(project.CompilationOptions!.WithMainTypeName("WrongThing")).Solution));
Microsoft.Interop.ComInterfaceGenerator (2)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (2)
127bool enableUnsafe = doc.Project.CompilationOptions is CSharpCompilationOptions { AllowUnsafe: false }; 229return solution.WithProjectCompilationOptions(project.Id, ((CSharpCompilationOptions)project.CompilationOptions).WithAllowUnsafe(true));
Microsoft.Interop.LibraryImportGenerator (2)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (2)
127bool enableUnsafe = doc.Project.CompilationOptions is CSharpCompilationOptions { AllowUnsafe: false }; 229return solution.WithProjectCompilationOptions(project.Id, ((CSharpCompilationOptions)project.CompilationOptions).WithAllowUnsafe(true));
Microsoft.ML.CodeAnalyzer.Tests (2)
Code\BestFriendTest.cs (1)
70projectA = projectA.WithCompilationOptions(projectA.CompilationOptions.WithOutputKind(OutputKind.DynamicallyLinkedLibrary));
Code\RelaxTestNamingTest.cs (1)
24var compilationOptions = solution.GetProject(projectId).CompilationOptions;
Microsoft.VisualStudio.LanguageServices (1)
Interactive\VsResetInteractive.cs (1)
161platform = (projectOpt != null) ? GetInteractiveHostPlatform(targetFrameworkMoniker, projectOpt.CompilationOptions.Platform) : null;
Roslyn.VisualStudio.Next.UnitTests (1)
Services\SolutionServiceTests.cs (1)
311project = project.WithCompilationOptions(project.CompilationOptions.WithModuleName("modified"));
System.Windows.Forms.Analyzers.CSharp.Tests (1)
Analyzers\Verifiers\CSharpIncrementalSourceGeneratorVerifier.cs (1)
20var compilationOptions = solution.GetProject(projectId)!.CompilationOptions;