1 write to Id
Microsoft.CodeAnalysis (1)
Diagnostic\DiagnosticDescriptor.cs (1)
184this.Id = id;
275 references to Id
Aspire.Hosting.Analyzers.Tests (16)
AspireExportAnalyzerTests.cs (6)
82[CompilerError(diagnostic.Id).WithLocation(7, 6).WithMessage("Method 'InstanceMethod' marked with [AspireExport] must be static")]); 103[CompilerError(diagnostic.Id).WithLocation(7, 6).WithMessage("Export ID 'aspire/methodName' is not a valid method name. Use a valid identifier (e.g., 'addRedis', 'withEnvironment').")]); 124[CompilerError(diagnostic.Id).WithLocation(7, 6).WithMessage("Export ID 'method@1' is not a valid method name. Use a valid identifier (e.g., 'addRedis', 'withEnvironment').")]); 146[CompilerError(diagnostic.Id).WithLocation(8, 6).WithMessage("Method 'InvalidReturn' has return type 'System.IO.Stream' which is not ATS-compatible. Use void, Task, Task<T>, or a supported Aspire type.")]); 168[CompilerError(diagnostic.Id).WithLocation(8, 6).WithMessage("Parameter 'stream' of type 'System.IO.Stream' in method 'InvalidParam' is not ATS-compatible. Use primitive types, enums, or supported Aspire types.")]); 732[CompilerError(diagnostic.Id).WithLocation(9, 6).WithMessage("Parameter 'streams' of type 'System.Collections.Generic.List<System.IO.Stream>' in method 'InvalidList' is not ATS-compatible. Use primitive types, enums, or supported Aspire types.")]);
CombinationsAnalyzerTests.cs (4)
40CompilerError(diagnostic.Id).WithLocation(7, 5).WithMessage(message1), 41CompilerError(diagnostic.Id).WithLocation(8, 5).WithMessage(message2) 73CompilerError(diagnostic.Id).WithLocation(6, 21).WithMessage(message1), 74CompilerError(diagnostic.Id).WithLocation(6, 21).WithMessage(message2)
EndpointNameAnalyzerTests.cs (3)
28[CompilerError(diagnostic.Id).WithLocation(6, 37).WithMessage(message)]); 65CompilerError(diagnostic.Id).WithLocation(8, 9).WithMessage(message1), 66CompilerError(diagnostic.Id).WithLocation(9, 9).WithMessage(message2)
ResourceNameAnalyzerTests.cs (3)
27[CompilerError(diagnostic.Id).WithLocation(5, 22).WithMessage(message)]); 60CompilerError(diagnostic.Id).WithLocation(7, 5).WithMessage(message1), 61CompilerError(diagnostic.Id).WithLocation(8, 5).WithMessage(message2)
CodeStyleConfigFileGenerator (4)
Program.cs (4)
63allRulesById[rule.Id] = rule; 149result.AppendLine($"# {rule.Id}: {rule.Title}"); 154result.AppendLine($"dotnet_diagnostic.{rule.Id}.severity = {severityString}"); 161$"DiagnosticDescriptor for '{rule.Id}' must have a {nameof(EnforceOnBuild)} custom tag");
dotnet-format (5)
Analyzers\AnalyzerFormatter.cs (3)
241.Where(analyzer => analyzer.SupportedDiagnostics.Any(descriptor => descriptor.Id == diagnosticId)) 328analyzer.SupportedDiagnostics.All(descriptor => excludeDiagnostics.Contains(descriptor.Id))) 335!analyzer.SupportedDiagnostics.Any(descriptor => diagnostics.Contains(descriptor.Id)))
Analyzers\AnalyzerOptionExtensions.cs (1)
37var diagnosticId = descriptor.Id;
Analyzers\Extensions.cs (1)
134var parameters = new object?[] { descriptor.Id, compilation.Language, null };
GenerateDocumentationAndConfigFiles (24)
Program.cs (12)
293allRulesById[rule.Id] = rule; 295assemblyRulesMetadata.rules[rule.Id] = (rule, analyzerType.Name, analyzerType.GetCustomAttribute<DiagnosticAnalyzerAttribute>(true)?.Languages); 558var ruleIdWithHyperLink = descriptor.Id; 601var hasCodeFix = fixableDiagnosticIds.Contains(descriptor.Id); 673writer.WriteObjectStart(descriptor.Id); // rule 674writer.Write("id", descriptor.Id); 1143result.AppendLine($@" <Rule Id=""{rule.Id}"" Action=""{severity}"" /> {spacing} <!-- {rule.Title} -->"); 1211result.AppendLine($"# {rule.Id}: {rule.Title}"); 1212result.AppendLine($@"dotnet_diagnostic.{rule.Id}.severity = {severity}"); 1480result.AppendLine($"# {rule.Id}: {rule.Title}"); 1481result.AppendLine($@"dotnet_diagnostic.{rule.Id}.severity = {severityString}"); 1536if (releaseTrackingData.TryGetLatestReleaseTrackingLine(rule.Id, maxVersion, out _, out var releaseTrackingLine))
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (2)
182rule = new DiagnosticDescriptor(rule.Id, rule.Title, rule.MessageFormat, rule.Category, 201if (syntaxTreeOptionsProvider?.TryGetDiagnosticValue(tree, rule.Id, CancellationToken.None, out var configuredValue) != true)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AbstractCategorizedAnalyzerConfigOptions.cs (2)
75var key = OptionKey.GetOrCreate(rule?.Id, optionName); 98&& (TryGetSpecificOptionValue(rule.Id, optionKeyPrefix, out T? optionValue)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (8)
45(!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) || 48if (treeOptions.TryGetValue(descriptor.Id, out reportDiagnostic) && reportDiagnostic != ReportDiagnostic.Default || 70if (!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) || 100var diagnosticKey = $"{DotnetDiagnosticPrefix}.{descriptor.Id}.{SeveritySuffix}"; 158if (provider.TryGetDiagnosticValue(tree, descriptor.Id, CancellationToken.None, out severity) || 159provider.TryGetGlobalDiagnosticValue(descriptor.Id, CancellationToken.None, out severity)) 166var diagnosticKey = $"{DotnetDiagnosticPrefix}.{descriptor.Id}.{SeveritySuffix}"; 262return new DiagnosticDescriptor(descriptor.Id, descriptor.Title, messageFormat,
ILLink.CodeFixProvider (6)
DynamicallyAccessedMembersCodeFixProvider.cs (1)
64public sealed override ImmutableArray<string> FixableDiagnosticIds => SupportedDiagnostics.Select(dd => dd.Id).ToImmutableArray();
RequiresAssemblyFilesCodeFixProvider.cs (1)
25public sealed override ImmutableArray<string> FixableDiagnosticIds => SupportedDiagnostics.Select(dd => dd.Id).ToImmutableArray();
RequiresDynamicCodeCodeFixProvider.cs (1)
22public sealed override ImmutableArray<string> FixableDiagnosticIds => SupportedDiagnostics.Select(dd => dd.Id).ToImmutableArray();
RequiresUnreferencedCodeCodeFixProvider.cs (1)
22public sealed override ImmutableArray<string> FixableDiagnosticIds => SupportedDiagnostics.Select(dd => dd.Id).ToImmutableArray();
RequiresUnsafeCodeFixProvider.cs (1)
30public sealed override ImmutableArray<string> FixableDiagnosticIds => SupportedDiagnostics.Select(dd => dd.Id).ToImmutableArray();
UnsafeMethodMissingRequiresUnsafeCodeFixProvider.cs (1)
28SupportedDiagnostics.Select(dd => dd.Id).ToImmutableArray();
Microsoft.Analyzers.Extra (2)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (1)
50public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(DiagDescriptors.LegacyLogging.Id);
MakeExeTypesInternalFixer.cs (1)
22public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(DiagDescriptors.MakeExeTypesInternal.Id);
Microsoft.Analyzers.Extra.Tests (3)
Resources\RoslynTestUtils.cs (3)
142Assert.True(expected.Id == actual.Id, 143$"Span {spanNum} doesn't match: expected {expected.Id} but got {actual}"); 160if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal))
Microsoft.Analyzers.Local.Tests (3)
Resources\RoslynTestUtils.cs (3)
142Assert.True(expected.Id == actual.Id, 143$"Span {spanNum} doesn't match: expected {expected.Id} but got {actual}"); 160if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal))
Microsoft.AspNetCore.App.CodeFixes (18)
Authorization\AddAuthorizationBuilderFixer.cs (2)
23public override ImmutableArray<string> FixableDiagnosticIds { get; } = ImmutableArray.Create(DiagnosticDescriptors.UseAddAuthorizationBuilder.Id); 49equivalenceKey: DiagnosticDescriptors.UseAddAuthorizationBuilder.Id),
DetectMismatchedParameterOptionalityFixer.cs (2)
19public override ImmutableArray<string> FixableDiagnosticIds { get; } = ImmutableArray.Create(DiagnosticDescriptors.DetectMismatchedParameterOptionality.Id); 30equivalenceKey: DiagnosticDescriptors.DetectMismatchedParameterOptionality.Id),
Http\HeaderDictionaryAddFixer.cs (1)
24public override ImmutableArray<string> FixableDiagnosticIds { get; } = ImmutableArray.Create(DiagnosticDescriptors.DoNotUseIHeaderDictionaryAdd.Id);
Http\HeaderDictionaryIndexerFixer.cs (1)
19public override ImmutableArray<string> FixableDiagnosticIds { get; } = ImmutableArray.Create(DiagnosticDescriptors.UseHeaderDictionaryPropertiesInsteadOfIndexer.Id);
Kestrel\ListenOnIPv6AnyFixer.cs (2)
20public override ImmutableArray<string> FixableDiagnosticIds => [ DiagnosticDescriptors.KestrelShouldListenOnIPv6AnyInsteadOfIpAny.Id ]; 73equivalenceKey: DiagnosticDescriptors.KestrelShouldListenOnIPv6AnyInsteadOfIpAny.Id),
PublicPartialProgramClassFixer.cs (2)
19public override ImmutableArray<string> FixableDiagnosticIds { get; } = [DiagnosticDescriptors.PublicPartialProgramClassNotRequired.Id]; 47equivalenceKey: DiagnosticDescriptors.PublicPartialProgramClassNotRequired.Id),
RouteParameterUnusedParameterFixer.cs (2)
25DiagnosticDescriptors.RoutePatternUnusedParameter.Id); 52equivalenceKey: DiagnosticDescriptors.RoutePatternUnusedParameter.Id),
WebApplicationBuilderFixer.cs (6)
22DiagnosticDescriptors.DoNotUseHostConfigureLogging.Id, 23DiagnosticDescriptors.DoNotUseHostConfigureServices.Id, 24DiagnosticDescriptors.DisallowConfigureAppConfigureHostBuilder.Id 46case string when id == DiagnosticDescriptors.DoNotUseHostConfigureLogging.Id: 51case string when id == DiagnosticDescriptors.DoNotUseHostConfigureServices.Id: 56case string when id == DiagnosticDescriptors.DisallowConfigureAppConfigureHostBuilder.Id:
Microsoft.AspNetCore.Components.Analyzers (1)
ComponentParametersShouldBePublicCodeFixProvider.cs (1)
23=> ImmutableArray.Create(DiagnosticDescriptors.ComponentParametersShouldBePublic.Id);
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
ComponentParametersShouldBePublicCodeFixProvider.cs (1)
23=> ImmutableArray.Create(DiagnosticDescriptors.ComponentParametersShouldBePublic.Id);
Microsoft.AspNetCore.Mvc.Api.Analyzers (3)
AddResponseTypeAttributeCodeFixProvider.cs (2)
17ApiDiagnosticDescriptors.API1000_ActionReturnsUndocumentedStatusCode.Id, 18ApiDiagnosticDescriptors.API1001_ActionReturnsUndocumentedSuccessResult.Id);
ApiActionsDoNotRequireExplicitModelValidationCodeFixProvider.cs (1)
21ImmutableArray.Create(ApiDiagnosticDescriptors.API1003_ApiActionsDoNotRequireExplicitModelValidationCheck.Id);
Microsoft.CodeAnalysis (37)
CommandLine\CommonCompiler.SuppressionDiagnostic.cs (1)
49public override string Id => Descriptor.Id;
CommandLine\ReportAnalyzerUtil.cs (1)
110_ => analyzer.SupportedDiagnostics.Select(d => d.Id),
CommandLine\SarifDiagnosticComparer.cs (3)
53&& x.Id == y.Id 70Hash.Combine(obj.Id.GetHashCode(),
CommandLine\SarifV1ErrorLogger.cs (8)
161_writer.Write("id", descriptor.Id); 228/// The first <see cref="DiagnosticDescriptor"/> added with a given <see cref="DiagnosticDescriptor.Id"/> 260if (!_counters.TryGetValue(descriptor.Id, out int counter)) 262_counters.Add(descriptor.Id, 0); 263_keys.Add(descriptor, descriptor.Id); 264return descriptor.Id; 273_counters[descriptor.Id] = ++counter; 274key = descriptor.Id + "-" + counter.ToString("000", CultureInfo.InvariantCulture);
CommandLine\SarifV2ErrorLogger.cs (4)
122foreach (var (descriptor, info) in descriptors.OrderBy(d => d.Descriptor.Id)) 242_writer.Write("id", descriptor.Id); 273var hasAnySourceSuppression = _diagnosticIdsWithAnySourceSuppressions.Contains(descriptor.Id); 338effectiveSeveritiesBuilder.Add((descriptor.Id, index, descriptorInfo.EffectiveSeverities!));
Diagnostic\Diagnostic.DiagnosticWithProgrammaticSuppression.cs (1)
40get { return Descriptor.Id; }
Diagnostic\Diagnostic_SimpleDiagnostic.cs (1)
88get { return _descriptor.Id; }
Diagnostic\DiagnosticDescriptor.cs (3)
208this.Id == other.Id && 225Hash.Combine(this.Id.GetHashCode(),
DiagnosticAnalyzer\AnalyzerDriver.cs (7)
931if (!uniqueDiagnosticIds.Add(descriptor.Id)) 939SuppressedDiagnosticIdsForUnsuppressedAnalyzers.Contains(descriptor.Id); 963if (compilation.Options.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var severity) || 964compilation.Options.SyntaxTreeOptionsProvider?.TryGetGlobalDiagnosticValue(descriptor.Id, cancellationToken, out severity) == true) 990if (syntaxTreeProvider.TryGetDiagnosticValue(tree, descriptor.Id, cancellationToken, out severity) || 1404if (options.TryGetDiagnosticValue(tree, descriptor.Id, cancellationToken, out var severityFromOptions) || 1405options.TryGetGlobalDiagnosticValue(descriptor.Id, cancellationToken, out severityFromOptions))
DiagnosticAnalyzer\AnalyzerExecutor.cs (1)
1432diagnosticIds = diagnosticIds.Add(diagnostic.Id);
DiagnosticAnalyzer\AnalyzerManager.cs (4)
287if (descriptor.Id.Equals(diagnostic.Id, StringComparison.OrdinalIgnoreCase)) 323if (treeOptions.TryGetDiagnosticValue(tree, descriptor.Id, cancellationToken, out var configuredValue) || 390if ((diagnosticOptions.TryGetValue(diag.Id, out var severity) && severity != ReportDiagnostic.Default) || 391(options.SyntaxTreeOptionsProvider is object && options.SyntaxTreeOptionsProvider.TryGetGlobalDiagnosticValue(diag.Id, cancellationToken, out severity)))
DiagnosticAnalyzer\AnalyzerOptionsExtensions.cs (3)
57if (compilation.Options.SpecificDiagnosticOptions.ContainsKey(descriptor.Id) || 58compilation.Options.SyntaxTreeOptionsProvider?.TryGetDiagnosticValue(tree, descriptor.Id, cancellationToken, out _) == true || 59compilation.Options.SyntaxTreeOptionsProvider?.TryGetGlobalDiagnosticValue(descriptor.Id, cancellationToken, out _) == true)
Microsoft.CodeAnalysis.Analyzers (15)
MetaAnalyzers\Fixers\ConfigureGeneratedCodeAnalysisFix.cs (1)
23public override ImmutableArray<string> FixableDiagnosticIds { get; } = [ConfigureGeneratedCodeAnalysisAnalyzer.Rule.Id];
MetaAnalyzers\Fixers\EnableConcurrentExecutionFix.cs (1)
22public override ImmutableArray<string> FixableDiagnosticIds { get; } = [EnableConcurrentExecutionAnalyzer.Rule.Id];
MetaAnalyzers\Fixers\PreferIsKindFix.cs (1)
17public override ImmutableArray<string> FixableDiagnosticIds { get; } = ImmutableArray.Create(PreferIsKindAnalyzer.Rule.Id);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (2)
182rule = new DiagnosticDescriptor(rule.Id, rule.Title, rule.MessageFormat, rule.Category, 201if (syntaxTreeOptionsProvider?.TryGetDiagnosticValue(tree, rule.Id, CancellationToken.None, out var configuredValue) != true)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AbstractCategorizedAnalyzerConfigOptions.cs (2)
75var key = OptionKey.GetOrCreate(rule?.Id, optionName); 98&& (TryGetSpecificOptionValue(rule.Id, optionKeyPrefix, out T? optionValue)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (8)
45(!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) || 48if (treeOptions.TryGetValue(descriptor.Id, out reportDiagnostic) && reportDiagnostic != ReportDiagnostic.Default || 70if (!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) || 100var diagnosticKey = $"{DotnetDiagnosticPrefix}.{descriptor.Id}.{SeveritySuffix}"; 158if (provider.TryGetDiagnosticValue(tree, descriptor.Id, CancellationToken.None, out severity) || 159provider.TryGetGlobalDiagnosticValue(descriptor.Id, CancellationToken.None, out severity)) 166var diagnosticKey = $"{DotnetDiagnosticPrefix}.{descriptor.Id}.{SeveritySuffix}"; 262return new DiagnosticDescriptor(descriptor.Id, descriptor.Title, messageFormat,
Microsoft.CodeAnalysis.AnalyzerUtilities (12)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (2)
182rule = new DiagnosticDescriptor(rule.Id, rule.Title, rule.MessageFormat, rule.Category, 201if (syntaxTreeOptionsProvider?.TryGetDiagnosticValue(tree, rule.Id, CancellationToken.None, out var configuredValue) != true)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AbstractCategorizedAnalyzerConfigOptions.cs (2)
75var key = OptionKey.GetOrCreate(rule?.Id, optionName); 98&& (TryGetSpecificOptionValue(rule.Id, optionKeyPrefix, out T? optionValue)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (8)
45(!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) || 48if (treeOptions.TryGetValue(descriptor.Id, out reportDiagnostic) && reportDiagnostic != ReportDiagnostic.Default || 70if (!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) || 100var diagnosticKey = $"{DotnetDiagnosticPrefix}.{descriptor.Id}.{SeveritySuffix}"; 158if (provider.TryGetDiagnosticValue(tree, descriptor.Id, CancellationToken.None, out severity) || 159provider.TryGetGlobalDiagnosticValue(descriptor.Id, CancellationToken.None, out severity)) 166var diagnosticKey = $"{DotnetDiagnosticPrefix}.{descriptor.Id}.{SeveritySuffix}"; 262return new DiagnosticDescriptor(descriptor.Id, descriptor.Title, messageFormat,
Microsoft.CodeAnalysis.CodeStyle (15)
src\roslyn\src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs (2)
88AddDiagnosticIdToOptionMapping(descriptor.Id, option); 102AddDiagnosticIdToOptionMapping(descriptor.Id, options);
src\roslyn\src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (2)
211if (severityOptionsProvider.TryGetDiagnosticValue(tree, descriptor.Id, cancellationToken, out var configuredReportDiagnostic) 212|| severityOptionsProvider.TryGetGlobalDiagnosticValue(descriptor.Id, cancellationToken, out configuredReportDiagnostic))
src\roslyn\src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (1)
275descriptor.Id,
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
427if (!idsToAnalyze.Contains(descriptor.Id)) 435unhandledIds.Add(descriptor.Id);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (8)
45(!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) || 48if (treeOptions.TryGetValue(descriptor.Id, out reportDiagnostic) && reportDiagnostic != ReportDiagnostic.Default || 70if (!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) || 100var diagnosticKey = $"{DotnetDiagnosticPrefix}.{descriptor.Id}.{SeveritySuffix}"; 158if (provider.TryGetDiagnosticValue(tree, descriptor.Id, CancellationToken.None, out severity) || 159provider.TryGetGlobalDiagnosticValue(descriptor.Id, CancellationToken.None, out severity)) 166var diagnosticKey = $"{DotnetDiagnosticPrefix}.{descriptor.Id}.{SeveritySuffix}"; 262return new DiagnosticDescriptor(descriptor.Id, descriptor.Title, messageFormat,
Microsoft.CodeAnalysis.CSharp.Features (4)
QuickInfo\CSharpDiagnosticAnalyzerQuickInfoProvider.cs (4)
133var diagnosticDescriptor = supportedDiagnostics.FirstOrDefault(d => d.Id == errorCode); 149descriptor.Id; 151? new TaggedText(TextTags.Text, descriptor.Id, TaggedTextStyle.None, descriptor.HelpLinkUri, descriptor.HelpLinkUri) 152: new TaggedText(TextTags.Text, descriptor.Id);
Microsoft.CodeAnalysis.Features (12)
Diagnostics\Service\DiagnosticAnalyzerService_DeprioritizationCandidates.cs (1)
105return [.. analyzer.SupportedDiagnostics.Select(d => d.Id)];
Diagnostics\Service\DiagnosticAnalyzerService_GetDiagnosticsForSpan.cs (1)
173return diagnosticIdFilter.Allow(descriptors.Select(d => d.Id));
Diagnostics\Service\DiagnosticAnalyzerService_ProduceProjectDiagnostics.cs (1)
46if (diagnosticIds != null && _analyzerInfoCache.GetDiagnosticDescriptors(analyzer).All(d => !diagnosticIds.Contains(d.Id)))
Diagnostics\Service\DiagnosticAnalyzerService_RemoteOrLocalDispatcher.cs (1)
97builder.Add(buildOnlyDescriptor.Id);
EditAndContinue\EditSession.cs (1)
171return descriptor.Id;
src\roslyn\src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs (2)
88AddDiagnosticIdToOptionMapping(descriptor.Id, option); 102AddDiagnosticIdToOptionMapping(descriptor.Id, options);
src\roslyn\src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (2)
211if (severityOptionsProvider.TryGetDiagnosticValue(tree, descriptor.Id, cancellationToken, out var configuredReportDiagnostic) 212|| severityOptionsProvider.TryGetGlobalDiagnosticValue(descriptor.Id, cancellationToken, out configuredReportDiagnostic))
src\roslyn\src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (1)
275descriptor.Id,
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
427if (!idsToAnalyze.Contains(descriptor.Id)) 435unhandledIds.Add(descriptor.Id);
Microsoft.CodeAnalysis.ResxSourceGenerator (12)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (2)
182rule = new DiagnosticDescriptor(rule.Id, rule.Title, rule.MessageFormat, rule.Category, 201if (syntaxTreeOptionsProvider?.TryGetDiagnosticValue(tree, rule.Id, CancellationToken.None, out var configuredValue) != true)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AbstractCategorizedAnalyzerConfigOptions.cs (2)
75var key = OptionKey.GetOrCreate(rule?.Id, optionName); 98&& (TryGetSpecificOptionValue(rule.Id, optionKeyPrefix, out T? optionValue)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (8)
45(!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) || 48if (treeOptions.TryGetValue(descriptor.Id, out reportDiagnostic) && reportDiagnostic != ReportDiagnostic.Default || 70if (!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) || 100var diagnosticKey = $"{DotnetDiagnosticPrefix}.{descriptor.Id}.{SeveritySuffix}"; 158if (provider.TryGetDiagnosticValue(tree, descriptor.Id, CancellationToken.None, out severity) || 159provider.TryGetGlobalDiagnosticValue(descriptor.Id, CancellationToken.None, out severity)) 166var diagnosticKey = $"{DotnetDiagnosticPrefix}.{descriptor.Id}.{SeveritySuffix}"; 262return new DiagnosticDescriptor(descriptor.Id, descriptor.Title, messageFormat,
Microsoft.CodeAnalysis.Workspaces (16)
Diagnostics\DiagnosticAnalyzerInfoCache.cs (3)
172if (!_idToDescriptorsMap.TryGetValue(descriptor.Id, out var existingDescriptor)) 174_idToDescriptorsMap[descriptor.Id] = descriptor; 185_idToDescriptorsMap[descriptor.Id] = null;
Diagnostics\DiagnosticDescriptorData.cs (1)
46descriptor.Id,
Diagnostics\HostDiagnosticAnalyzers.cs (1)
104diagnosticIdBuilder.Add(descriptor.Id);
Diagnostics\SkippedHostAnalyzersInfo.cs (3)
65projectAnalyzerDiagnosticIds.Add(descriptor.Id); 136if (projectAnalyzerDiagnosticIds.Contains(descriptor.Id)) 138skippedDiagnosticIdsBuilder.Add(descriptor.Id);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (8)
45(!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) || 48if (treeOptions.TryGetValue(descriptor.Id, out reportDiagnostic) && reportDiagnostic != ReportDiagnostic.Default || 70if (!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) || 100var diagnosticKey = $"{DotnetDiagnosticPrefix}.{descriptor.Id}.{SeveritySuffix}"; 158if (provider.TryGetDiagnosticValue(tree, descriptor.Id, CancellationToken.None, out severity) || 159provider.TryGetGlobalDiagnosticValue(descriptor.Id, CancellationToken.None, out severity)) 166var diagnosticKey = $"{DotnetDiagnosticPrefix}.{descriptor.Id}.{SeveritySuffix}"; 262return new DiagnosticDescriptor(descriptor.Id, descriptor.Title, messageFormat,
Microsoft.Gen.BuildMetadata.Unit.Tests (6)
test\Generators\Shared\RoslynTestUtils.cs (6)
139Assert.True(expected.Id == actual.Id, 140$"Span {spanNum} doesn't match: expected {expected.Id} but got {actual}"); 166Assert.True(expected.Id == d.Id, 167$"Span {spanNum} doesn't match: expected {expected.Id} but got {d}"); 191if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal)) 210if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal))
Microsoft.Gen.ComplianceReports.Unit.Tests (6)
test\Generators\Shared\RoslynTestUtils.cs (6)
139Assert.True(expected.Id == actual.Id, 140$"Span {spanNum} doesn't match: expected {expected.Id} but got {actual}"); 166Assert.True(expected.Id == d.Id, 167$"Span {spanNum} doesn't match: expected {expected.Id} but got {d}"); 191if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal)) 210if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal))
Microsoft.Gen.ContextualOptions.Unit.Tests (8)
DiagDescriptorsTests.cs (2)
28Assert.True(descriptor.IsEnabledByDefault, descriptor.Id + " should be enabled by default"); 29Assert.EndsWith("/" + descriptor.Id, descriptor.HelpLinkUri, StringComparison.OrdinalIgnoreCase);
test\Generators\Shared\RoslynTestUtils.cs (6)
139Assert.True(expected.Id == actual.Id, 140$"Span {spanNum} doesn't match: expected {expected.Id} but got {actual}"); 166Assert.True(expected.Id == d.Id, 167$"Span {spanNum} doesn't match: expected {expected.Id} but got {d}"); 191if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal)) 210if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal))
Microsoft.Gen.Logging.Unit.Tests (8)
DiagDescriptorsTests.cs (2)
29Assert.True(descriptor.IsEnabledByDefault, descriptor.Id + " should be enabled by default"); 30Assert.EndsWith("/" + descriptor.Id, descriptor.HelpLinkUri, StringComparison.OrdinalIgnoreCase);
test\Generators\Shared\RoslynTestUtils.cs (6)
139Assert.True(expected.Id == actual.Id, 140$"Span {spanNum} doesn't match: expected {expected.Id} but got {actual}"); 166Assert.True(expected.Id == d.Id, 167$"Span {spanNum} doesn't match: expected {expected.Id} but got {d}"); 191if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal)) 210if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal))
Microsoft.Gen.MetadataExtractor.Unit.Tests (6)
test\Generators\Shared\RoslynTestUtils.cs (6)
139Assert.True(expected.Id == actual.Id, 140$"Span {spanNum} doesn't match: expected {expected.Id} but got {actual}"); 166Assert.True(expected.Id == d.Id, 167$"Span {spanNum} doesn't match: expected {expected.Id} but got {d}"); 191if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal)) 210if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal))
Microsoft.Gen.Metrics.Unit.Tests (8)
DiagDescriptorsTests.cs (2)
28Assert.True(descriptor.IsEnabledByDefault, descriptor.Id + " should be enabled by default"); 29Assert.EndsWith("/" + descriptor.Id, descriptor.HelpLinkUri, StringComparison.OrdinalIgnoreCase);
test\Generators\Shared\RoslynTestUtils.cs (6)
139Assert.True(expected.Id == actual.Id, 140$"Span {spanNum} doesn't match: expected {expected.Id} but got {actual}"); 166Assert.True(expected.Id == d.Id, 167$"Span {spanNum} doesn't match: expected {expected.Id} but got {d}"); 191if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal)) 210if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal))
Microsoft.Gen.MetricsReports.Unit.Tests (6)
test\Generators\Shared\RoslynTestUtils.cs (6)
139Assert.True(expected.Id == actual.Id, 140$"Span {spanNum} doesn't match: expected {expected.Id} but got {actual}"); 166Assert.True(expected.Id == d.Id, 167$"Span {spanNum} doesn't match: expected {expected.Id} but got {d}"); 191if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal)) 210if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal))
Roslyn.Diagnostics.Analyzers (15)
ExportedPartsShouldHaveImportingConstructorCodeFixProvider.cs (1)
30public override ImmutableArray<string> FixableDiagnosticIds { get; } = ImmutableArray.Create(ExportedPartsShouldHaveImportingConstructor.Rule.Id);
ImportingConstructorShouldBeObsoleteCodeFixProvider.cs (1)
24public override ImmutableArray<string> FixableDiagnosticIds { get; } = [ImportingConstructorShouldBeObsolete.Rule.Id];
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\DiagnosticExtensions.cs (2)
182rule = new DiagnosticDescriptor(rule.Id, rule.Title, rule.MessageFormat, rule.Category, 201if (syntaxTreeOptionsProvider?.TryGetDiagnosticValue(tree, rule.Id, CancellationToken.None, out var configuredValue) != true)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AbstractCategorizedAnalyzerConfigOptions.cs (2)
75var key = OptionKey.GetOrCreate(rule?.Id, optionName); 98&& (TryGetSpecificOptionValue(rule.Id, optionKeyPrefix, out T? optionValue)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (8)
45(!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) || 48if (treeOptions.TryGetValue(descriptor.Id, out reportDiagnostic) && reportDiagnostic != ReportDiagnostic.Default || 70if (!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) || 100var diagnosticKey = $"{DotnetDiagnosticPrefix}.{descriptor.Id}.{SeveritySuffix}"; 158if (provider.TryGetDiagnosticValue(tree, descriptor.Id, CancellationToken.None, out severity) || 159provider.TryGetGlobalDiagnosticValue(descriptor.Id, CancellationToken.None, out severity)) 166var diagnosticKey = $"{DotnetDiagnosticPrefix}.{descriptor.Id}.{SeveritySuffix}"; 262return new DiagnosticDescriptor(descriptor.Id, descriptor.Title, messageFormat,
TestExportsShouldNotBeDiscoverableCodeFixProvider.cs (1)
30public override ImmutableArray<string> FixableDiagnosticIds { get; } = ImmutableArray.Create(TestExportsShouldNotBeDiscoverable.Rule.Id);
Roslyn.Diagnostics.CSharp.Analyzers (2)
CSharpAvoidOptSuffixForNullableEnableCodeCodeFixProvider.cs (1)
26public override ImmutableArray<string> FixableDiagnosticIds { get; } = ImmutableArray.Create(CSharpAvoidOptSuffixForNullableEnableCode.Rule.Id);
PreferNullLiteralCodeFixProvider.cs (1)
28public override ImmutableArray<string> FixableDiagnosticIds { get; } = ImmutableArray.Create(PreferNullLiteral.Rule.Id);
System.Text.RegularExpressions.Generator (1)
UpgradeToGeneratedRegexCodeFixer.cs (1)
37public override ImmutableArray<string> FixableDiagnosticIds => [DiagnosticDescriptors.UseRegexSourceGeneration.Id];