5 writes to SpecificDiagnosticOptions
Microsoft.CodeAnalysis (1)
Compilation\CompilationOptions.cs (1)
309this.SpecificDiagnosticOptions = specificDiagnosticOptions;
Microsoft.CodeAnalysis.CSharp (2)
CSharpCompilationOptions.cs (2)
476return new CSharpCompilationOptions(this) { SpecificDiagnosticOptions = values }; 480new CSharpCompilationOptions(this) { SpecificDiagnosticOptions = values.ToImmutableDictionaryOrEmpty() };
Microsoft.CodeAnalysis.VisualBasic (2)
VisualBasicCompilationOptions.vb (2)
863Return New VisualBasicCompilationOptions(Me) With {.SpecificDiagnosticOptions = value} 872Return New VisualBasicCompilationOptions(Me) With {.SpecificDiagnosticOptions = value.ToImmutableDictionaryOrEmpty()}
111 references to SpecificDiagnosticOptions
AnalyzerRunner (1)
DiagnosticAnalyzerRunner.cs (1)
49var modifiedSpecificDiagnosticOptions = project.CompilationOptions.SpecificDiagnosticOptions
BuildActionTelemetryTable (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (2)
45(!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) || 70if (!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) ||
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (1)
CSharpCompilerTest.cs (1)
98Assert.Collection(compilationOptions.SpecificDiagnosticOptions.OrderBy(d => d.Key),
Microsoft.CodeAnalysis (11)
Compilation\CompilationOptions.cs (3)
642this.SpecificDiagnosticOptions.SequenceEqual(other.SpecificDiagnosticOptions, (left, right) => (left.Key == right.Key) && (left.Value == right.Value)) && 689Hash.Combine(Hash.CombineValues(this.SpecificDiagnosticOptions),
Compilation\DeterministicKeyBuilder.cs (2)
463foreach (var key in options.SpecificDiagnosticOptions.Keys.OrderBy(StringComparer.Ordinal)) 466writer.Write(key, options.SpecificDiagnosticOptions[key]);
Diagnostic\SuppressionDescriptor.cs (1)
109return compilationOptions.SpecificDiagnosticOptions.TryGetValue(Id, out var reportDiagnostic) &&
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
953if (compilation.Options.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var severity) ||
DiagnosticAnalyzer\AnalyzerManager.cs (1)
357var diagnosticOptions = options.SpecificDiagnosticOptions;
DiagnosticAnalyzer\AnalyzerOptionsExtensions.cs (1)
53if (compilation.Options.SpecificDiagnosticOptions.ContainsKey(descriptor.Id) ||
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (2)
1152/// 1) <see cref="CompilationOptions.SpecificDiagnosticOptions"/> specified for the given <paramref name="compilation"/>. 1162/// 1) <see cref="CompilationOptions.SpecificDiagnosticOptions"/> specified for the given <paramref name="compilation"/>.
Microsoft.CodeAnalysis.CodeStyle (3)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
105compilationWithAnalyzers.Compilation.Options.SpecificDiagnosticOptions.TryGetValue(IDEDiagnosticIds.RemoveUnnecessarySuppressionDiagnosticId, out severity))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (2)
45(!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) || 70if (!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) ||
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (3)
src\Features\DiagnosticsTestUtilities\CodeActions\CSharpCodeFixVerifier`2+Test.cs (1)
104return compilationOptions.WithSpecificDiagnosticOptions(compilationOptions.SpecificDiagnosticOptions.SetItems(CSharpVerifierHelper.NullableWarnings));
src\Features\DiagnosticsTestUtilities\CodeActions\CSharpCodeRefactoringVerifier`1+Test.cs (1)
112return compilationOptions.WithSpecificDiagnosticOptions(compilationOptions.SpecificDiagnosticOptions.SetItems(CSharpVerifierHelper.NullableWarnings));
src\Features\DiagnosticsTestUtilities\CodeActions\CSharpVerifierHelper.cs (1)
28var nullableWarnings = commandLineArguments.CompilationOptions.SpecificDiagnosticOptions;
Microsoft.CodeAnalysis.CSharp (4)
CSharpCompilationOptions.cs (3)
247specificDiagnosticOptions: other.SpecificDiagnosticOptions, 471if (this.SpecificDiagnosticOptions == values) 768SpecificDiagnosticOptions,
Errors\MessageProvider.cs (1)
133options.SpecificDiagnosticOptions,
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (2)
Diagnostics\DiagnosticSuppressorTests.cs (2)
313var specificDiagnosticOptions = compilation.Options.SpecificDiagnosticOptions.Add(suppressionId, ReportDiagnostic.Suppress); 328var originalSpecificDiagnosticOptions = compilation.Options.SpecificDiagnosticOptions;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (5)
Compilation\CSharpCompilationOptionsTests.cs (4)
86TestHiddenProperty((old, value) => old.WithSpecificDiagnosticOptions(value), opt => opt.SpecificDiagnosticOptions, 125TestProperty((old, value) => old.WithSpecificDiagnosticOptions(value), opt => opt.SpecificDiagnosticOptions, 235Assert.Equal(3, new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithSpecificDiagnosticOptions(warnings).SpecificDiagnosticOptions.Count); 237Assert.Equal(0, new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithSpecificDiagnosticOptions(null).SpecificDiagnosticOptions.Count);
Compilation\UsedAssembliesTests.cs (1)
295options = options.WithSpecificDiagnosticOptions(options.SpecificDiagnosticOptions.Add("CS1591", ReportDiagnostic.Suppress));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Diagnostics\DiagnosticAnalyzerServiceTests.cs (1)
341var newSpecificOptions = project.CompilationOptions.SpecificDiagnosticOptions.Add(NamedTypeAnalyzer.DiagnosticId, ReportDiagnostic.Warn);
Microsoft.CodeAnalysis.Features (1)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
105compilationWithAnalyzers.Compilation.Options.SpecificDiagnosticOptions.TryGetValue(IDEDiagnosticIds.RemoveUnnecessarySuppressionDiagnosticId, out severity))
Microsoft.CodeAnalysis.Test.Utilities (2)
Diagnostics\DiagnosticExtensions.cs (2)
214c.Options.SpecificDiagnosticOptions.IsEmpty) 334/// 1) <see cref="CompilationOptions.SpecificDiagnosticOptions"/> specified for the given <paramref name="compilation"/>.
Microsoft.CodeAnalysis.VisualBasic (4)
Errors\MessageProvider.vb (1)
124options.SpecificDiagnosticOptions,
VisualBasicCompilationOptions.vb (3)
320specificDiagnosticOptions:=other.SpecificDiagnosticOptions, 859If value Is Me.SpecificDiagnosticOptions Then 1137SpecificDiagnosticOptions,
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (31)
CommandLineTests.vb (31)
2842Assert.True(parsedArgs.CompilationOptions.SpecificDiagnosticOptions.ContainsKey("CA1012")) 2843Assert.True(parsedArgs.CompilationOptions.SpecificDiagnosticOptions("CA1012") = ReportDiagnostic.Error) 2844Assert.True(parsedArgs.CompilationOptions.SpecificDiagnosticOptions.ContainsKey("CA1013")) 2845Assert.True(parsedArgs.CompilationOptions.SpecificDiagnosticOptions("CA1013") = ReportDiagnostic.Warn) 2846Assert.True(parsedArgs.CompilationOptions.SpecificDiagnosticOptions.ContainsKey("CA1014")) 2847Assert.True(parsedArgs.CompilationOptions.SpecificDiagnosticOptions("CA1014") = ReportDiagnostic.Suppress) 5788Dim actualOrdered = args.CompilationOptions.SpecificDiagnosticOptions.OrderBy(Function(entry) entry.Key) 8722Assert.Equal(expected:=0, actual:=arguments.CompilationOptions.SpecificDiagnosticOptions.Count) 8742Assert.Equal(expected:=1, actual:=arguments.CompilationOptions.SpecificDiagnosticOptions.Count) 8743Assert.Equal(expected:=ReportDiagnostic.Error, actual:=arguments.CompilationOptions.SpecificDiagnosticOptions("Test001")) 8763Assert.Equal(expected:=1, actual:=arguments.CompilationOptions.SpecificDiagnosticOptions.Count) 8764Assert.Equal(expected:=ReportDiagnostic.Info, actual:=arguments.CompilationOptions.SpecificDiagnosticOptions("Test001")) 8784Assert.Equal(expected:=1, actual:=arguments.CompilationOptions.SpecificDiagnosticOptions.Count) 8785Assert.Equal(expected:=ReportDiagnostic.Error, actual:=arguments.CompilationOptions.SpecificDiagnosticOptions("Test001")) 8805Assert.Equal(expected:=1, actual:=arguments.CompilationOptions.SpecificDiagnosticOptions.Count) 8806Assert.Equal(expected:=ReportDiagnostic.Warn, actual:=arguments.CompilationOptions.SpecificDiagnosticOptions("Test001")) 8826Assert.Equal(expected:=1, actual:=arguments.CompilationOptions.SpecificDiagnosticOptions.Count) 8827Assert.Equal(expected:=ReportDiagnostic.Warn, actual:=arguments.CompilationOptions.SpecificDiagnosticOptions("Test001")) 8847Assert.Equal(expected:=2, actual:=arguments.CompilationOptions.SpecificDiagnosticOptions.Count) 8848Assert.Equal(expected:=ReportDiagnostic.Warn, actual:=arguments.CompilationOptions.SpecificDiagnosticOptions("Test001")) 8849Assert.Equal(expected:=ReportDiagnostic.Default, actual:=arguments.CompilationOptions.SpecificDiagnosticOptions("Test002")) 8869Assert.Equal(expected:=1, actual:=arguments.CompilationOptions.SpecificDiagnosticOptions.Count) 8870Assert.Equal(expected:=ReportDiagnostic.Error, actual:=arguments.CompilationOptions.SpecificDiagnosticOptions("Test001")) 8890Assert.Equal(expected:=1, actual:=arguments.CompilationOptions.SpecificDiagnosticOptions.Count) 8891Assert.Equal(expected:=ReportDiagnostic.Warn, actual:=arguments.CompilationOptions.SpecificDiagnosticOptions("Test001")) 8913Assert.Equal(expected:=3, actual:=arguments.CompilationOptions.SpecificDiagnosticOptions.Count) 8914Assert.Equal(expected:=ReportDiagnostic.Error, actual:=arguments.CompilationOptions.SpecificDiagnosticOptions("Test001")) 8915Assert.Equal(expected:=ReportDiagnostic.Suppress, actual:=arguments.CompilationOptions.SpecificDiagnosticOptions("Test002")) 8916Assert.Equal(expected:=ReportDiagnostic.Suppress, actual:=arguments.CompilationOptions.SpecificDiagnosticOptions("Test003")) 8936Assert.Equal(expected:=1, actual:=arguments.CompilationOptions.SpecificDiagnosticOptions.Count) 8937Assert.Equal(expected:=ReportDiagnostic.Suppress, actual:=arguments.CompilationOptions.SpecificDiagnosticOptions("Test001"))
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
Compilation\VisualBasicCompilationOptionsTests.vb (1)
398Assert.Equal(0, New VisualBasicCompilationOptions(OutputKind.ConsoleApplication).WithSpecificDiagnosticOptions(Nothing).SpecificDiagnosticOptions.Count)
Microsoft.CodeAnalysis.Workspaces (4)
Serialization\AbstractOptionsSerializationService.cs (2)
54writer.WriteInt32(options.SpecificDiagnosticOptions.Count); 55foreach (var kv in options.SpecificDiagnosticOptions.OrderBy(o => o.Key))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (2)
45(!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) || 70if (!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) ||
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Workspaces\TestWorkspace_XmlCreation.cs (1)
145Contract.ThrowIfFalse(options.SpecificDiagnosticOptions.IsEmpty);
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (11)
ProjectSystemShim\CPS\CSharpCompilerOptionsTests.cs (2)
51Assert.Equal(expected: ReportDiagnostic.Error, actual: options.SpecificDiagnosticOptions["CS1111"]); 55Assert.False(options.SpecificDiagnosticOptions.ContainsKey("CS1111"));
ProjectSystemShim\LegacyProject\AnalyzersTests.cs (7)
112var ca1012DiagnosticOption = options.SpecificDiagnosticOptions["CA1012"]; 136var ca1014DiagnosticOption = options.SpecificDiagnosticOptions["CS1014"]; 178Assert.Equal(expected: ReportDiagnostic.Error, actual: options.SpecificDiagnosticOptions["CS1014"]); 182Assert.Equal(expected: ReportDiagnostic.Suppress, actual: options.SpecificDiagnosticOptions["CS1014"]); 186Assert.Equal(expected: ReportDiagnostic.Error, actual: options.SpecificDiagnosticOptions["CS1014"]); 190Assert.Equal(expected: ReportDiagnostic.Suppress, actual: options.SpecificDiagnosticOptions["CS1014"]); 216var ca1014DiagnosticOption = options.SpecificDiagnosticOptions["CS1014"];
ProjectSystemShim\LegacyProject\CSharpCompilerOptionsTests.cs (2)
96Assert.Equal(expected: ReportDiagnostic.Error, actual: options.SpecificDiagnosticOptions["CS1111"]); 100Assert.False(options.SpecificDiagnosticOptions.ContainsKey("CS1111"));
Microsoft.VisualStudio.LanguageServices.UnitTests (20)
ProjectSystemShim\ConvertedVisualBasicProjectOptionsTests.vb (18)
28Assert.Equal(expected:=0, actual:=convertedOptions.SpecificDiagnosticOptions.Count) 41Assert.Equal(expected:=1, actual:=convertedOptions.SpecificDiagnosticOptions.Count) 42Assert.Equal(expected:=ReportDiagnostic.Error, actual:=convertedOptions.SpecificDiagnosticOptions("Test001")) 55Assert.Equal(expected:=1, actual:=convertedOptions.SpecificDiagnosticOptions.Count) 56Assert.Equal(expected:=ReportDiagnostic.Info, actual:=convertedOptions.SpecificDiagnosticOptions("Test001")) 72Assert.Equal(expected:=1, actual:=convertedOptions.SpecificDiagnosticOptions.Count) 73Assert.Equal(expected:=ReportDiagnostic.Error, actual:=convertedOptions.SpecificDiagnosticOptions("Test001")) 89Assert.Equal(expected:=1, actual:=convertedOptions.SpecificDiagnosticOptions.Count) 90Assert.Equal(expected:=ReportDiagnostic.Warn, actual:=convertedOptions.SpecificDiagnosticOptions("Test001")) 106Assert.Equal(expected:=2, actual:=convertedOptions.SpecificDiagnosticOptions.Count) 107Assert.Equal(expected:=ReportDiagnostic.Warn, actual:=convertedOptions.SpecificDiagnosticOptions("Test001")) 108Assert.Equal(expected:=ReportDiagnostic.Default, actual:=convertedOptions.SpecificDiagnosticOptions("Test002")) 125Assert.Equal(expected:=3, actual:=convertedOptions.SpecificDiagnosticOptions.Count) 126Assert.Equal(expected:=ReportDiagnostic.Error, actual:=convertedOptions.SpecificDiagnosticOptions("Test001")) 127Assert.Equal(expected:=ReportDiagnostic.Suppress, actual:=convertedOptions.SpecificDiagnosticOptions("Test002")) 128Assert.Equal(expected:=ReportDiagnostic.Suppress, actual:=convertedOptions.SpecificDiagnosticOptions("Test003")) 144Assert.Equal(expected:=1, actual:=convertedOptions.SpecificDiagnosticOptions.Count) 145Assert.Equal(expected:=ReportDiagnostic.Suppress, actual:=convertedOptions.SpecificDiagnosticOptions("Test001"))
ProjectSystemShim\VisualBasicCompilerOptionsTests.vb (2)
191Assert.Equal(ReportDiagnostic.Error, options.SpecificDiagnosticOptions("BC1234")) 199Assert.False(options.SpecificDiagnosticOptions.ContainsKey("BC1234"))
Mvc.Api.Analyzers.Test (1)
ApiConventionAnalyzerIntegrationTest.cs (1)
311var specificDiagnosticOptions = compilationOptions.SpecificDiagnosticOptions.Add(
System.Windows.Forms.Analyzers.CSharp.Tests (2)
Analyzers\Verifiers\CSharpIncrementalSourceGeneratorVerifier.cs (1)
23compilationOptions.SpecificDiagnosticOptions.SetItems(CSharpVerifierHelper.NullableWarnings));
Analyzers\Verifiers\CSharpVerifierHelper.cs (1)
25var nullableWarnings = commandLineArguments.CompilationOptions.SpecificDiagnosticOptions;