6 overrides of Id
Microsoft.CodeAnalysis (5)
CommandLine\CommonCompiler.SuppressionDiagnostic.cs (1)
49public override string Id => Descriptor.Id;
Diagnostic\Diagnostic.DiagnosticWithProgrammaticSuppression.cs (1)
38public override string Id
Diagnostic\Diagnostic_SimpleDiagnostic.cs (1)
85public override string Id
Diagnostic\DiagnosticWithInfo.cs (1)
59public override string Id
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.CompilationAnalyzer.cs (1)
94public override string Id => _original.Id;
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
EvaluationContextBase.cs (1)
121public override string Id
284 references to Id
AnalyzerRunner (3)
DiagnosticAnalyzerRunner.cs (1)
204.OrderBy(tuple => tuple.Item2.Id)
Program.cs (2)
153diagnosticStatistics.TryGetValue(diagnostic.Id, out var existing); 164diagnosticStatistics[diagnostic.Id] = (description, diagnostic.Descriptor.DefaultSeverity, existing.count + 1);
BuildActionTelemetryTable (1)
src\Workspaces\Core\Portable\Shared\Extensions\TelemetryExtensions.cs (1)
58return diagnostic.Id;
ILLink.CodeFixProvider (4)
DynamicallyAccessedMembersCodeFixProvider.cs (2)
114 addAsReturnAttribute: AttributeOnReturn.Contains (diagnostic.Id), 115 addGenericParameterAttribute: AttributeOnGeneric.Contains (diagnostic.Id),
UnconditionalSuppressMessageCodeFixProvider.cs (2)
52 string.IsNullOrWhiteSpace (ruleTitle) ? diagnostic.Id : $"{diagnostic.Id}:{ruleTitle}"));
Microsoft.Analyzers.Extra.Tests (4)
Resources\RoslynTestUtils.cs (4)
142Assert.True(expected.Id == actual.Id, 160if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal)) 346if (fixer.FixableDiagnosticIds.Contains(d.Id)) 544return diags.Where(d => _fixer.FixableDiagnosticIds.Contains(d.Id));
Microsoft.Analyzers.Local.Tests (5)
ApiLifecycle\ApiLifecycleAnalyzerTest.cs (1)
76Assert.Contains(actual.Id, ids);
Resources\RoslynTestUtils.cs (4)
142Assert.True(expected.Id == actual.Id, 160if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal)) 347if (fixer.FixableDiagnosticIds.Contains(d.Id)) 545return diags.Where(d => _fixer.FixableDiagnosticIds.Contains(d.Id));
Microsoft.AspNetCore.Analyzer.Testing (4)
DiagnosticAnalyzerRunner.cs (2)
81Assert.DoesNotContain(diags, d => d.Id == "AD0001"); 86diags = diags.Where(d => d.Severity == DiagnosticSeverity.Error || analyzer.SupportedDiagnostics.Any(s => s.Id.Equals(d.Id))).ToImmutableArray();
DiagnosticVerifier.cs (2)
104Assert.DoesNotContain(diags, d => d.Id == "AD0001"); 109diags = diags.Where(d => d.Severity == DiagnosticSeverity.Error || analyzer.SupportedDiagnostics.Any(s => s.Id.Equals(d.Id))).ToImmutableArray();
Microsoft.AspNetCore.App.Analyzers.Test (2)
Infrastructure\WellKnownTypesTests.cs (2)
36Assert.Collection(diagnostics, d => Assert.Equal("TEST001", d.Id)); 69Assert.Collection(diagnostics, d => Assert.Equal("TEST001", d.Id));
Microsoft.AspNetCore.App.CodeFixes (1)
WebApplicationBuilderFixer.cs (1)
39var id = diagnostic.Id;
Microsoft.AspNetCore.Components.Analyzers.Tests (5)
Helpers\CodeFixVerifier.Helper.cs (2)
51if (oldIndex < oldArray.Length && oldArray[oldIndex].Id == newArray[newIndex].Id)
Verifiers\DiagnosticVerifier.cs (3)
154if (actual.Id != expected.Id) 160expected.Id, actual.Id, FormatDiagnostics(analyzer, actual))); 249if (rule != null && rule.Id == diagnostics[i].Id)
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (5)
Helpers\CodeFixVerifier.Helper.cs (2)
51if (oldIndex < oldArray.Length && oldArray[oldIndex].Id == newArray[newIndex].Id)
Verifiers\DiagnosticVerifier.cs (3)
154if (actual.Id != expected.Id) 160expected.Id, actual.Id, FormatDiagnostics(analyzer, actual))); 249if (rule != null && rule.Id == diagnostics[i].Id)
Microsoft.AspNetCore.Http.Extensions.Tests (9)
RequestDelegateGenerator\CompileTimeCreationTests.AsParameters.cs (3)
33Assert.Equal(DiagnosticDescriptors.InvalidAsParametersNullable.Id, diagnostic.Id); 84Assert.Equal(diagnosticId, diagnostic.Id); 103Assert.Equal(DiagnosticDescriptors.InvalidAsParametersNested.Id, diagnostic.Id);
RequestDelegateGenerator\CompileTimeCreationTests.cs (5)
201Assert.Equal(DiagnosticDescriptors.UnableToResolveAnonymousReturnType.Id, diagnostic.Id); 251Assert.Equal(DiagnosticDescriptors.TypeParametersNotSupported.Id, diagnostic.Id); 305Assert.Equal(DiagnosticDescriptors.InaccessibleTypesNotSupported.Id, diagnostic.Id); 351Assert.Equal(DiagnosticDescriptors.InaccessibleTypesNotSupported.Id, diagnostic.Id); 758Assert.Equal(DiagnosticDescriptors.UnableToResolveParameterDescriptor.Id, diagnostic.Id);
RequestDelegateGenerator\RequestDelegateCreationTests.KeyServices.cs (1)
44Assert.Contains(result.Value.Diagnostics, diagnostic => diagnostic.Id == DiagnosticDescriptors.KeyedAndNotKeyedServiceAttributesNotSupported.Id);
Microsoft.AspNetCore.Http.RequestDelegateGenerator (3)
RequestDelegateGeneratorSuppressor.cs (3)
40if (diagnostic.Id != SuppressRDCDiagnostic.SuppressedDiagnosticId && diagnostic.Id != SuppressRUCDiagnostic.SuppressedDiagnosticId) 65var targetSuppression = diagnostic.Id == SuppressRUCDiagnostic.SuppressedDiagnosticId
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (2)
CompilationFailedExceptionFactory.cs (2)
75string.Equals(CS0234, g.Id, StringComparison.OrdinalIgnoreCase) || 76string.Equals(CS0246, g.Id, StringComparison.OrdinalIgnoreCase)))
Microsoft.CodeAnalysis (32)
CommandLine\CommonCompiler.SuppressionDiagnostic.cs (1)
57_originalDiagnostic.Id,
CommandLine\SarifV1ErrorLogger.cs (2)
62_writer.Write("ruleId", diagnostic.Id); 65if (ruleKey != diagnostic.Id)
CommandLine\SarifV2ErrorLogger.cs (2)
59_writer.Write("ruleId", diagnostic.Id); 75_diagnosticIdsWithAnySourceSuppressions.Add(diagnostic.Id);
Diagnostic\CommonDiagnosticComparer.cs (3)
30return x.Location == y.Location && x.Id == y.Id; 40return Hash.Combine(obj.Location, obj.Id.GetHashCode());
Diagnostic\Diagnostic.cs (1)
365return new SuppressionInfo(this.Id, attribute, programmaticSuppressions);
Diagnostic\DiagnosticFormatter.cs (1)
103return string.Format("{0} {1}", prefix, diagnostic.Id);
Diagnostic\SuppressionDescriptor.cs (3)
22/// Identifier of the suppressed diagnostic, i.e. <see cref="Diagnostic.Id"/>. 37/// <param name="suppressedDiagnosticId">Identifier of the suppressed diagnostic, i.e. <see cref="Diagnostic.Id"/>. For example, compiler warning Id "CS0649".</param> 51/// <param name="suppressedDiagnosticId">Identifier of the suppressed diagnostic, i.e. <see cref="Diagnostic.Id"/>. For example, compiler warning Id "CS0649".</param>
Diagnostic\SuppressionInfo.cs (2)
17/// <see cref="Diagnostic.Id"/> of the suppressed diagnostic. 36Debug.Assert(programmaticSuppressions.All(suppression => id == suppression.SuppressedDiagnostic.Id));
DiagnosticAnalyzer\AnalyzerDriver.cs (2)
1142if (supportedSuppressions.Contains(s => s.SuppressedDiagnosticId == diagnostic.Id)) 2000suppressedDiagnosticIds?.Add(diagnostic.Id);
DiagnosticAnalyzer\AnalyzerExecutor.cs (4)
1324if (diagnostic.Id == AnalyzerExceptionDiagnosticId || diagnostic.Id == AnalyzerDriverExceptionDiagnosticId) 1353return exceptionDiagnostic.Id == other.Id &&
DiagnosticAnalyzer\AnalyzerManager.cs (1)
286if (descriptor.Id.Equals(diagnostic.Id, StringComparison.OrdinalIgnoreCase))
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.CompilationAnalyzer.cs (1)
94public override string Id => _original.Id;
DiagnosticAnalyzer\DiagnosticAnalysisContext.cs (1)
1940var message = string.Format(CodeAnalysisResources.NonReportedDiagnosticCannotBeSuppressed, suppression.SuppressedDiagnostic.Id);
DiagnosticAnalyzer\DiagnosticAnalysisContextHelpers.cs (5)
63throw new ArgumentException(string.Format(CodeAnalysisResources.UnsupportedDiagnosticReported, diagnostic.Id), nameof(diagnostic)); 66if (!UnicodeCharacterUtilities.IsValidIdentifier(diagnostic.Id)) 71throw new ArgumentException(string.Format(CodeAnalysisResources.InvalidDiagnosticIdReported, diagnostic.Id), nameof(diagnostic)); 77VerifyDiagnosticLocationInCompilation(diagnostic.Id, diagnostic.Location, compilation); 83VerifyDiagnosticLocationInCompilation(diagnostic.Id, location, compilation);
DiagnosticAnalyzer\Suppression.cs (2)
23if (descriptor.SuppressedDiagnosticId != suppressedDiagnostic.Id) 26var message = string.Format(CodeAnalysisResources.InvalidDiagnosticSuppressionReported, suppressedDiagnostic.Id, descriptor.SuppressedDiagnosticId);
DiagnosticAnalyzer\SuppressMessageAttributeState.cs (1)
152var id = diagnostic.Id;
Microsoft.CodeAnalysis.CodeStyle (2)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
549if (!idToPragmasMap.TryGetValue(diagnostic.Id, out var pragmasForIdInReverseOrder)) 591!idToSuppressMessageAttributesMap.TryGetValue(diagnostic.Id, out var suppressMessageAttributesForId))
Microsoft.CodeAnalysis.CodeStyle.Fixes (6)
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (2)
81document, semanticModel, root, diagnostic.Id, spanNode, cancellationToken); 230document, semanticModel, root, diagnostics[0].Id, spanNode, cancellationToken);
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (2)
101if (TooManyArgumentsDiagnosticIds.Contains(diagnostic.Id)) 106if (CannotConvertDiagnosticIds.Contains(diagnostic.Id))
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (2)
248diagnosticId = diagnostics[0].Id; 255Debug.Assert(diagnosticId == diagnostic.Id);
Microsoft.CodeAnalysis.CSharp (1)
Compilation\CSharpDiagnosticFilter.cs (1)
99d.Id,
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\CSharpRemoveUnreachableCodeDiagnosticAnalyzer.cs (1)
65if (diagnostic.Id == CS0162)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Helpers\RemoveUnnecessaryImports\CSharpUnnecessaryImportsProvider.cs (1)
35if (diagnostic.Id == "CS8019" &&
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceCodeFixProvider.cs (2)
37diagnostic.Id switch 41_ => throw ExceptionUtilities.UnexpectedValue(diagnostic.Id),
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (1)
40if (diagnostic.Id == CS0246)
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveCodeFixProvider.cs (1)
40if (diagnostic.Id == IDEDiagnosticIds.RemoveRedundantNullableDirectiveDiagnosticId)
src\Analyzers\CSharp\CodeFixes\UpgradeProject\CSharpUpgradeProjectCodeFixProvider.cs (1)
78else if (diagnostic.Id == "CS8652")
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
81var helper = _helpers.Single(h => h.DiagnosticId == diagnostic.Id);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (3)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (3)
207var diagnosticsFromAnalyzer = diagnostics.Where(d => d.Id == "SyntaxDiagnostic"); 262var diagnosticsFromAnalyzer = diagnostics.Where(d => d.Id == CodeBlockAnalyzerFactory.Descriptor.Id); 934if (this.mapping.TryGetValue(diagnostic.Id, out var descriptor))
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (31)
Attributes\AttributeTests_WellKnownAttributes.cs (2)
8298Assert.Equal("TEST1", diag.Id); 8464Assert.Equal("TEST1", diag.Id);
Diagnostics\DiagnosticAnalyzerTests.cs (9)
353var diagIds = new HashSet<string>(diags.Select(d => d.Id)); 356Assert.True(diagIds.Remove(effectiveDiag.Id)); 361Assert.Equal(infoDiagDescriptor.Id, effectiveDiag.Id); 365Assert.Equal(noneDiagDescriptor.Id, effectiveDiag.Id); 369Assert.Equal(errorDiagDescriptor.Id, effectiveDiag.Id); 373Assert.Equal(warningDiagDescriptor.Id, effectiveDiag.Id); 3719Assert.Equal(((FieldAnalyzer)analyzer).Descriptor.Id, diagnostic.Id); 3903Assert.Equal(analyzer.Descriptor.Id, diagnostic.Id); 4251Assert.Equal(CancellationTestAnalyzer.DiagnosticId, diagnostic.Id);
Diagnostics\GetDiagnosticsTests.cs (2)
758Assert.Equal(RegisterSyntaxTreeCancellationAnalyzer.DiagnosticId, diagnostic.Id); 842var group1 = semanticDiagnostics.Where(d => d.Id == "ID0001");
Semantics\ExperimentalAttributeTests.cs (18)
64Assert.Equal("DiagID1", diag.Id); 120Assert.Equal("DiagID1", diag.Id); 185Assert.Equal("DiagID1", diag.Id); 294Assert.Equal("DiagID1", diag.Id); 442Assert.Equal("DiagID1", diag.Id); 512Assert.Equal("DiagModule", diag.Id); 1071Assert.Equal("DiagID1", diag.Id); 1100Assert.Equal("DiagID1", diag.Id); 1131Assert.Equal("DiagID1", diag.Id); 1162Assert.Equal("DiagID1", diag.Id); 1193Assert.Equal("DiagID1", diag.Id); 1812Assert.Equal("DiagID", diag.Id); 1853Assert.Equal("DiagID", diag.Id); 1894Assert.Equal("DiagID", diag.Id); 1920Assert.Equal("DiagID1", diag.Id); 1946Assert.Equal("DiagID1", diag.Id); 1977Assert.Equal("DiagID1", diag.Id); 2003Assert.Equal("DiagID1", diag.Id);
Microsoft.CodeAnalysis.CSharp.Features (10)
CodeFixes\Suppression\CSharpSuppressionCodeFixProvider.cs (2)
184var ruleIdText = string.IsNullOrWhiteSpace(title) ? diagnostic.Id : string.Format("{0}:{1}", diagnostic.Id, title);
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\CSharpRemoveUnreachableCodeDiagnosticAnalyzer.cs (1)
65if (diagnostic.Id == CS0162)
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceCodeFixProvider.cs (2)
37diagnostic.Id switch 41_ => throw ExceptionUtilities.UnexpectedValue(diagnostic.Id),
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (1)
40if (diagnostic.Id == CS0246)
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveCodeFixProvider.cs (1)
40if (diagnostic.Id == IDEDiagnosticIds.RemoveRedundantNullableDirectiveDiagnosticId)
src\Analyzers\CSharp\CodeFixes\UpgradeProject\CSharpUpgradeProjectCodeFixProvider.cs (1)
78else if (diagnostic.Id == "CS8652")
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
81var helper = _helpers.Single(h => h.DiagnosticId == diagnostic.Id);
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (1)
182return diagnostics.Any(static d => d.Id is CS0165 or CS0103);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
SourceGeneration\GeneratorDriverTests.cs (1)
4117Assert.Equal("CS" + (int)errorCode, diagnostic.Id);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
LexicalAndXml\RawStringLiteralLexingTests.cs (1)
221Assert.All(diagnostics, d => Assert.Equal(spans.Single().Key, d.Id));
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
Simplification\CSharpSimplificationService.cs (1)
192if (diagnostic.Id == s_CS8019_UnusedUsingDirective)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Helpers\RemoveUnnecessaryImports\CSharpUnnecessaryImportsProvider.cs (1)
35if (diagnostic.Id == "CS8019" &&
Microsoft.CodeAnalysis.Features (25)
AddImport\AbstractAddImportFeatureService.cs (1)
520document, span, diagnostic.Id, maxResultsPerDiagnostic,
AddPackage\AbstractAddSpecificPackageCodeFixProvider.cs (1)
35var assemblyName = GetAssemblyName(context.Diagnostics[0].Id);
CodeFixes\Configuration\ConfigurationUpdater.cs (4)
385if (IDEDiagnosticIdToOptionMappingHelper.TryGetMappedOptions(diagnostic.Id, project.Language, out var options)) 528foundMatch = string.Equals(diagId, _diagnostic.Id, StringComparison.OrdinalIgnoreCase); 692? $"{DiagnosticOptionPrefix}{_diagnostic.Id}{SeveritySuffix} = {_newSeverity}" 699? $"{_diagnostic.Id}: {_diagnostic.Descriptor.Title}"
CodeFixes\Configuration\ConfigureCodeStyle\ConfigureCodeStyleOptionCodeFixProvider.cs (1)
50return IDEDiagnosticIdToOptionMappingHelper.TryGetMappedOptions(diagnostic.Id, language, out _);
CodeFixes\Configuration\ConfigureCodeStyle\ConfigureCodeStyleOptionCodeFixProvider.TopLevelConfigureCodeStyleOptionCodeAction.cs (1)
15: base(nestedActions, string.Format(FeaturesResources.Configure_0_code_style, diagnostic.Id))
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (2)
82if (diagnostic.Id == IDEDiagnosticIds.FormattingDiagnosticId) 89return diagnostic.Id;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (1)
224if (uniqueIds.Add(diagnostic.Id))
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaBatchFixHelpers.cs (1)
72id: diagnostic.Id,
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaWarningCodeAction.cs (1)
57=> _forFixMultipleContext ? string.Empty : _diagnostic.Id;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.cs (2)
53: base(fixer, title: string.Format(FeaturesResources.Remove_Suppression_0, diagnostic.Id)) 64=> _forFixMultipleContext ? string.Empty : _diagnostic.Id;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Pragma.cs (1)
135if (fixer.IsAnyPragmaDirectiveForId(trivia, diagnostic.Id, out var isEnableDirective, out var hasMultipleIds))
CodeFixes\Suppression\SuppressionHelpers.cs (1)
32return diagnostic.Id != IDEDiagnosticIds.FormattingDiagnosticId;
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
549if (!idToPragmasMap.TryGetValue(diagnostic.Id, out var pragmasForIdInReverseOrder)) 591!idToSuppressMessageAttributesMap.TryGetValue(diagnostic.Id, out var suppressMessageAttributesForId))
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (2)
81document, semanticModel, root, diagnostic.Id, spanNode, cancellationToken); 230document, semanticModel, root, diagnostics[0].Id, spanNode, cancellationToken);
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (2)
101if (TooManyArgumentsDiagnosticIds.Contains(diagnostic.Id)) 106if (CannotConvertDiagnosticIds.Contains(diagnostic.Id))
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (2)
248diagnosticId = diagnostics[0].Id; 255Debug.Assert(diagnosticId == diagnostic.Id);
Microsoft.CodeAnalysis.LanguageServer.Protocol (6)
Features\Diagnostics\DocumentAnalysisExecutor.cs (1)
361switch (d.Id)
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (5)
309await VerifyDiagnosticLocationAsync(diagnostic.Id, diagnostic.Location).ConfigureAwait(false); 315await VerifyDiagnosticLocationAsync(diagnostic.Id, location).ConfigureAwait(false); 442return x.Id == y.Id && x.Location == y.Location; 450return Hash.Combine(obj.Id.GetHashCode(), obj.Location.GetHashCode());
Microsoft.CodeAnalysis.Test.Utilities (8)
Diagnostics\CommonDiagnosticAnalyzers.cs (5)
524var descriptor = diagnostic.Id == Descriptor1.SuppressedDiagnosticId ? Descriptor1 : Descriptor2; 2175Assert.Equal(SuppressionDescriptor.SuppressedDiagnosticId, diagnostic.Id); 2208if (suppressionDescriptor.SuppressedDiagnosticId == diagnostic.Id) 2308Assert.Equal(_unsupportedDescriptor.SuppressedDiagnosticId, diagnostic.Id); 2340Assert.Equal(_supportedDescriptor.SuppressedDiagnosticId, diagnostic.Id);
Diagnostics\DiagnosticDescription.cs (1)
136_code = d.Id;
Diagnostics\DiagnosticExtensions.cs (1)
446=> e.Location.IsInSource ? $"{e.Severity} {e.Id}: {e.GetMessage(CultureInfo.CurrentCulture)}" :
Diagnostics\DiagnosticsHelper.cs (1)
27var actualDiagnosticIds = actualDiagnostics.Select(d => d.Id);
Microsoft.CodeAnalysis.VisualBasic (1)
Compilation\VisualBasicDiagnosticFilter.vb (1)
85diagnostic.Id,
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Helpers\RemoveUnnecessaryImports\VisualBasicUnnecessaryImportsProvider.vb (2)
37If diagnostic.Id = BC50000 Then 44If diagnostic.Id = BC50001 Then
Microsoft.CodeAnalysis.VisualBasic.Features (2)
CodeFixes\Suppression\VisualBasicSuppressionCodeFixProvider.vb (2)
183Dim ruleIdText = If(String.IsNullOrWhiteSpace(title), diagnostic.Id, String.Format("{0}:{1}", diagnostic.Id, title))
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
SourceGeneration\GeneratorDriverTests.vb (1)
734Assert.Equal("BC" & CInt(errorCode), diagnostic.Id)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (1)
CompilationTestUtils.vb (1)
1005Dim message = e.Id + ": " + e.GetMessage(EnsureEnglishUICulture.PreferredOrNull)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (5)
CodeCleanup\Providers\ReduceTokensCodeCleanupProvider.vb (1)
331Return diagnostics.Any(Function(diagnostic As Diagnostic) diagnostic.Id = "BC30036")
Simplification\VisualBasicSimplificationService.vb (2)
169If diagnostic.Id = s_BC50000_UnusedImportsClause OrElse diagnostic.Id = s_BC50001_UnusedImportsStatement Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Helpers\RemoveUnnecessaryImports\VisualBasicUnnecessaryImportsProvider.vb (2)
37If diagnostic.Id = BC50000 Then 44If diagnostic.Id = BC50001 Then
Microsoft.CodeAnalysis.Workspaces (13)
CodeFixes\CodeFixContext.cs (4)
75/// Additionally, the <see cref="Diagnostic.Id"/> of each diagnostic must be in the set of the <see cref="CodeFixProvider.FixableDiagnosticIds"/> of the associated <see cref="CodeFixProvider"/>. 107/// Additionally, the <see cref="Diagnostic.Id"/> of each diagnostic must be in the set of the <see cref="CodeFixProvider.FixableDiagnosticIds"/> of the associated <see cref="CodeFixProvider"/>. 138/// The <see cref="Diagnostic.Id"/> of this diagnostic must be in the set of the <see cref="CodeFixProvider.FixableDiagnosticIds"/> of the associated <see cref="CodeFixProvider"/>. 163/// The <see cref="Diagnostic.Id"/> of this diagnostic must be in the set of the <see cref="CodeFixProvider.FixableDiagnosticIds"/> of the associated <see cref="CodeFixProvider"/>.
CodeFixes\CodeFixProvider.cs (1)
30/// The context must only contain diagnostics with a <see cref="Diagnostic.Id"/> included in the <see cref="FixableDiagnosticIds"/> for the current provider.
CodeFixes\FixAllOccurrences\FixAllContext.cs (1)
251return diagnostics.Where(d => d != null && diagnosticIds.Contains(d.Id)
CodeFixes\FixAllOccurrences\FixAllState.cs (1)
113uniqueIds.Add(diagnostic.Id);
CodeFixesAndRefactorings\FixAllProviderInfo.cs (1)
121=> supportedDiagnosticIds.Contains(diagnostic.Id);
Diagnostics\DiagnosticData.cs (1)
229diagnostic.Id,
Diagnostics\Extensions.cs (1)
311diagnosticIdsToFilter.Contains(diagnostic.Id) ||
Shared\Extensions\TelemetryExtensions.cs (1)
58return diagnostic.Id;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
185diag => diag.Severity == DiagnosticSeverity.Error && !ignoreErrorCode.Contains(diag.Id));
Workspace\Solution\SolutionCompilationState.SkeletonReferenceCache.cs (1)
283var groups = emitResult.Diagnostics.GroupBy(d => d.Id).Select(g => $"{g.Key}:{g.Count()}");
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
SolutionTests\SolutionTests.cs (2)
4705Assert.Equal("CS8602", diagnostic.Id); 4726Assert.Contains("CS8669", diagnostic.Id);
Microsoft.Gen.ComplianceReports.Unit.Tests (5)
GeneratorTests.cs (1)
133Assert.Equal("AUDREPGEN001", diag.Id);
test\Generators\Shared\RoslynTestUtils.cs (4)
139Assert.True(expected.Id == actual.Id, 166Assert.True(expected.Id == d.Id, 191if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal)) 210if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal))
Microsoft.Gen.ContextualOptions.Unit.Tests (4)
test\Generators\Shared\RoslynTestUtils.cs (4)
139Assert.True(expected.Id == actual.Id, 166Assert.True(expected.Id == d.Id, 191if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal)) 210if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal))
Microsoft.Gen.Logging.Unit.Tests (14)
AttributeParserTests.cs (4)
142Assert.Equal(DiagDescriptors.MissingLoggerParameter.Id, diagnostics[0].Id); 170Assert.Equal(DiagDescriptors.LoggingMethodShouldBeStatic.Id, diagnostics[0].Id); 192Assert.Equal(DiagDescriptors.CantUseDataClassificationWithLogPropertiesOrTagProvider.Id, diagnostics[0].Id); 222Assert.Equal(DiagDescriptors.CantUseDataClassificationWithLogPropertiesOrTagProvider.Id, diagnostics[0].Id);
EmitterTests.cs (5)
56=> diag.Id != DiagDescriptors.ShouldntMentionExceptionInMessage.Id 57&& diag.Id != DiagDescriptors.ShouldntMentionLoggerInMessage.Id 58&& diag.Id != DiagDescriptors.ShouldntMentionLogLevelInMessage.Id 59&& diag.Id != DiagDescriptors.EmptyLoggingMethod.Id 60&& diag.Id != DiagDescriptors.ParameterHasNoCorrespondingTemplate.Id);
LogParserUtilitiesTests.cs (1)
197diagMock.Verify(x => x.Invoke(It.Is<Diagnostic>(d => d.Id == DiagDescriptors.LogPropertiesParameterSkipped.Id)), Times.Once);
test\Generators\Shared\RoslynTestUtils.cs (4)
139Assert.True(expected.Id == actual.Id, 166Assert.True(expected.Id == d.Id, 191if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal)) 210if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal))
Microsoft.Gen.Metrics.Unit.Tests (34)
ParserTests.cs (19)
30Assert.Equal(DiagDescriptors.ErrorInvalidMethodName.Id, d[0].Id); 46Assert.Equal(DiagDescriptors.ErrorInvalidMethodReturnTypeLocation.Id, d[0].Id); 62Assert.Equal(DiagDescriptors.ErrorInvalidMethodReturnTypeArity.Id, d[0].Id); 83Assert.Equal(DiagDescriptors.ErrorInvalidMethodReturnType.Id, d[0].Id); 110Assert.Equal(DiagDescriptors.ErrorInvalidAttributeGenericType.Id, d[0].Id); 124Assert.Equal(DiagDescriptors.ErrorInvalidTagNames.Id, d[0].Id); 138Assert.Equal(DiagDescriptors.ErrorInvalidTagNames.Id, d[0].Id); 178Assert.Equal(DiagDescriptors.ErrorNotPartialMethod.Id, d[0].Id); 192Assert.Equal(DiagDescriptors.ErrorNotStaticMethod.Id, d[0].Id); 206Assert.Equal(DiagDescriptors.ErrorInvalidMetricName.Id, d[0].Id); 220Assert.Equal(DiagDescriptors.ErrorInvalidMetricName.Id, d[0].Id); 234Assert.Equal(DiagDescriptors.ErrorMethodIsGeneric.Id, d[0].Id); 248Assert.Equal(DiagDescriptors.ErrorInvalidParameterName.Id, d[0].Id); 357Assert.Equal(DiagDescriptors.ErrorMetricNameReuse.Id, d[0].Id); 405Assert.Equal(DiagDescriptors.ErrorMissingMeter.Id, diag.Id); 419Assert.Equal(DiagDescriptors.ErrorMissingMeter.Id, diag.Id); 434Assert.Equal(DiagDescriptors.ErrorMethodHasBody.Id, d[0].Id); 616Assert.Equal(DiagDescriptors.ErrorGaugeNotSupported.Id, d[0].Id); 699Assert.Equal(DiagDescriptors.ErrorXmlNotLoadedCorrectly.Id, d[0].Id);
ParserTests.Diagnostics.cs (11)
34Assert.Equal(DiagDescriptors.ErrorTagTypeCycleDetected.Id, diag.Id); 64Assert.Equal(DiagDescriptors.ErrorTagTypeCycleDetected.Id, diag.Id); 95Assert.Equal(DiagDescriptors.ErrorTagTypeCycleDetected.Id, diag.Id); 125Assert.Equal(DiagDescriptors.ErrorGaugeNotSupported.Id, d[0].Id); 191Assert.Equal(DiagDescriptors.ErrorGaugeNotSupported.Id, d[0].Id); 216Assert.Equal(DiagDescriptors.ErrorDuplicateTagName.Id, d[0].Id); 243Assert.Equal(DiagDescriptors.ErrorDuplicateTagName.Id, d[0].Id); 274Assert.Equal(DiagDescriptors.ErrorDuplicateTagName.Id, d[0].Id); 305Assert.Equal(DiagDescriptors.ErrorDuplicateTagName.Id, d[0].Id); 359Assert.Equal(DiagDescriptors.ErrorInvalidTagNameType.Id, d[0].Id); 385Assert.Equal(DiagDescriptors.ErrorTooManyTagNames.Id, d[0].Id);
test\Generators\Shared\RoslynTestUtils.cs (4)
139Assert.True(expected.Id == actual.Id, 166Assert.True(expected.Id == d.Id, 191if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal)) 210if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal))
Microsoft.Gen.MetricsReports.Unit.Tests (4)
test\Generators\Shared\RoslynTestUtils.cs (4)
139Assert.True(expected.Id == actual.Id, 166Assert.True(expected.Id == d.Id, 191if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal)) 210if (diagnostic.Id.Equals(f.Id, StringComparison.Ordinal))
Microsoft.Interop.LibraryImportGenerator (2)
Analyzers\CustomMarshallerAttributeFixer.cs (1)
136if (diagnostic.Id == AnalyzerDiagnostics.Ids.CustomMarshallerTypeMustHaveRequiredShape)
Analyzers\ShapeBreakingDiagnosticSuppressor.cs (1)
26if (diagnostic.Id == MarkMethodsAsStaticSuppression.SuppressedDiagnosticId)
Microsoft.ML.InternalCodeAnalyzer (2)
ContractsCheckNameofFixProvider.cs (1)
36var diagnostic = context.Diagnostics.FirstOrDefault(d => d.Id == Id);
NameFixProvider.cs (1)
99c => RenameAsync(context.Document, token.Parent, originalName, renamer, c), diagnostic.Id), diagnostic);
Microsoft.VisualStudio.LanguageServices (1)
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (1)
463return codeFixService.GetSuppressionFixer(language, diagnostics.Select(d => d.Id));
Mvc.Api.Analyzers.Test (7)
ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzerIntegrationTest.cs (1)
77Assert.Equal(descriptor.Id, diagnostic.Id);
ApiConventionAnalyzerIntegrationTest.cs (6)
78var diagnostic = Assert.Single(result, d => d.Id == ApiDiagnosticDescriptors.API1000_ActionReturnsUndocumentedStatusCode.Id); 109Assert.DoesNotContain(result, d => d.Id == ApiDiagnosticDescriptors.API1000_ActionReturnsUndocumentedStatusCode.Id); 139Assert.Contains(result, d => d.Id == ApiDiagnosticDescriptors.API1000_ActionReturnsUndocumentedStatusCode.Id); 171Assert.Contains(result, d => d.Id == ApiDiagnosticDescriptors.API1000_ActionReturnsUndocumentedStatusCode.Id); 205Assert.Contains(result, d => d.Id == ApiDiagnosticDescriptors.API1000_ActionReturnsUndocumentedStatusCode.Id); 293Assert.Equal(descriptor.Id, diagnostic.Id);