1 write to Id
Microsoft.CodeAnalysis (1)
Diagnostic\DiagnosticDescriptor.cs (1)
184this.Id = id;
1022 references to Id
BuildActionTelemetryTable (8)
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,
CodeStyleConfigFileGenerator (4)
Program.cs (4)
63allRulesById[rule.Id] = rule; 149result.AppendLine($"# {rule.Id}: {rule.Title}"); 150result.AppendLine($"dotnet_diagnostic.{rule.Id}.severity = {severityString}"); 157$"DiagnosticDescriptor for '{rule.Id}' must have a {nameof(EnforceOnBuild)} custom tag");
GenerateRulesMissingDocumentation (1)
Program.cs (1)
161allRulesById[rule.Id] = rule;
ILLink.CodeFixProvider (4)
DynamicallyAccessedMembersCodeFixProvider.cs (1)
64 public sealed override ImmutableArray<string> FixableDiagnosticIds => SupportedDiagnostics.Select (dd => dd.Id).ToImmutableArray ();
RequiresAssemblyFilesCodeFixProvider.cs (1)
25 public sealed override ImmutableArray<string> FixableDiagnosticIds => SupportedDiagnostics.Select (dd => dd.Id).ToImmutableArray ();
RequiresDynamicCodeCodeFixProvider.cs (1)
22 public sealed override ImmutableArray<string> FixableDiagnosticIds => SupportedDiagnostics.Select (dd => dd.Id).ToImmutableArray ();
RequiresUnreferencedCodeCodeFixProvider.cs (1)
22 public sealed override ImmutableArray<string> FixableDiagnosticIds => SupportedDiagnostics.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 (5)
CallAnalysis\LegacyLoggingTests.cs (1)
771Assert.Equal(DiagDescriptors.LegacyLogging.Id, f.FixableDiagnosticIds[0]);
MakeExeTypesInternalTests.cs (1)
173Assert.Equal(DiagDescriptors.MakeExeTypesInternal.Id, f.FixableDiagnosticIds[0]);
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 (12)
ApiLifecycle\ApiLifecycleAnalyzerTest.cs (9)
106new [] { DiagDescriptors.NewSymbolsMustBeMarkedExperimental.Id }, 128new [] { DiagDescriptors.NewSymbolsMustBeMarkedExperimental.Id }, 198new[] { DiagDescriptors.PublishedSymbolsCantChange.Id }, 256new[] { DiagDescriptors.PublishedSymbolsCantChange.Id }, 481new[] { DiagDescriptors.NewSymbolsMustBeMarkedExperimental.Id }, 550new[] { DiagDescriptors.PublishedSymbolsCantBeMarkedExperimental.Id }, 573new[] { DiagDescriptors.PublishedSymbolsCantBeDeleted.Id }, 599new[] { DiagDescriptors.PublishedSymbolsCantBeDeleted.Id }, 632new[] { DiagDescriptors.PublishedSymbolsCantBeDeleted.Id },
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.Analyzer.Testing (2)
DiagnosticAnalyzerRunner.cs (1)
86diags = diags.Where(d => d.Severity == DiagnosticSeverity.Error || analyzer.SupportedDiagnostics.Any(s => s.Id.Equals(d.Id))).ToImmutableArray();
DiagnosticVerifier.cs (1)
109diags = diags.Where(d => d.Severity == DiagnosticSeverity.Error || analyzer.SupportedDiagnostics.Any(s => s.Id.Equals(d.Id))).ToImmutableArray();
Microsoft.AspNetCore.App.Analyzers.Test (1)
RouteHandlers\DetectMisplacedLambdaAttributeTest.cs (1)
170Assert.Equal("CS0103", diagnostic.Descriptor.Id);
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.Analyzers.Tests (23)
ComponentParameterCaptureUnmatchedValuesHasWrongTypeTest.cs (1)
64Id = DiagnosticDescriptors.ComponentParameterCaptureUnmatchedValuesHasWrongType.Id,
ComponentParameterCaptureUnmatchedValuesMustBeUniqueTest.cs (1)
52Id = DiagnosticDescriptors.ComponentParameterCaptureUnmatchedValuesMustBeUnique.Id,
ComponentParameterSettersShouldBePublicTest.cs (3)
78Id = DiagnosticDescriptors.ComponentParameterSettersShouldBePublic.Id, 88Id = DiagnosticDescriptors.ComponentParameterSettersShouldBePublic.Id, 98Id = DiagnosticDescriptors.ComponentParameterSettersShouldBePublic.Id,
ComponentParameterShouldBeAutoPropertiesTest.cs (2)
102Id = DiagnosticDescriptors.ComponentParametersShouldBeAutoProperties.Id, 141Id = DiagnosticDescriptors.ComponentParametersShouldBeAutoProperties.Id,
ComponentParametersShouldBePublicCodeFixProviderTest.cs (4)
45Id = DiagnosticDescriptors.ComponentParametersShouldBePublic.Id, 85Id = DiagnosticDescriptors.ComponentParameterSettersShouldBePublic.Id, 95Id = DiagnosticDescriptors.ComponentParameterSettersShouldBePublic.Id, 105Id = DiagnosticDescriptors.ComponentParameterSettersShouldBePublic.Id,
ComponentParametersShouldBePublicTest.cs (4)
63Id = DiagnosticDescriptors.ComponentParametersShouldBePublic.Id, 73Id = DiagnosticDescriptors.ComponentParametersShouldBePublic.Id, 83Id = DiagnosticDescriptors.ComponentParametersShouldBePublic.Id, 93Id = DiagnosticDescriptors.ComponentParametersShouldBePublic.Id,
ComponentParameterUsageAnalyzerTest.cs (5)
50Id = DiagnosticDescriptors.ComponentParametersShouldNotBeSetOutsideOfTheirDeclaredComponent.Id, 81Id = DiagnosticDescriptors.ComponentParametersShouldNotBeSetOutsideOfTheirDeclaredComponent.Id, 112Id = DiagnosticDescriptors.ComponentParametersShouldNotBeSetOutsideOfTheirDeclaredComponent.Id, 143Id = DiagnosticDescriptors.ComponentParametersShouldNotBeSetOutsideOfTheirDeclaredComponent.Id, 174Id = DiagnosticDescriptors.ComponentParametersShouldNotBeSetOutsideOfTheirDeclaredComponent.Id,
Verifiers\DiagnosticVerifier.cs (3)
249if (rule != null && rule.Id == diagnostics[i].Id) 254builder.AppendFormat(CultureInfo.InvariantCulture, "GetGlobalResult({0}.{1})", analyzerType.Name, rule.Id); 271rule.Id);
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
ComponentParametersShouldBePublicCodeFixProvider.cs (1)
23=> ImmutableArray.Create(DiagnosticDescriptors.ComponentParametersShouldBePublic.Id);
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (21)
ComponentParameterCaptureUnmatchedValuesHasWrongTypeTest.cs (1)
64Id = DiagnosticDescriptors.ComponentParameterCaptureUnmatchedValuesHasWrongType.Id,
ComponentParameterCaptureUnmatchedValuesMustBeUniqueTest.cs (1)
52Id = DiagnosticDescriptors.ComponentParameterCaptureUnmatchedValuesMustBeUnique.Id,
ComponentParameterSettersShouldBePublicTest.cs (3)
78Id = DiagnosticDescriptors.ComponentParameterSettersShouldBePublic.Id, 88Id = DiagnosticDescriptors.ComponentParameterSettersShouldBePublic.Id, 98Id = DiagnosticDescriptors.ComponentParameterSettersShouldBePublic.Id,
ComponentParametersShouldBePublicCodeFixProviderTest.cs (4)
45Id = DiagnosticDescriptors.ComponentParametersShouldBePublic.Id, 85Id = DiagnosticDescriptors.ComponentParameterSettersShouldBePublic.Id, 95Id = DiagnosticDescriptors.ComponentParameterSettersShouldBePublic.Id, 105Id = DiagnosticDescriptors.ComponentParameterSettersShouldBePublic.Id,
ComponentParametersShouldBePublicTest.cs (4)
63Id = DiagnosticDescriptors.ComponentParametersShouldBePublic.Id, 73Id = DiagnosticDescriptors.ComponentParametersShouldBePublic.Id, 83Id = DiagnosticDescriptors.ComponentParametersShouldBePublic.Id, 93Id = DiagnosticDescriptors.ComponentParametersShouldBePublic.Id,
ComponentParameterUsageAnalyzerTest.cs (5)
50Id = DiagnosticDescriptors.ComponentParametersShouldNotBeSetOutsideOfTheirDeclaredComponent.Id, 81Id = DiagnosticDescriptors.ComponentParametersShouldNotBeSetOutsideOfTheirDeclaredComponent.Id, 112Id = DiagnosticDescriptors.ComponentParametersShouldNotBeSetOutsideOfTheirDeclaredComponent.Id, 143Id = DiagnosticDescriptors.ComponentParametersShouldNotBeSetOutsideOfTheirDeclaredComponent.Id, 174Id = DiagnosticDescriptors.ComponentParametersShouldNotBeSetOutsideOfTheirDeclaredComponent.Id,
Verifiers\DiagnosticVerifier.cs (3)
249if (rule != null && rule.Id == diagnostics[i].Id) 254builder.AppendFormat(CultureInfo.InvariantCulture, "GetGlobalResult({0}.{1})", analyzerType.Name, rule.Id); 271rule.Id);
Microsoft.AspNetCore.Http.Extensions.Tests (13)
RequestDelegateGenerator\CompileTimeCreationTests.AsParameters.cs (7)
33Assert.Equal(DiagnosticDescriptors.InvalidAsParametersNullable.Id, diagnostic.Id); 55new object[] { "BadArgumentListRecord", DiagnosticDescriptors.InvalidAsParametersSingleConstructorOnly.Id, GetMultipleContructorsError(typeof(BadArgumentListRecord)) }, 56new object[] { "BadArgumentListClass", DiagnosticDescriptors.InvalidAsParametersSignature.Id, GetInvalidConstructorError(typeof(BadArgumentListClass)) }, 57new object[] { "BadArgumentListClassMultipleCtors", DiagnosticDescriptors.InvalidAsParametersSingleConstructorOnly.Id, GetMultipleContructorsError(typeof(BadArgumentListClassMultipleCtors)) }, 58new object[] { "BadAbstractArgumentListClass", DiagnosticDescriptors.InvalidAsParametersAbstractType.Id, GetAbstractTypeError(typeof(BadAbstractArgumentListClass)) }, 59new object[] { "BadNoPublicConstructorArgumentListClass", DiagnosticDescriptors.InvalidAsParametersNoConstructorFound.Id, GetNoContructorsError(typeof(BadNoPublicConstructorArgumentListClass)) }, 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)
46Assert.Contains(result.Value.Diagnostics, diagnostic => diagnostic.Id == DiagnosticDescriptors.KeyedAndNotKeyedServiceAttributesNotSupported.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)
109_ => 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)
87get { return _descriptor.Id; }
Diagnostic\DiagnosticDescriptor.cs (3)
208this.Id == other.Id && 225Hash.Combine(this.Id.GetHashCode(),
DiagnosticAnalyzer\AnalyzerDriver.cs (7)
921if (!uniqueDiagnosticIds.Add(descriptor.Id)) 929SuppressedDiagnosticIdsForUnsuppressedAnalyzers.Contains(descriptor.Id); 953if (compilation.Options.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var severity) || 954compilation.Options.SyntaxTreeOptionsProvider?.TryGetGlobalDiagnosticValue(descriptor.Id, cancellationToken, out severity) == true) 980if (syntaxTreeProvider.TryGetDiagnosticValue(tree, descriptor.Id, cancellationToken, out severity) || 1394if (options.TryGetDiagnosticValue(tree, descriptor.Id, cancellationToken, out var severityFromOptions) || 1395options.TryGetGlobalDiagnosticValue(descriptor.Id, cancellationToken, out severityFromOptions))
DiagnosticAnalyzer\AnalyzerExecutor.cs (1)
1276diagnosticIds = diagnosticIds.Add(diagnostic.Id);
DiagnosticAnalyzer\AnalyzerManager.cs (4)
286if (descriptor.Id.Equals(diagnostic.Id, StringComparison.OrdinalIgnoreCase)) 322if (treeOptions.TryGetDiagnosticValue(tree, descriptor.Id, cancellationToken, out var configuredValue) || 389if ((diagnosticOptions.TryGetValue(diag.Id, out var severity) && severity != ReportDiagnostic.Default) || 390(options.SyntaxTreeOptionsProvider is object && options.SyntaxTreeOptionsProvider.TryGetGlobalDiagnosticValue(diag.Id, cancellationToken, out severity)))
DiagnosticAnalyzer\AnalyzerOptionsExtensions.cs (3)
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)
Microsoft.CodeAnalysis.CodeStyle (17)
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs (2)
89AddDiagnosticIdToOptionMapping(descriptor.Id, option); 103AddDiagnosticIdToOptionMapping(descriptor.Id, options);
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\Analyzers\Core\Analyzers\AbstractBuiltInUnnecessaryCodeStyleDiagnosticAnalyzer.cs (2)
95AddDiagnosticIdToFadingOptionMapping(descriptor.Id, fadingOption); 134IDEDiagnosticIdToOptionMappingHelper.AddFadingOptionMapping(descriptor.Id, fadingOption);
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (1)
271descriptor.Id,
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
427if (!idsToAnalyze.Contains(descriptor.Id)) 435unhandledIds.Add(descriptor.Id);
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.CodeStyle.UnitTests (1)
src\Analyzers\CSharp\Tests\SimplifyInterpolation\SimplifyInterpolationTests.cs (1)
50diagnostics.Select(d => (d.Descriptor.Id, d.Severity)));
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (29)
CommandLineTests.cs (23)
9600Assert.Contains(AnalyzerThatThrowsInGetMessage.Rule.Id, output, StringComparison.Ordinal); 9647Assert.Contains(AnalyzerThatThrowsInGetMessage.Rule.Id, output, StringComparison.Ordinal); 13066Assert.Contains($"warning {analyzer.Descriptor.Id}", output, StringComparison.Ordinal); 13070var suppressor = new DiagnosticSuppressorForId(analyzer.Descriptor.Id); 13084Assert.DoesNotContain($"warning {analyzer.Descriptor.Id}", output, StringComparison.Ordinal); 13093Assert.Contains($"error {analyzer.Descriptor.Id}", output, StringComparison.Ordinal); 13102Assert.DoesNotContain($"warning {analyzer.Descriptor.Id}", output, StringComparison.Ordinal); 13108suppressor = new DiagnosticSuppressorForId(analyzer.Descriptor.Id); 13113Assert.Contains($"warning {analyzer.Descriptor.Id}", output, StringComparison.Ordinal); 13133Assert.Contains($"error {analyzer.Descriptor.Id}", output, StringComparison.Ordinal); 13136var suppressor = new DiagnosticSuppressorForId(analyzer.Descriptor.Id); 13141Assert.Contains($"error {analyzer.Descriptor.Id}", output, StringComparison.Ordinal); 13156var diagnosticId = analyzer.Descriptor.Id; 13260var diagnosticId = analyzer.Descriptor.Id; 13346var diagnosticId = analyzer.Descriptor.Id; 13394var diagnosticId = analyzer.Descriptor.Id; 13613Assert.Contains($"{expectedDiagnosticSeverity} {WarningDiagnosticAnalyzer.Warning01.Id}", output); 13649dotnet_diagnostic.{descriptor.Id}.severity = {analyzerConfigSeverity.ToAnalyzerConfigString()}"); 13663arguments = arguments.Append($"/nowarn:{descriptor.Id}"); 13689Assert.Contains($"{prefix} {descriptor.Id}: {descriptor.MessageFormat}", outWriter.ToString()); 13693Assert.DoesNotContain(descriptor.Id.ToString(), outWriter.ToString()); 13791var diagnosticId = analyzer.Descriptor.Id; 13864var diagnosticId = analyzer.Descriptor.Id;
SarifErrorLoggerTests.cs (2)
153Assert.Contains(AnalyzerForErrorLogTest.Descriptor1.Id, actualConsoleOutput); 154Assert.Contains(AnalyzerForErrorLogTest.Descriptor2.Id, actualConsoleOutput);
SarifV2ErrorLoggerTests.cs (4)
377(AnalyzerForErrorLogTest.Descriptor1.Id, 0, ImmutableHashSet.Create(ReportDiagnostic.Error)))); 498(AnalyzerForErrorLogTest.Descriptor1.Id, 0, ImmutableHashSet.Create(ReportDiagnostic.Suppress)), 499(AnalyzerForErrorLogTest.Descriptor2.Id, 1, ImmutableHashSet.Create(ReportDiagnostic.Suppress)))); 580(AnalyzerForErrorLogTest.Descriptor1.Id, 0, ImmutableHashSet.Create(ReportDiagnostic.Suppress, ReportDiagnostic.Warn))));
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (3)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (2)
262var diagnosticsFromAnalyzer = diagnostics.Where(d => d.Id == CodeBlockAnalyzerFactory.Descriptor.Id); 281var diagnosticsFromAnalyzer = diagnostics.Where(d => d.Id == CodeBlockAnalyzerFactory.Descriptor.Id);
Diagnostics\FixAllProvider\BatchFixerTests.cs (1)
67return ImmutableArray.Create(QualifyWithThisAnalyzer.Descriptor.Id);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (293)
Diagnostics\DiagnosticAnalyzerTests.cs (51)
317specificDiagOptions.Add(noneDiagDescriptor.Id, ReportDiagnostic.Error); 318specificDiagOptions.Add(infoDiagDescriptor.Id, ReportDiagnostic.Error); 319specificDiagOptions.Add(warningDiagDescriptor.Id, ReportDiagnostic.Error); 332specificDiagOptions.Add(noneDiagDescriptor.Id, ReportDiagnostic.Suppress); 333specificDiagOptions.Add(infoDiagDescriptor.Id, ReportDiagnostic.Suppress); 334specificDiagOptions.Add(warningDiagDescriptor.Id, ReportDiagnostic.Suppress); 335specificDiagOptions.Add(errorDiagDescriptor.Id, ReportDiagnostic.Suppress); 344specificDiagOptions.Add(noneDiagDescriptor.Id, ReportDiagnostic.Info); 345specificDiagOptions.Add(infoDiagDescriptor.Id, ReportDiagnostic.Hidden); 346specificDiagOptions.Add(warningDiagDescriptor.Id, ReportDiagnostic.Error); 347specificDiagOptions.Add(errorDiagDescriptor.Id, ReportDiagnostic.Warn); 361Assert.Equal(infoDiagDescriptor.Id, effectiveDiag.Id); 365Assert.Equal(noneDiagDescriptor.Id, effectiveDiag.Id); 369Assert.Equal(errorDiagDescriptor.Id, effectiveDiag.Id); 373Assert.Equal(warningDiagDescriptor.Id, effectiveDiag.Id); 459specificDiagOptions.Add(disabledDiagDescriptor.Id, ReportDiagnostic.Warn); 460specificDiagOptions.Add(enabledDiagDescriptor.Id, ReportDiagnostic.Suppress); 531specificDiagOptions.Add(FullyDisabledAnalyzer.desc1.Id, ReportDiagnostic.Warn); 532specificDiagOptions.Add(PartiallyDisabledAnalyzer.desc2.Id, ReportDiagnostic.Suppress); 540specificDiagOptions.Add(FullyDisabledAnalyzer.desc3.Id, ReportDiagnostic.Warn); 727var id = Int32.Parse(descriptor.Id.Substring(2)); 729var message = string.Format("Add resource string named '{0}' for Title of '{1}' to '{2}'", missingResource, descriptor.Id, nameof(CSharpResources)); 739var message = string.Format("'{0}' must have a non-null non-empty 'Category'", descriptor.Id); 854string message = new ArgumentException(string.Format(CodeAnalysisResources.UnsupportedDiagnosticReported, AnalyzerReportingUnsupportedDiagnostic.UnsupportedDescriptor.Id), "diagnostic").Message; 912string message = new ArgumentException(string.Format(CodeAnalysisResources.InvalidDiagnosticIdReported, AnalyzerWithInvalidDiagnosticId.Descriptor.Id), "diagnostic").Message; 1015string.Format(CodeAnalysisResources.InvalidDiagnosticLocationReported, AnalyzerWithInvalidDiagnosticLocation.Descriptor.Id, treeInAnotherCompilation.FilePath), "diagnostic").Message; 1108string.Format(CodeAnalysisResources.InvalidDiagnosticSpanReported, AnalyzerWithInvalidDiagnosticSpan.Descriptor.Id, badSpan, treeInAnotherCompilation.FilePath), "diagnostic").Message; 1137.VerifyAnalyzerDiagnostics(analyzers, null, null, expected: Diagnostic(NotConfigurableDiagnosticAnalyzer.EnabledRule.Id)); 1141specificDiagOptions.Add(NotConfigurableDiagnosticAnalyzer.EnabledRule.Id, ReportDiagnostic.Suppress); 1146.VerifyAnalyzerDiagnostics(analyzers, null, null, expected: Diagnostic(NotConfigurableDiagnosticAnalyzer.EnabledRule.Id)); 1150specificDiagOptions.Add(NotConfigurableDiagnosticAnalyzer.DisabledRule.Id, ReportDiagnostic.Warn); 1155.VerifyAnalyzerDiagnostics(analyzers, null, null, expected: Diagnostic(NotConfigurableDiagnosticAnalyzer.EnabledRule.Id)); 1172Diagnostic(CodeBlockActionAnalyzer.CodeBlockTopLevelRule.Id, "M").WithArguments("M").WithLocation(4, 17), 1173Diagnostic(CodeBlockActionAnalyzer.CodeBlockPerCompilationRule.Id, "M").WithArguments("M").WithLocation(4, 17) 1190.VerifyAnalyzerDiagnostics(analyzers, null, null, expected: Diagnostic(CodeBlockActionAnalyzer.CodeBlockTopLevelRule.Id, "M").WithArguments("M").WithLocation(4, 17)); 1368Diagnostic(CSharpCodeBlockObjectCreationAnalyzer.DiagnosticDescriptor.Id, "new C()").WithLocation(5, 18) 1432expected[i] = Diagnostic(ConcurrentAnalyzer.Descriptor.Id, typeName) 1688Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.Id, "0").WithLocation(12, 17), 1689Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.Id, "x").WithLocation(13, 17), 1690Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.Id, "12").WithLocation(16, 29)); 1834if (((string)builder[i].Code) != GeneratedCodeAnalyzer.Error.Id) 1860var diagnostic = Diagnostic(GeneratedCodeAnalyzer.Warning.Id, squiggledText).WithArguments(arguments).WithLocation(line, column); 1863diagnostic = Diagnostic(GeneratedCodeAnalyzer.Error.Id, squiggledText).WithArguments(arguments).WithLocation(line, column); 1870AddExpectedDiagnostic(builder, descriptor.Id, squiggledText: null, line: 1, column: 1, arguments: arguments); 3719Assert.Equal(((FieldAnalyzer)analyzer).Descriptor.Id, diagnostic.Id); 3903Assert.Equal(analyzer.Descriptor.Id, diagnostic.Id); 3968d => d.Id == analyzer.Descriptor.Id && PathUtilities.Comparer.Equals(d.Location.GetLineSpan().Path, additionalFile.Path)); 4185new TestSyntaxTreeOptionsProvider(tree1, (AnalyzerWithDisabledRules.Rule.Id, ReportDiagnostic.Warn))); 4195.WithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>.Empty.Add(AnalyzerWithDisabledRules.Rule.Id, ReportDiagnostic.Warn)) 4197(tree2, new[] { (AnalyzerWithDisabledRules.Rule.Id, ReportDiagnostic.Suppress) }), 4198(tree3, new[] { (AnalyzerWithDisabledRules.Rule.Id, ReportDiagnostic.Suppress) })));
Diagnostics\DiagnosticSuppressorTests.cs (37)
235Diagnostic(analyzer.Descriptor.Id, source1, isSuppressed: false).WithLocation(1, 1), 236Diagnostic(analyzer.Descriptor.Id, source2, isSuppressed: false).WithLocation(1, 1), 240var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, new DiagnosticSuppressorForId(analyzer.Descriptor.Id) }; 242Diagnostic(analyzer.Descriptor.Id, source1, isSuppressed: true).WithLocation(1, 1), 243Diagnostic(analyzer.Descriptor.Id, source2, isSuppressed: true).WithLocation(1, 1), 257var expectedDiagnostic = Diagnostic(analyzer.Descriptor.Id, source, isSuppressed: false).WithLocation(1, 1); 261expectedDiagnostic = Diagnostic(analyzer.Descriptor.Id, source, isSuppressed: true).WithLocation(1, 1); 262var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, new DiagnosticSuppressorForId(analyzer.Descriptor.Id), new DiagnosticSuppressorForId(analyzer.Descriptor.Id) }; 267analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, new DiagnosticSuppressorForId(analyzer.Descriptor.Id, suppressionId: "SPR0001"), new DiagnosticSuppressorForId(analyzer.Descriptor.Id, suppressionId: "SPR0002") }; 284Diagnostic(analyzer.Descriptor.Id, source)); 287var suppressor2 = new DiagnosticSuppressorForId(analyzer.Descriptor.Id); 292Diagnostic(analyzer.Descriptor.Id, source, isSuppressed: true)); 305var expectedDiagnostic = Diagnostic(analyzer.Descriptor.Id, source, isSuppressed: false); 309var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, new DiagnosticSuppressorForId(analyzer.Descriptor.Id, suppressionId) }; 310expectedDiagnostic = Diagnostic(analyzer.Descriptor.Id, source, isSuppressed: true); 355var suppressor = new DiagnosticSuppressorForId(analyzer.Descriptor.Id); 360key: analyzer.Descriptor.Id, 434var suppressor = new DiagnosticSuppressorThrowsExceptionFromReportedSuppressions(analyzer.Descriptor.Id, expectedException); 480var suppressor = new DiagnosticSuppressor_UnsupportedSuppressionReported(analyzer.Descriptor.Id, supportedSuppressionId, unsupportedSuppressionId); 533var suppressor = new DiagnosticSuppressor_InvalidDiagnosticSuppressionReported(analyzer.Descriptor.Id, unsupportedSuppressedId); 537var exceptionMessage = string.Format(CodeAnalysisResources.InvalidDiagnosticSuppressionReported, analyzer.Descriptor.Id, unsupportedSuppressedId); 586var suppressor = new DiagnosticSuppressor_NonReportedDiagnosticCannotBeSuppressed(analyzer.Descriptor.Id, nonReportedDiagnosticId); 635var expectedDiagnostic = Diagnostic(analyzer.Descriptor.Id, source); 639var suppressor = new DiagnosticSuppressorForId(analyzer.Descriptor.Id, suppressionId); 650var suppressor2 = new DiagnosticSuppressorForId(analyzer.Descriptor.Id, suppressionId2); 675var expectedDiagnostic = Diagnostic(analyzer.Descriptor.Id, source); 678var suppressor = new DiagnosticSuppressorForId_ThrowsOperationCancelledException(analyzer.Descriptor.Id); 696Diagnostic(analyzer1.Descriptor.Id, source, isSuppressed: false).WithLocation(1, 1), 697Diagnostic(analyzer2.Descriptor.Id, source, isSuppressed: false).WithLocation(1, 1), 703var suppressor = new DiagnosticSuppressorForMultipleIds(analyzer1.Descriptor.Id, analyzer2.Descriptor.Id); 706Diagnostic(analyzer1.Descriptor.Id, source, isSuppressed: true).WithLocation(1, 1), 707Diagnostic(analyzer2.Descriptor.Id, source, isSuppressed: true).WithLocation(1, 1), 721Diagnostic(analyzer1.Descriptor.Id, source, isSuppressed: true).WithLocation(1, 1)); 725Diagnostic(analyzer2.Descriptor.Id, source, isSuppressed: true).WithLocation(1, 1));
Diagnostics\OperationAnalyzerTests.cs (205)
49Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.Id, "new int[0]").WithLocation(6, 22), 50Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.Id, "{ }").WithLocation(7, 23), 51Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.Id, "new C[] { }").WithLocation(8, 20), 52Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.Id, "new int[0][]").WithLocation(12, 24), 53Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.Id, "new int[0][][][]").WithLocation(13, 28), 54Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.Id, "new int[0][,]").WithLocation(15, 26) 111Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.Id, "3").WithLocation(9, 25), 112Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.Id, "v1").WithLocation(9, 34), 113Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.Id, "v3").WithLocation(10, 22), 114Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.Id, "3").WithLocation(13, 21), 115Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.Id, "v3").WithLocation(17, 21), 116Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.Id, "p1").WithLocation(35, 9), 117Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.Id, "this").WithLocation(36, 13), 118Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.Id, "33").WithLocation(45, 21) 141Diagnostic(BadStuffTestAnalyzer.InvalidExpressionDescriptor.Id, "Framitz()").WithLocation(6, 9), 142Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.Id, "Framitz()").WithLocation(6, 9), 143Diagnostic(BadStuffTestAnalyzer.InvalidExpressionDescriptor.Id, "Framitz").WithLocation(6, 9), 144Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.Id, "Framitz").WithLocation(6, 9), 145Diagnostic(BadStuffTestAnalyzer.InvalidExpressionDescriptor.Id, "Bexley()").WithLocation(7, 17), 146Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.Id, "Bexley()").WithLocation(7, 17), 147Diagnostic(BadStuffTestAnalyzer.InvalidExpressionDescriptor.Id, "Bexley").WithLocation(7, 17), 148Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.Id, "Bexley").WithLocation(7, 17), 149Diagnostic(BadStuffTestAnalyzer.InvalidExpressionDescriptor.Id, "M1(y + d)").WithLocation(10, 9), 150Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.Id, "M1(y + d)").WithLocation(10, 9), 151Diagnostic(BadStuffTestAnalyzer.InvalidStatementDescriptor.Id, "goto;").WithLocation(11, 9), 152Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.Id, "goto;").WithLocation(11, 9), 153Diagnostic(BadStuffTestAnalyzer.InvalidStatementDescriptor.Id, "").WithLocation(11, 13), 154Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.Id, "").WithLocation(11, 13) 218Diagnostic(BigForTestAnalyzer.BigForDescriptor.Id, "for (x = 0; x < 2000000; x++) {}").WithLocation(9, 9), 219Diagnostic(BigForTestAnalyzer.BigForDescriptor.Id, "for (x = 3000000; x > 0; x -= 2) {}").WithLocation(13, 9), 220Diagnostic(BigForTestAnalyzer.BigForDescriptor.Id, "for (x = 0; x < 2000000; x = x + 1) {}").WithLocation(17, 9)); 283Diagnostic(SwitchTestAnalyzer.SparseSwitchDescriptor.Id, "y").WithLocation(16, 17), 284Diagnostic(SwitchTestAnalyzer.SparseSwitchDescriptor.Id, "x").WithLocation(26, 17), 285Diagnostic(SwitchTestAnalyzer.NoDefaultSwitchDescriptor.Id, "x").WithLocation(26, 17), 286Diagnostic(SwitchTestAnalyzer.OnlyDefaultSwitchDescriptor.Id, "y").WithLocation(34, 17), 287Diagnostic(SwitchTestAnalyzer.SparseSwitchDescriptor.Id, "y").WithLocation(40, 17), 288Diagnostic(SwitchTestAnalyzer.NoDefaultSwitchDescriptor.Id, "y").WithLocation(40, 17)); 348Diagnostic(InvocationTestAnalyzer.BigParamArrayArgumentsDescriptor.Id, "M0(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)").WithLocation(19, 9), 349Diagnostic(InvocationTestAnalyzer.BigParamArrayArgumentsDescriptor.Id, "M0(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)").WithLocation(20, 9), 350Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.Id, "3").WithLocation(23, 21), 351Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.Id, "M3(0)").WithArguments("y").WithLocation(33, 9), 352Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.Id, "M3(y: null)").WithArguments("x").WithLocation(34, 9), 353Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.Id, "M3(x: 0)").WithArguments("y").WithLocation(35, 9), 354Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.Id, "M3()").WithArguments("x").WithLocation(36, 9), 355Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.Id, "M3()").WithArguments("y").WithLocation(36, 9), 356Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.Id, "M5(b: new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11})").WithArguments("x").WithLocation(47, 9)); 425Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.Id, "F5").WithLocation(8, 9), 426Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.Id, "F6").WithLocation(9, 9), 427Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.Id, "F10").WithLocation(13, 8)); 497Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.Id, "F5").WithLocation(8, 16), 498Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.Id, "F6").WithLocation(9, 16), 499Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.Id, "F10").WithLocation(13, 15)); 552Diagnostic(LocalCouldBeConstAnalyzer.LocalCouldBeConstDescriptor.Id, "e").WithLocation(13, 13), 553Diagnostic(LocalCouldBeConstAnalyzer.LocalCouldBeConstDescriptor.Id, "s").WithLocation(14, 16)); 723Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "a").WithArguments("a", "Middle").WithLocation(6, 16), 724Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "b").WithArguments("b", "Value").WithLocation(7, 16), 725Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "c").WithArguments("c", "Base").WithLocation(8, 16), 726Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "d").WithArguments("d", "Derived").WithLocation(10, 14), 727Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "e").WithArguments("e", "Middle").WithLocation(11, 14), 728Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "g").WithArguments("g", "Base").WithLocation(15, 16), 729Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "i").WithArguments("i", "int").WithLocation(20, 16), 730Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "k").WithArguments("k", "Derived").WithLocation(24, 16), 731Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "ia").WithArguments("ia", "IMiddle").WithLocation(34, 16), 732Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "ic").WithArguments("ic", "IBase1").WithLocation(35, 16), 733Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "id").WithArguments("id", "IDerived").WithLocation(37, 16), 734Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "ie").WithArguments("ie", "IMiddle").WithLocation(38, 16), 735Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "ig").WithArguments("ig", "IBase1").WithLocation(42, 16), 736Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "ik").WithArguments("ik", "IDerived").WithLocation(47, 17), 737Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "im").WithArguments("im", "IDerived").WithLocation(51, 16), 738Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fa").WithArguments("C.fa", "Middle").WithLocation(56, 12), 739Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fb").WithArguments("C.fb", "Value").WithLocation(57, 12), 740Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fc").WithArguments("C.fc", "Base").WithLocation(58, 12), 741Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fd").WithArguments("C.fd", "Derived").WithLocation(59, 10), 742Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fe").WithArguments("C.fe", "Middle").WithLocation(60, 10), 743Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fg").WithArguments("C.fg", "Base").WithLocation(62, 12), 744Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fi").WithArguments("C.fi", "int").WithLocation(64, 12), 745Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fk").WithArguments("C.fk", "Derived").WithLocation(66, 12), 746Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fia").WithArguments("C.fia", "IMiddle").WithLocation(75, 12), 747Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fic").WithArguments("C.fic", "IBase1").WithLocation(76, 12), 748Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fid").WithArguments("C.fid", "IDerived").WithLocation(77, 12), 749Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fie").WithArguments("C.fie", "IMiddle").WithLocation(78, 12), 750Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fig").WithArguments("C.fig", "IBase1").WithLocation(80, 12), 751Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fik").WithArguments("C.fik", "IDerived").WithLocation(82, 13), 752Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fim").WithArguments("C.fim", "IDerived").WithLocation(86, 12)); 788Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.Id, "17").WithLocation(4, 40), 789Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.Id, "17").WithLocation(9, 21), 790Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.Id, "17").WithLocation(14, 16), 791Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.Id, "17").WithLocation(24, 9), 792Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.Id, "M0()").WithLocation(16, 9)); 828Diagnostic(NullArgumentTestAnalyzer.NullArgumentsDescriptor.Id, "null").WithLocation(16, 12), 829Diagnostic(NullArgumentTestAnalyzer.NullArgumentsDescriptor.Id, "null").WithLocation(17, 16), 830Diagnostic(NullArgumentTestAnalyzer.NullArgumentsDescriptor.Id, "null").WithLocation(18, 12), 831Diagnostic(NullArgumentTestAnalyzer.NullArgumentsDescriptor.Id, "null").WithLocation(18, 18), 832Diagnostic(NullArgumentTestAnalyzer.NullArgumentsDescriptor.Id, "null").WithLocation(24, 26)); 881Diagnostic(MemberInitializerTestAnalyzer.DoNotUseFieldInitializerDescriptor.Id, "Field").WithLocation(19, 30), 882Diagnostic(MemberInitializerTestAnalyzer.DoNotUsePropertyInitializerDescriptor.Id, "Property1").WithLocation(20, 30), 883Diagnostic(MemberInitializerTestAnalyzer.DoNotUsePropertyInitializerDescriptor.Id, "Property1").WithLocation(21, 30), 884Diagnostic(MemberInitializerTestAnalyzer.DoNotUseFieldInitializerDescriptor.Id, "Field").WithLocation(21, 46), 885Diagnostic(MemberInitializerTestAnalyzer.DoNotUsePropertyInitializerDescriptor.Id, "Property2").WithLocation(22, 30), 886Diagnostic(MemberInitializerTestAnalyzer.DoNotUseFieldInitializerDescriptor.Id, "Field").WithLocation(22, 52), 887Diagnostic(MemberInitializerTestAnalyzer.DoNotUsePropertyInitializerDescriptor.Id, "Property2").WithLocation(24, 30)); 980Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{ 1, 2, 3, 4, 5, 6 }").WithLocation(14, 32), 981Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{ 1, 2, 3, 4, 5, 6 }").WithLocation(15, 23), 982Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{ null, null, null, null, null, null }").WithLocation(16, 28), 983Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{ 1, 2, 3, 4, 5, 6 }").WithLocation(18, 37), 984Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{ 1, 2, 3, 4, 5, 6 }").WithLocation(20, 27), 985Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{ 7, 8, 9, 10, 11, 12 }").WithLocation(21, 27), 986Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{ null, null, null, null, null, null }").WithLocation(24, 33), 987Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{ 1, 2, 3, 4, 5, 6 }").WithLocation(28, 66) 1016Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.Id, "int c1, c2, c3, c4;").WithLocation(9, 9), 1017Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.Id, "C[] d1, d2, d3, d4 = { null, null };").WithLocation(10, 9), 1018Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "d4 = { null, null }").WithLocation(10, 25), 1019Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.Id, "int e1 = 1, e2, e3, e4 = 10;").WithLocation(11, 9), 1020Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "e1 = 1").WithLocation(11, 13), 1021Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "e4 = 10").WithLocation(11, 29), 1022Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.Id, "int f1, f2, f3, ;").WithLocation(12, 9), 1023Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.Id, "int g1, g2, g3, g4 =;").WithLocation(13, 9)); 1080Diagnostic(CaseTestAnalyzer.MultipleCaseClausesDescriptor.Id, 1084Diagnostic(CaseTestAnalyzer.HasDefaultCaseDescriptor.Id, "default:").WithLocation(10, 13), 1085Diagnostic(CaseTestAnalyzer.MultipleCaseClausesDescriptor.Id, 1089Diagnostic(CaseTestAnalyzer.HasDefaultCaseDescriptor.Id, "default:").WithLocation(19, 13), 1090Diagnostic(CaseTestAnalyzer.HasDefaultCaseDescriptor.Id, "default:").WithLocation(33, 13)); 1121Diagnostic(ExplicitVsImplicitInstanceAnalyzer.ExplicitInstanceDescriptor.Id, "this").WithLocation(6, 9), 1122Diagnostic(ExplicitVsImplicitInstanceAnalyzer.ImplicitInstanceDescriptor.Id, "M1").WithLocation(7, 9), 1123Diagnostic(ExplicitVsImplicitInstanceAnalyzer.ExplicitInstanceDescriptor.Id, "base").WithLocation(18, 9), 1124Diagnostic(ExplicitVsImplicitInstanceAnalyzer.ImplicitInstanceDescriptor.Id, "M1").WithLocation(19, 9), 1125Diagnostic(ExplicitVsImplicitInstanceAnalyzer.ImplicitInstanceDescriptor.Id, "M2").WithLocation(20, 9)); 1158Diagnostic(MemberReferenceAnalyzer.HandlerAddedDescriptor.Id, "Mumble += new MumbleEventHandler(Mumbler)").WithLocation(10, 9), 1159Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.Id, "Mumble").WithLocation(10, 9), 1160Diagnostic(MemberReferenceAnalyzer.MethodBindingDescriptor.Id, "Mumbler").WithLocation(10, 42), 1161Diagnostic(MemberReferenceAnalyzer.HandlerAddedDescriptor.Id, "Mumble += (s, a) => {}").WithLocation(11, 9), 1162Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.Id, "Mumble").WithLocation(11, 9), 1163Diagnostic(MemberReferenceAnalyzer.HandlerAddedDescriptor.Id, "Mumble += new MumbleEventHandler((s, a) => {})").WithLocation(12, 9), 1164Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.Id, "Mumble").WithLocation(12, 9), 1165Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.Id, "Mumble").WithLocation(13, 9), 1166Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.Id, "Mumble").WithLocation(14, 20), 1167Diagnostic(MemberReferenceAnalyzer.MethodBindingDescriptor.Id, "Mumbler").WithLocation(15, 32), 1168Diagnostic(MemberReferenceAnalyzer.HandlerRemovedDescriptor.Id, "Mumble -= new MumbleEventHandler(Mumbler)").WithLocation(17, 9), 1169Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.Id, "Mumble").WithLocation(17, 9), 1170Diagnostic(MemberReferenceAnalyzer.MethodBindingDescriptor.Id, "Mumbler").WithLocation(17, 42)); 1220Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "M0(1, 2, 3, 4, 5)").WithLocation(13, 9), 1221Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "M0(1, 2, 3, 4, 5, 6)").WithLocation(14, 9), 1222Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "new int[] { 2, 3, 4, 5 }"), 1223Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "new int[] { 2, 3, 4, 5, 6 }"), 1224Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, @"new D(""Hello"", 1, 2, 3, 4)").WithLocation(20, 13), 1225Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "new int[] { 1, 2, 3, 4 }")); 1245Diagnostic(EqualsValueTestAnalyzer.EqualsValueDescriptor.Id, "= 44").WithLocation(4, 19), 1246Diagnostic(EqualsValueTestAnalyzer.EqualsValueDescriptor.Id, "= \"Hello\"").WithLocation(5, 22), 1247Diagnostic(EqualsValueTestAnalyzer.EqualsValueDescriptor.Id, "= Goo()").WithLocation(6, 19), 1248Diagnostic(EqualsValueTestAnalyzer.EqualsValueDescriptor.Id, "= 33").WithLocation(9, 40)); 1276Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.Id, "0").WithLocation(12, 17), 1277Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.Id, "x").WithLocation(13, 17), 1278Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.Id, "12").WithLocation(16, 29) 1340Diagnostic(AssignmentOperationSyntaxTestAnalyzer.AssignmentOperationDescriptor.Id, $"x = {expr}").WithLocation(7, 9), 1341Diagnostic(AssignmentOperationSyntaxTestAnalyzer.AssignmentSyntaxDescriptor.Id, $"x = {expr}").WithLocation(7, 9)); 1433Diagnostic(LambdaTestAnalyzer.LambdaExpressionDescriptor.Id, "input => { }").WithLocation(8, 31), 1434Diagnostic(LambdaTestAnalyzer.LambdaExpressionDescriptor.Id, "input => input++").WithLocation(9, 31), 1435Diagnostic(LambdaTestAnalyzer.LambdaExpressionDescriptor.Id, "input => { input++; input++; if (input > 0) return true; return false; }").WithLocation(10, 32), 1436Diagnostic(LambdaTestAnalyzer.TooManyStatementsInLambdaExpressionDescriptor.Id, "input => { input++; input++; if (input > 0) return true; return false; }").WithLocation(10, 32), 1437Diagnostic(LambdaTestAnalyzer.LambdaExpressionDescriptor.Id, "(s, e) => { }").WithLocation(22, 42), 1438Diagnostic(LambdaTestAnalyzer.LambdaExpressionDescriptor.Id, "(s, e) => { int i = 0; i++; i++; i++; }").WithLocation(23, 19), 1439Diagnostic(LambdaTestAnalyzer.TooManyStatementsInLambdaExpressionDescriptor.Id, "(s, e) => { int i = 0; i++; i++; i++; }").WithLocation(23, 19)); 1482Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.Id, "C.E").WithLocation(23, 9), 1483Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.Id, "D.Method").WithLocation(23, 16), 1484Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.Id, "C.E").WithLocation(24, 9), 1485Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.Id, "C.Bar()").WithLocation(25, 9), 1486Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.Id, "D.E").WithLocation(27, 9), 1487Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.Id, "D.Field").WithLocation(28, 9), 1488Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.Id, "D.Property").WithLocation(29, 17), 1489Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.Id, "D.Method()").WithLocation(30, 9)); 1508Diagnostic(LabelOperationsTestAnalyzer.LabelDescriptor.Id, "Wilma: goto Betty;").WithLocation(6, 9), 1509Diagnostic(LabelOperationsTestAnalyzer.GotoDescriptor.Id, "goto Betty;").WithLocation(6, 16), 1510Diagnostic(LabelOperationsTestAnalyzer.LabelDescriptor.Id, "Betty: goto Wilma;").WithLocation(7, 9), 1511Diagnostic(LabelOperationsTestAnalyzer.GotoDescriptor.Id, "goto Wilma;").WithLocation(7, 16)); 1567Diagnostic(UnaryAndBinaryOperationsTestAnalyzer.BooleanNotDescriptor.Id, "!b").WithLocation(41, 13), 1568Diagnostic(UnaryAndBinaryOperationsTestAnalyzer.DoubleMultiplyDescriptor.Id, "d * 100").WithLocation(42, 13), 1569Diagnostic(UnaryAndBinaryOperationsTestAnalyzer.OperatorAddMethodDescriptor.Id, "a1 + a2").WithLocation(43, 14), 1570Diagnostic(UnaryAndBinaryOperationsTestAnalyzer.OperatorMinusMethodDescriptor.Id, "-a2").WithLocation(44, 14)); 1641Diagnostic(NullOperationSyntaxTestAnalyzer.ParamsArrayOperationDescriptor.Id, "M0()"), 1642Diagnostic(NullOperationSyntaxTestAnalyzer.ParamsArrayOperationDescriptor.Id, "M0(1)").WithLocation(11, 9), 1643Diagnostic(NullOperationSyntaxTestAnalyzer.ParamsArrayOperationDescriptor.Id, "M0(1, 2)").WithLocation(12, 9)); 1676Diagnostic(ConversionExpressionCSharpTestAnalyzer.InvalidConversionExpressionDescriptor.Id, "null.Length").WithLocation(8, 17), 1677Diagnostic(ConversionExpressionCSharpTestAnalyzer.InvalidConversionExpressionDescriptor.Id, "string.Empty").WithLocation(10, 17), 1678Diagnostic(ConversionExpressionCSharpTestAnalyzer.InvalidConversionExpressionDescriptor.Id, "global::MyType()").WithLocation(12, 17)); 1710Diagnostic(InvalidOperatorExpressionTestAnalyzer.InvalidBinaryDescriptor.Id, "f == float.Nan").WithLocation(6, 16), 1711Diagnostic(InvalidOperatorExpressionTestAnalyzer.InvalidUnaryDescriptor.Id, "-f").WithLocation(11, 16), 1712Diagnostic(InvalidOperatorExpressionTestAnalyzer.InvalidIncrementDescriptor.Id, "f++").WithLocation(16, 9)); 1783Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.Id, "p?.Prop").WithLocation(24, 17), 1784Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.Id, "p").WithLocation(24, 17), 1785Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.Id, "p?.Field").WithLocation(25, 13), 1786Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.Id, "p").WithLocation(25, 13), 1787Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.Id, "p?[0]").WithLocation(26, 13), 1788Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.Id, "p").WithLocation(26, 13), 1789Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.Id, "p?.M0(null)").WithLocation(27, 9), 1790Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.Id, "p").WithLocation(27, 9), 1791Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.Id, "Field1?.Prop").WithLocation(29, 13), 1792Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.Id, "Field1").WithLocation(29, 13), 1793Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.Id, "Field1?.Field").WithLocation(30, 13), 1794Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.Id, "Field1").WithLocation(30, 13), 1795Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.Id, "Field1?[0]").WithLocation(31, 13), 1796Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.Id, "Field1").WithLocation(31, 13), 1797Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.Id, "Field1?.M0(null)").WithLocation(32, 9), 1798Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.Id, "Field1").WithLocation(32, 9)); 1874Diagnostic(TrueFalseUnaryOperationTestAnalyzer.UnaryTrueDescriptor.Id, "x && y").WithLocation(29, 13), 1875Diagnostic(TrueFalseUnaryOperationTestAnalyzer.UnaryTrueDescriptor.Id, "x").WithLocation(30, 18));
Microsoft.CodeAnalysis.CSharp.Features (3)
QuickInfo\CSharpDiagnosticAnalyzerQuickInfoProvider.cs (3)
153descriptor.Id; 155? new TaggedText(TextTags.Text, descriptor.Id, TaggedTextStyle.None, descriptor.HelpLinkUri, descriptor.HelpLinkUri) 156: new TaggedText(TextTags.Text, descriptor.Id);
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (22)
Diagnostics\Suppression\RemoveUnnecessaryPragmaSuppressionsTests.cs (17)
186protected override string VariableDeclaredButNotUsedDiagnosticId => UserDiagnosticAnalyzer.Descriptor0168.Id; 187protected override string VariableAssignedButNotUsedDiagnosticId => UserDiagnosticAnalyzer.Descriptor0219.Id; 190CompilationEndDiagnosticAnalyzer.Descriptor.Id, 1046[System.Diagnostics.CodeAnalysis.SuppressMessage(""Category"", ""{UserDiagnosticAnalyzer.Descriptor0168.Id}"")] // Variable is declared but never used - Unnecessary, but suppressed 1050#pragma warning disable {UserDiagnosticAnalyzer.Descriptor0168.Id} // Variable is declared but never used - Unnecessary, but suppressed 1052#pragma warning restore {UserDiagnosticAnalyzer.Descriptor0168.Id} // Variable is declared but never used - Unnecessary, but suppressed 1120{ CodeStyleOptions2.RemoveUnnecessarySuppressionExclusions, excludeAll ? "all" : $"CS0168, {UserDiagnosticAnalyzer.Descriptor0168.Id}" } 1128[System.Diagnostics.CodeAnalysis.SuppressMessage(""Category"", ""{UserDiagnosticAnalyzer.Descriptor0168.Id}"")] // Variable is declared but never used - Unnecessary, but suppressed 1132#pragma warning disable {UserDiagnosticAnalyzer.Descriptor0168.Id} // Variable is declared but never used - Unnecessary, but suppressed 1134#pragma warning restore {UserDiagnosticAnalyzer.Descriptor0168.Id} // Variable is declared but never used - Unnecessary, but suppressed 1145? ("CS0168", UserDiagnosticAnalyzer.Descriptor0168.Id) 1146: (UserDiagnosticAnalyzer.Descriptor0168.Id, "CS0168"); 1210#pragma warning disable {UserDiagnosticAnalyzer.Descriptor0168.Id} 1212[System.Diagnostics.CodeAnalysis.SuppressMessage(""Category"", ""{UserDiagnosticAnalyzer.Descriptor0168.Id}"")] 1216[System.Diagnostics.CodeAnalysis.SuppressMessage(""Category"", ""{UserDiagnosticAnalyzer.Descriptor0168.Id}"")] 1219{disablePrefix}#pragma warning disable {UserDiagnosticAnalyzer.Descriptor0168.Id} // Variable is declared but never used - Unnecessary{disableSuffix} 1222{restorePrefix}#pragma warning restore {UserDiagnosticAnalyzer.Descriptor0168.Id} // Variable is declared but never used - Unnecessary{restoreSuffix}
Diagnostics\Suppression\SuppressionTests.cs (2)
953#pragma warning disable {UserDiagnosticAnalyzer.Decsciptor.Id} // {UserDiagnosticAnalyzer.Decsciptor.Title} 957#pragma warning restore {UserDiagnosticAnalyzer.Decsciptor.Id} // {UserDiagnosticAnalyzer.Decsciptor.Title}
src\Analyzers\CSharp\Tests\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionTests.cs (1)
887var descriptor = analyzer.SupportedDiagnostics.First(descriptor => descriptor.Id == IDEDiagnosticIds.ConvertSwitchStatementToExpressionDiagnosticId);
src\Analyzers\CSharp\Tests\RemoveUnusedMembers\RemoveUnusedMembersTests.cs (1)
1485.Diagnostic(new CSharpRemoveUnusedMembersDiagnosticAnalyzer().SupportedDiagnostics.First(x => x.Id == "IDE0052"))
src\Analyzers\CSharp\Tests\SimplifyInterpolation\SimplifyInterpolationTests.cs (1)
50diagnostics.Select(d => (d.Descriptor.Id, d.Severity)));
Microsoft.CodeAnalysis.EditorFeatures (1)
EditorConfigSettings\Data\AnalyzerSetting.cs (1)
40public string Id => _descriptor.Id;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (16)
CodeFixes\CodeFixServiceTests.cs (5)
128Assert.Equal(codeFix.FixableDiagnosticIds.Single(), analyzerWithFix.SupportedDiagnostics.Single().Id); 1105Assert.Equal(analyzer.SupportedDiagnostics.Select(d => d.Id), lowPriorityAnalyzerData.SupportedDiagnosticIds); 1154Assert.Equal(DeprioritizedAnalyzer.Descriptor.Id, diagnostic.Id); 1219public static readonly string Title = $"Fix {DeprioritizedAnalyzer.Descriptor.Id}"; 1220public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(DeprioritizedAnalyzer.Descriptor.Id);
Diagnostics\DiagnosticAnalyzerServiceTests.cs (10)
169dotnet_diagnostic.{DisabledByDefaultAnalyzer.s_syntaxRule.Id}.severity = warning 170dotnet_diagnostic.{DisabledByDefaultAnalyzer.s_semanticRule.Id}.severity = warning 171dotnet_diagnostic.{DisabledByDefaultAnalyzer.s_compilationRule.Id}.severity = warning"; 196if (diagnostic.Id == DisabledByDefaultAnalyzer.s_syntaxRule.Id) 200else if (diagnostic.Id == DisabledByDefaultAnalyzer.s_semanticRule.Id) 204else if (diagnostic.Id == DisabledByDefaultAnalyzer.s_compilationRule.Id) 467d => d.Id == analyzer.Descriptor.Id && d.DataLocation.UnmappedFileSpan.Path == additionalDoc.FilePath); 718Assert.Equal(analyzer1.Descriptor.Id, diagnostic.Id); 898syntax |= diagnostic.Id == Analyzer.s_syntaxRule.Id; 899semantic |= diagnostic.Id == Analyzer.s_semanticRule.Id;
Diagnostics\IDEDiagnosticIDConfigurationTests.cs (1)
37var diagnosticId = descriptor.Id;
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
Suggestions\SuggestedActionPriorityProvider.cs (1)
35lowPriorityAnalyzersAndDiagnosticIds.SupportedDiagnosticIds.Add(supportedDiagnostic.Id);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (44)
Diagnostics\AdditionalFileDiagnosticsTests.vb (1)
108Return ImmutableArray.Create(AdditionalFileAnalyzer.Rule.Id)
Diagnostics\DiagnosticServiceTests.vb (43)
100Assert.Equal(workspaceDiagnosticAnalyzer.DiagDescriptor.Id, descriptors(0).Id) 118Assert.Equal(workspaceDiagnosticAnalyzer.DiagDescriptor.Id, descriptors(0).Id) 119Assert.Equal(projectDiagnosticAnalyzer1.DiagDescriptor.Id, descriptors(1).Id) 133Assert.Equal(workspaceDiagnosticAnalyzer.DiagDescriptor.Id, descriptors(0).Id) 134Assert.Equal(projectDiagnosticAnalyzer1.DiagDescriptor.Id, descriptors(1).Id) 135Assert.Equal(projectDiagnosticAnalyzer2.DiagDescriptor.Id, descriptors(2).Id) 148Assert.Equal(workspaceDiagnosticAnalyzer.DiagDescriptor.Id, descriptors(0).Id) 149Assert.Equal(projectDiagnosticAnalyzer2.DiagDescriptor.Id, descriptors(1).Id) 161Assert.Equal(workspaceDiagnosticAnalyzer.DiagDescriptor.Id, descriptors(0).Id) 170Assert.Equal(workspaceDiagnosticAnalyzer.DiagDescriptor.Id, descriptors(0).Id) 213Assert.Equal(workspaceDiagnosticAnalyzer.DiagDescriptor.Id, descriptors(0).Id) 285Assert.Equal(workspaceDiagnosticAnalyzer.DiagDescriptor.Id, descriptors(0).Id) 293Assert.Equal(workspaceDiagnosticAnalyzer.DiagDescriptor.Id, diagnostics(0).Id) 298suppressDiagOptions.Add(workspaceDiagnosticAnalyzer.DiagDescriptor.Id, ReportDiagnostic.Suppress) 306changeSeverityDiagOptions.Add(workspaceDiagnosticAnalyzer.DiagDescriptor.Id, ReportDiagnostic.Error) 312Assert.Equal(workspaceDiagnosticAnalyzer.DiagDescriptor.Id, diagnostics(0).Id) 445Select(Function(d) d.Id = WorkspaceDiagnosticAnalyzer.Descriptor.Id) 615Assert.Equal(OperationAnalyzer.Descriptor.Id, diagnostic.Id) 652Assert.Equal(CodeBlockEndedAnalyzer.Descriptor.Id, diagnostic.Id) 686Assert.Equal(CodeBlockEndedAnalyzer.Descriptor.Id, diagnostic.Id) 763Assert.Equal(CodeBlockEndedAnalyzer.Descriptor.Id, diagnostic.Id) 814Assert.Equal(CompilationEndedAnalyzer.Descriptor.Id, noLocationDiagnostic.Id) 818Assert.Equal(CompilationEndedAnalyzer.Descriptor.Id, withDocumentLocationDiagnostic.Id) 848Assert.Equal(StatefulCompilationAnalyzer.Descriptor.Id, diagnostic.Id) 880Assert.Equal(StatefulCompilationAnalyzer.Descriptor.Id, diagnostic.Id) 955Select(Function(d) d.Id = NamedTypeAnalyzer.DiagDescriptor.Id) 995Assert.Equal(PartialTypeDiagnosticAnalyzer.DiagDescriptor.Id, diagnostics.Single().Id) 1053Assert.Equal(PartialTypeDiagnosticAnalyzer.DiagDescriptor.Id, diagnostic.Id) 1103Assert.Equal(3, diagnostics.Where(Function(d) d.Id = CodeBlockOrSyntaxNodeAnalyzer.Descriptor1.Id).Count) 1104Assert.Equal(1, diagnostics.Where(Function(d) d.Id = CodeBlockOrSyntaxNodeAnalyzer.Descriptor4.Id).Count) 1105Assert.Equal(1, diagnostics.Where(Function(d) d.Id = CodeBlockOrSyntaxNodeAnalyzer.Descriptor5.Id).Count) 1106Assert.Equal(1, diagnostics.Where(Function(d) d.Id = CodeBlockOrSyntaxNodeAnalyzer.Descriptor6.Id).Count) 1147Assert.Equal(1, diagnostics.Where(Function(d) d.Id = CodeBlockOrSyntaxNodeAnalyzer.Descriptor4.Id).Count) 1148Assert.Equal(1, diagnostics.Where(Function(d) d.Id = CodeBlockOrSyntaxNodeAnalyzer.Descriptor5.Id).Count) 1149Assert.Equal(1, diagnostics.Where(Function(d) d.Id = CodeBlockOrSyntaxNodeAnalyzer.Descriptor6.Id).Count) 1193Assert.True(diagnostics.All(Function(d) d.Id = MethodSymbolAnalyzer.Descriptor.Id)) 1241Assert.Equal(1, diagnostics.Where(Function(d) d.Id = MustOverrideMethodAnalyzer.Descriptor1.Id).Count) 1307Assert.Equal(4, diagnostics.Where(Function(d) d.Id = FieldDeclarationAnalyzer.Descriptor1.Id).Count) 1435Assert.Equal(CompilationAnalyzerWithAnalyzerOptions.Descriptor.Id, diagnostics(0).Id) 1974Dim diagnostic = diagnostics.Single(Function(d) d.Id = CodeBlockActionAnalyzer.CodeBlockTopLevelRule.Id) 1977Dim stateFullDiagnostics = diagnostics.Where(Function(d) d.Id = CodeBlockActionAnalyzer.CodeBlockPerCompilationRule.Id) 2135Assert.Equal(analyzer.Descriptor.Id, descriptors.Single().Id) 2154Assert.Equal(analyzer.Descriptor.Id, hiddenDiagnostics.Single().Id)
Microsoft.CodeAnalysis.Features (11)
CodeFixesAndRefactorings\CodeActionRequestPriorityProvider.cs (1)
131_lowPriorityAnalyzerSupportedDiagnosticIds.Add(supportedDiagnostic.Id);
EditAndContinue\EditSession.cs (1)
861Telemetry.LogProjectAnalysisSummary(ProjectAnalysisSummary.ValidChanges, newProject.State.ProjectInfo.Attributes.TelemetryId, ImmutableArray.Create(mvidReadError.Descriptor.Id));
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs (2)
89AddDiagnosticIdToOptionMapping(descriptor.Id, option); 103AddDiagnosticIdToOptionMapping(descriptor.Id, options);
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\Analyzers\Core\Analyzers\AbstractBuiltInUnnecessaryCodeStyleDiagnosticAnalyzer.cs (2)
95AddDiagnosticIdToFadingOptionMapping(descriptor.Id, fadingOption); 134IDEDiagnosticIdToOptionMappingHelper.AddFadingOptionMapping(descriptor.Id, fadingOption);
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (1)
271descriptor.Id,
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
427if (!idsToAnalyze.Contains(descriptor.Id)) 435unhandledIds.Add(descriptor.Id);
Microsoft.CodeAnalysis.Features.UnitTests (4)
EditAndContinue\EditAndContinueDiagnosticDescriptorsTests.cs (4)
21Assert.Equal("ENC0001", d.Id); 30Assert.Equal("ENC0087", EditAndContinueDiagnosticDescriptors.GetDescriptor(RudeEditKind.ComplexQueryExpression).Id); 33Assert.Equal("ENC1001", d.Id); 43Assert.Equal("ENC2012", d.Id);
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (4)
Diagnostics\NonLocalDiagnosticTests.cs (2)
49Assert.Equal(NonLocalDiagnosticsAnalyzer.NonLocalDescriptor.Id, orderedDiagnostics[0].Code); 50Assert.Equal(NonLocalDiagnosticsAnalyzer.CompilationEndDescriptor.Id, orderedDiagnostics[1].Code);
Diagnostics\PullDiagnosticTests.cs (2)
690Assert.Equal(DiagnosticProducingGenerator.Descriptor.Id, diagnostic.Code); 1332Assert.Equal(DiagnosticProducingGenerator.Descriptor.Id, results[0].Diagnostics.Single().Code);
Microsoft.CodeAnalysis.Test.Utilities (27)
Diagnostics\CommonDiagnosticAnalyzers.cs (24)
117""ruleId"": """ + Descriptor1.Id + @""", 138""ruleId"": """ + Descriptor2.Id + @""", 147""" + Descriptor1.Id + @""": { 148""id"": """ + Descriptor1.Id + @""", 161""" + Descriptor2.Id + @""": { 162""id"": """ + Descriptor2.Id + @""", 191""ruleId"": """ + Descriptor1.Id + @""", 215""ruleId"": """ + Descriptor2.Id + @""", 224""" + Descriptor1.Id + @""": { 225""id"": """ + Descriptor1.Id + @""", 238""" + Descriptor2.Id + @""": { 239""id"": """ + Descriptor2.Id + @""", 272""ruleId"": """ + Descriptor1.Id + @""", 298""ruleId"": """ + Descriptor2.Id + @""", 324""ruleId"": """ + Descriptor1.Id + @""", 356""ruleId"": """ + Descriptor2.Id + @""", 450var descriptor1Info = descriptorsWithInfo.Single(d => d.Descriptor.Id == Descriptor1.Id).Info; 454var descriptor2Info = descriptorsWithInfo.Single(d => d.Descriptor.Id == Descriptor2.Id).Info; 461""id"": """ + Descriptor1.Id + @""", 479""id"": """ + Descriptor2.Id + @""", 514public static readonly SuppressionDescriptor Descriptor1 = new("SPR0001", AnalyzerForErrorLogTest.Descriptor1.Id, "SuppressorJustification1"); 515public static readonly SuppressionDescriptor Descriptor2 = new("SPR0002", AnalyzerForErrorLogTest.Descriptor2.Id, "SuppressorJustification2");
Diagnostics\DescriptorFactory.cs (3)
18/// Creates a <see cref="DiagnosticDescriptor"/> with specified <see cref="DiagnosticDescriptor.Id"/>. 27/// <param name="id">The value for <see cref="DiagnosticDescriptor.Id"/>.</param> 29/// <returns>A <see cref="DiagnosticDescriptor"/> with specified <see cref="DiagnosticDescriptor.Id"/>.</returns>
Microsoft.CodeAnalysis.UnitTests (2)
Diagnostics\DiagnosticLocalizationTests.cs (2)
317Assert.Equal(descriptor.Id, descriptors[0].Id);
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (18)
CommandLineTests.vb (16)
9043Assert.Contains(AnalyzerThatThrowsInGetMessage.Rule.Id, output, StringComparison.Ordinal) 9088Assert.Contains(AnalyzerThatThrowsInGetMessage.Rule.Id, output, StringComparison.Ordinal) 9901Assert.Contains($"warning {analyzer.Descriptor.Id}", output, StringComparison.Ordinal) 9905Dim suppressor = New DiagnosticSuppressorForId(analyzer.Descriptor.Id) 9918Assert.DoesNotContain($"warning {analyzer.Descriptor.Id}", output, StringComparison.Ordinal) 9927Assert.Contains($"error {analyzer.Descriptor.Id}", output, StringComparison.Ordinal) 9935Assert.DoesNotContain($"warning {analyzer.Descriptor.Id}", output, StringComparison.Ordinal) 9941suppressor = New DiagnosticSuppressorForId(analyzer.Descriptor.Id) 9946Assert.Contains($"warning {analyzer.Descriptor.Id}", output, StringComparison.Ordinal) 9966Assert.Contains($"error {analyzer.Descriptor.Id}", output, StringComparison.Ordinal) 9969Dim suppressor = New DiagnosticSuppressorForId(analyzer.Descriptor.Id) 9974Assert.Contains($"error {analyzer.Descriptor.Id}", output, StringComparison.Ordinal) 10159Assert.Contains($"{expectedODiagnosticSeverity} {WarningDiagnosticAnalyzer.Warning01.Id}", output) 10160Assert.Contains($"{expectedODiagnosticSeverity} {WarningDiagnosticAnalyzer.Warning03.Id}", output) 10216Dim diagnosticId = analyzer.Descriptor.Id 10281Dim diagnosticId = analyzer.Descriptor.Id
SarifErrorLoggerTests.vb (2)
183Assert.Contains(AnalyzerForErrorLogTest.Descriptor1.Id, actualConsoleOutput) 184Assert.Contains(AnalyzerForErrorLogTest.Descriptor2.Id, actualConsoleOutput)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (273)
Diagnostics\DiagnosticAnalyzerTests.vb (41)
63specificDiagOptions.Add(noneDiagDescriptor.Id, ReportDiagnostic.[Error]) 64specificDiagOptions.Add(infoDiagDescriptor.Id, ReportDiagnostic.[Error]) 65specificDiagOptions.Add(warningDiagDescriptor.Id, ReportDiagnostic.[Error]) 78specificDiagOptions.Add(noneDiagDescriptor.Id, ReportDiagnostic.Suppress) 79specificDiagOptions.Add(infoDiagDescriptor.Id, ReportDiagnostic.Suppress) 80specificDiagOptions.Add(warningDiagDescriptor.Id, ReportDiagnostic.Suppress) 81specificDiagOptions.Add(errorDiagDescriptor.Id, ReportDiagnostic.Suppress) 90specificDiagOptions.Add(noneDiagDescriptor.Id, ReportDiagnostic.Info) 91specificDiagOptions.Add(infoDiagDescriptor.Id, ReportDiagnostic.Hidden) 92specificDiagOptions.Add(warningDiagDescriptor.Id, ReportDiagnostic.[Error]) 93specificDiagOptions.Add(errorDiagDescriptor.Id, ReportDiagnostic.Warn) 105Assert.Equal(infoDiagDescriptor.Id, effectiveDiag.Id) 108Assert.Equal(noneDiagDescriptor.Id, effectiveDiag.Id) 112Assert.Equal(errorDiagDescriptor.Id, effectiveDiag.Id) 116Assert.Equal(warningDiagDescriptor.Id, effectiveDiag.Id) 202specificDiagOptions.Add(disabledDiagDescriptor.Id, ReportDiagnostic.Warn) 203specificDiagOptions.Add(enabledDiagDescriptor.Id, ReportDiagnostic.Suppress) 254specificDiagOptions.Add(FullyDisabledAnalyzer.desc1.Id, ReportDiagnostic.Warn) 255specificDiagOptions.Add(PartiallyDisabledAnalyzer.desc2.Id, ReportDiagnostic.Suppress) 477Dim id = Integer.Parse(descriptor.Id.Substring(2)) 479Dim message = String.Format("Add resource string named '{0}' for Title of '{1}' to '{2}'", missingResource, descriptor.Id, NameOf(VBResources)) 488Dim message = String.Format("'{0}' must have a non-null non-empty 'Category'", descriptor.Id) 659Diagnostic(VisualBasicCodeBlockObjectCreationAnalyzer.DiagnosticDescriptor.Id, <![CDATA[New C1()]]>), 660Diagnostic(VisualBasicCodeBlockObjectCreationAnalyzer.DiagnosticDescriptor.Id, <![CDATA[New C2()]]>), 661Diagnostic(VisualBasicCodeBlockObjectCreationAnalyzer.DiagnosticDescriptor.Id, <![CDATA[New C3()]]>)) 681Diagnostic(NotConfigurableDiagnosticAnalyzer.EnabledRule.Id)) 685specificDiagOptions.Add(NotConfigurableDiagnosticAnalyzer.EnabledRule.Id, ReportDiagnostic.Suppress) 694Diagnostic(NotConfigurableDiagnosticAnalyzer.EnabledRule.Id)) 698specificDiagOptions.Add(NotConfigurableDiagnosticAnalyzer.DisabledRule.Id, ReportDiagnostic.Warn) 706compilation.VerifyAnalyzerDiagnostics({analyzer}, Nothing, Nothing, Diagnostic(NotConfigurableDiagnosticAnalyzer.EnabledRule.Id)) 727Diagnostic(CodeBlockActionAnalyzer.CodeBlockTopLevelRule.Id, <![CDATA[M]]>).WithArguments("M"), 728Diagnostic(CodeBlockActionAnalyzer.CodeBlockPerCompilationRule.Id, <![CDATA[M]]>).WithArguments("M")) 749Diagnostic(CodeBlockActionAnalyzer.CodeBlockTopLevelRule.Id, <![CDATA[M]]>).WithArguments("M")) 996Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.Id, "0").WithLocation(8, 28), 997Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.Id, "x").WithLocation(9, 28), 998Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.Id, "12").WithLocation(12, 36)) 1293If DirectCast(builder(i).Code, String) <> GeneratedCodeAnalyzer.Error.Id Then 1317Dim diag = Diagnostic(GeneratedCodeAnalyzer.Warning.Id, squiggledText).WithArguments(arguments).WithLocation(line, column) 1320diag = Diagnostic(GeneratedCodeAnalyzer.Error.Id, squiggledText).WithArguments(arguments).WithLocation(line, column) 1326AddExpectedDiagnostic(builder, descriptor.Id, Nothing, 1, 1, arguments) 1678Assert.Equal(Analyzer.Descriptor.Id, diagnostic.Id)
Diagnostics\OperationAnalyzerTests.vb (232)
49Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.Id, "New Integer(-1) { }").WithLocation(3, 33), 50Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.Id, "{ }").WithLocation(4, 30), 51Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.Id, "New C(-1) { }").WithLocation(5, 27), 52Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.Id, "New Integer(-1)() { }").WithLocation(9, 35), 53Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.Id, "New Integer( -1)()()() { }").WithLocation(10, 39), 54Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.Id, "New Integer(-1)(,) { }").WithLocation(12, 37)) 100Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.Id, "3").WithLocation(6, 32), 101Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.Id, "v1").WithLocation(6, 39), 102Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.Id, "v3").WithLocation(7, 29), 103Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.Id, "3").WithLocation(9, 21), 104Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.Id, "v3").WithLocation(12, 21), 105Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.Id, "p1").WithLocation(27, 9), 106Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.Id, "Me").WithLocation(28, 13)) 130Diagnostic(BadStuffTestAnalyzer.InvalidExpressionDescriptor.Id, "Framitz()").WithLocation(3, 9), 131Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.Id, "Framitz()").WithLocation(3, 9), 132Diagnostic(BadStuffTestAnalyzer.InvalidExpressionDescriptor.Id, "Framitz").WithLocation(3, 9), 133Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.Id, "Framitz").WithLocation(3, 9), 134Diagnostic(BadStuffTestAnalyzer.InvalidExpressionDescriptor.Id, "Bexley()").WithLocation(4, 28), 135Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.Id, "Bexley()").WithLocation(4, 28), 136Diagnostic(BadStuffTestAnalyzer.InvalidExpressionDescriptor.Id, "Bexley").WithLocation(4, 28), 137Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.Id, "Bexley").WithLocation(4, 28), 138Diagnostic(BadStuffTestAnalyzer.InvalidExpressionDescriptor.Id, "M1(d)").WithLocation(7, 9), 139Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.Id, "M1(d)").WithLocation(7, 9), 140Diagnostic(BadStuffTestAnalyzer.InvalidStatementDescriptor.Id, "Goto").WithLocation(8, 9), 141Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.Id, "Goto").WithLocation(8, 9), 142Diagnostic(BadStuffTestAnalyzer.InvalidStatementDescriptor.Id, "").WithLocation(8, 13), 143Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.Id, "").WithLocation(8, 13)) 238Diagnostic(SwitchTestAnalyzer.SparseSwitchDescriptor.Id, "x").WithLocation(12, 21), 239Diagnostic(SwitchTestAnalyzer.SparseSwitchDescriptor.Id, "x").WithLocation(30, 21), 240Diagnostic(SwitchTestAnalyzer.SparseSwitchDescriptor.Id, "x").WithLocation(37, 21), 241Diagnostic(SwitchTestAnalyzer.NoDefaultSwitchDescriptor.Id, "x").WithLocation(37, 21), 242Diagnostic(SwitchTestAnalyzer.NoDefaultSwitchDescriptor.Id, "x").WithLocation(42, 21), 243Diagnostic(SwitchTestAnalyzer.OnlyDefaultSwitchDescriptor.Id, "x").WithLocation(49, 21), 244Diagnostic(SwitchTestAnalyzer.SparseSwitchDescriptor.Id, "x").WithLocation(54, 21), 245Diagnostic(SwitchTestAnalyzer.NoDefaultSwitchDescriptor.Id, "x").WithLocation(54, 21)) 289Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.Id, "M3(Nothing,)").WithArguments("b").WithLocation(25, 9), 290Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.Id, "M3(,0)").WithArguments("a").WithLocation(26, 9), 291Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.Id, "M3(,)").WithArguments("a").WithLocation(27, 9), 292Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.Id, "M3(,)").WithArguments("b").WithLocation(27, 9), 293Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.Id, "2").WithLocation(11, 21), 294Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.Id, "4").WithLocation(12, 33), 295Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.Id, "2").WithLocation(12, 21), 296Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.Id, "1").WithLocation(12, 15), 297Diagnostic(InvocationTestAnalyzer.BigParamArrayArgumentsDescriptor.Id, "M0(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)").WithLocation(14, 9), 298Diagnostic(InvocationTestAnalyzer.BigParamArrayArgumentsDescriptor.Id, "M0(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)").WithLocation(15, 9), 299Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.Id, "3").WithLocation(17, 21)) 363Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.Id, "F5").WithLocation(6, 12), 364Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.Id, "F6").WithLocation(7, 12), 365Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.Id, "F10").WithLocation(10, 12)) 429Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.Id, "F5").WithLocation(6, 19), 430Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.Id, "F6").WithLocation(7, 19), 431Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.Id, "F10").WithLocation(10, 19)) 483Diagnostic(LocalCouldBeConstAnalyzer.LocalCouldBeConstDescriptor.Id, "e").WithLocation(10, 13), 484Diagnostic(LocalCouldBeConstAnalyzer.LocalCouldBeConstDescriptor.Id, "s").WithLocation(11, 13)) 648Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "a").WithArguments("a", "Middle").WithLocation(3, 13), 649Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "b").WithArguments("b", "Value").WithLocation(4, 13), 650Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "c").WithArguments("c", "Base").WithLocation(5, 13), 651Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "d").WithArguments("d", "Derived").WithLocation(7, 13), 652Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "e").WithArguments("e", "Middle").WithLocation(8, 13), 653Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "g").WithArguments("g", "Base").WithLocation(12, 13), 654Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "i").WithArguments("i", "Integer").WithLocation(17, 13), 655Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "k").WithArguments("k", "Derived").WithLocation(21, 13), 656Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "ia").WithArguments("ia", "IMiddle").WithLocation(31, 13), 657Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "ic").WithArguments("ic", "IBase1").WithLocation(32, 13), 658Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "id").WithArguments("id", "IDerived").WithLocation(34, 13), 659Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "ie").WithArguments("ie", "IMiddle").WithLocation(35, 13), 660Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "ig").WithArguments("ig", "IBase1").WithLocation(39, 13), 661Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "ik").WithArguments("ik", "IDerived").WithLocation(44, 13), 662Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "im").WithArguments("im", "IDerived").WithLocation(48, 13), 663Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fa").WithArguments("Private fa As Object", "Middle").WithLocation(53, 13), 664Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fb").WithArguments("Private fb As Object", "Value").WithLocation(54, 13), 665Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fc").WithArguments("Private fc As Object", "Base").WithLocation(55, 13), 666Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fd").WithArguments("Private fd As Base", "Derived").WithLocation(56, 13), 667Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fe").WithArguments("Private fe As Base", "Middle").WithLocation(57, 13), 668Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fg").WithArguments("Private fg As Object", "Base").WithLocation(59, 13), 669Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fi").WithArguments("Private fi As Object", "Integer").WithLocation(61, 13), 670Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fk").WithArguments("Private fk As Middle", "Derived").WithLocation(63, 13), 671Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fia").WithArguments("Private fia As Object", "IMiddle").WithLocation(72, 13), 672Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fic").WithArguments("Private fic As Object", "IBase1").WithLocation(73, 13), 673Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fid").WithArguments("Private fid As IBase1", "IDerived").WithLocation(74, 13), 674Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fie").WithArguments("Private fie As IBase1", "IMiddle").WithLocation(75, 13), 675Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fig").WithArguments("Private fig As Object", "IBase1").WithLocation(77, 13), 676Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fik").WithArguments("Private fik As IMiddle", "IDerived").WithLocation(79, 13), 677Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fim").WithArguments("Private fim As IBase2", "IDerived").WithLocation(83, 13)) 726Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.Id, "17").WithLocation(2, 71), 727Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.Id, "17").WithLocation(6, 28), 728Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.Id, "17").WithLocation(10, 16), 729Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.Id, "17").WithLocation(19, 9), 730Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.Id, "17").WithLocation(27, 40), 731Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.Id, "17").WithLocation(28, 29), 732Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.Id, "17").WithLocation(33, 42), 733Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.Id, "M0").WithLocation(12, 9)) ' The M0 diagnostic is an artifact of the VB compiler filling in default values in the high-level bound tree, and is questionable. 770Diagnostic(NullArgumentTestAnalyzer.NullArgumentsDescriptor.Id, "Nothing").WithLocation(13, 12), 771Diagnostic(NullArgumentTestAnalyzer.NullArgumentsDescriptor.Id, "Nothing").WithLocation(14, 18), 772Diagnostic(NullArgumentTestAnalyzer.NullArgumentsDescriptor.Id, "Nothing").WithLocation(15, 12), 773Diagnostic(NullArgumentTestAnalyzer.NullArgumentsDescriptor.Id, "Nothing").WithLocation(15, 21), 774Diagnostic(NullArgumentTestAnalyzer.NullArgumentsDescriptor.Id, "Nothing").WithLocation(20, 26)) 811Diagnostic(MemberInitializerTestAnalyzer.DoNotUseFieldInitializerDescriptor.Id, "Field").WithLocation(14, 35), 812Diagnostic(MemberInitializerTestAnalyzer.DoNotUsePropertyInitializerDescriptor.Id, "Prop1").WithLocation(15, 33), 813Diagnostic(MemberInitializerTestAnalyzer.DoNotUseFieldInitializerDescriptor.Id, "Field").WithLocation(16, 33), 814Diagnostic(MemberInitializerTestAnalyzer.DoNotUsePropertyInitializerDescriptor.Id, "Prop1").WithLocation(16, 46), 815Diagnostic(MemberInitializerTestAnalyzer.DoNotUsePropertyInitializerDescriptor.Id, "Prop2").WithLocation(17, 33), 816Diagnostic(MemberInitializerTestAnalyzer.DoNotUseFieldInitializerDescriptor.Id, "Field").WithLocation(17, 58), 817Diagnostic(MemberInitializerTestAnalyzer.DoNotUsePropertyInitializerDescriptor.Id, "Prop1").WithLocation(19, 35)) 860Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.Id, ".Prop2 = New Bar() With {.Field = True}").WithLocation(21, 32), 861Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.Id, ".Field = 10").WithLocation(14, 34), 862Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.Id, ".Prop1 = Nothing").WithLocation(15, 32), 863Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.Id, ".Field = 10").WithLocation(16, 32), 864Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.Id, ".Prop1 = Nothing").WithLocation(16, 45), 865Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.Id, ".Prop2 = New Bar() With {.Field = True}").WithLocation(17, 32), 866Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.Id, ".Field = True").WithLocation(17, 57), 867Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.Id, ".Field = True").WithLocation(21, 57), 868Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.Id, "f1.Field = 0").WithLocation(22, 9), 869Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.Id, "f1.Prop1 = Nothing").WithLocation(23, 9), 870Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.Id, "f2.Field = True").WithLocation(26, 9)) 911Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{1, 2, 3, 4, 5, 6}").WithLocation(11, 34), 912Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{1, 2, 3, 4, 5, 6}").WithLocation(12, 20), 913Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}").WithLocation(13, 27), 914Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{1, 2, 3, 4, 5, 6}").WithLocation(15, 36), 915Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{1, 2, 3, 4, 5, 6}").WithLocation(16, 37), 916Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{7, 8, 9, 10, 11, 12}").WithLocation(17, 37), 917Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}").WithLocation(18, 30), 918Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}").WithLocation(19, 29), 919Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{1, 2, 3, 4, 5, 6}").WithLocation(24, 25)) 965Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "a1").WithLocation(5, 13), 966Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.Id, "Dim b1 As New Integer, b2, b3, b4 As New Goo(1)").WithLocation(6, 9), 967Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "b1").WithLocation(6, 13), 968Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "b2").WithLocation(6, 32), 969Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "b3").WithLocation(6, 36), 970Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "b4").WithLocation(6, 40), 971Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.Id, "Dim c1, c2 As Integer, c3, c4 As Goo").WithLocation(7, 9), 972Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.Id, "Dim e1 As Integer = 10, e2 = {1, 2, 3}, e3, e4 As C").WithLocation(9, 9), 973Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "e1").WithLocation(9, 13), 974Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "e2").WithLocation(9, 33), 975Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "f1").WithLocation(10, 13), 976Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "f2").WithLocation(10, 22), 977Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.Id, "Dim h1, h2, , h3 As Integer").WithLocation(11, 9), 978Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.Id, "Dim i1, i2, i3, i4 As New UndefType").WithLocation(12, 9), 979Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.Id, "Dim j1, j2, j3, j4 As UndefType").WithLocation(13, 9), 980Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.Id, "Dim k1 As Integer, k2, k3, k4 As New Goo(1)").WithLocation(14, 9), 981Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "k2").WithLocation(14, 28), 982Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "k3").WithLocation(14, 32), 983Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "k4").WithLocation(14, 36)) 1077Diagnostic(CaseTestAnalyzer.MultipleCaseClausesDescriptor.Id, 1080Diagnostic(CaseTestAnalyzer.HasDefaultCaseDescriptor.Id, "Case Else").WithLocation(8, 13), 1081Diagnostic(CaseTestAnalyzer.HasDefaultCaseDescriptor.Id, "Case Else").WithLocation(17, 13), 1082Diagnostic(CaseTestAnalyzer.HasDefaultCaseDescriptor.Id, "Case Else").WithLocation(26, 13), 1083Diagnostic(CaseTestAnalyzer.MultipleCaseClausesDescriptor.Id, 1086Diagnostic(CaseTestAnalyzer.HasDefaultCaseDescriptor.Id, "Case Else").WithLocation(33, 13), 1087Diagnostic(CaseTestAnalyzer.MultipleCaseClausesDescriptor.Id, 1090Diagnostic(CaseTestAnalyzer.HasDefaultCaseDescriptor.Id, "Case Else").WithLocation(50, 13)) 1122Diagnostic(ExplicitVsImplicitInstanceAnalyzer.ExplicitInstanceDescriptor.Id, "Me").WithLocation(3, 9), 1123Diagnostic(ExplicitVsImplicitInstanceAnalyzer.ImplicitInstanceDescriptor.Id, "M1").WithLocation(4, 9), 1124Diagnostic(ExplicitVsImplicitInstanceAnalyzer.ExplicitInstanceDescriptor.Id, "MyBase").WithLocation(13, 9), 1125Diagnostic(ExplicitVsImplicitInstanceAnalyzer.ImplicitInstanceDescriptor.Id, "M1").WithLocation(14, 9), 1126Diagnostic(ExplicitVsImplicitInstanceAnalyzer.ImplicitInstanceDescriptor.Id, "M2").WithLocation(15, 9)) 1162Diagnostic(MemberReferenceAnalyzer.HandlerAddedDescriptor.Id, "AddHandler Mumble, New MumbleEventHandler(AddressOf Mumbler)").WithLocation(7, 9), ' Bug: we are missing diagnostics of "MethodBindingDescriptor" here. https://github.com/dotnet/roslyn/issues/20095 1163Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.Id, "Mumble").WithLocation(7, 20), 1164Diagnostic(MemberReferenceAnalyzer.MethodBindingDescriptor.Id, "AddressOf Mumbler").WithLocation(7, 51), 1165Diagnostic(MemberReferenceAnalyzer.HandlerAddedDescriptor.Id, "AddHandler Mumble, New MumbleEventHandler(Sub(s As Object, a As System.EventArgs) 1167Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.Id, "Mumble").WithLocation(8, 20), 1168Diagnostic(MemberReferenceAnalyzer.HandlerAddedDescriptor.Id, "AddHandler Mumble, Sub(s As Object, a As System.EventArgs) 1170Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.Id, "Mumble").WithLocation(10, 20), 1171Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.Id, "Mumble").WithLocation(12, 20), 1172Diagnostic(MemberReferenceAnalyzer.MethodBindingDescriptor.Id, "AddressOf Mumbler").WithLocation(14, 39), 1173Diagnostic(MemberReferenceAnalyzer.HandlerRemovedDescriptor.Id, "RemoveHandler Mumble, AddressOf Mumbler").WithLocation(16, 9), 1174Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.Id, "Mumble").WithLocation(16, 23), 1175Diagnostic(MemberReferenceAnalyzer.MethodBindingDescriptor.Id, "AddressOf Mumbler").WithLocation(16, 31) 1215Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "M0(1, 2, 3, 4, 5)").WithLocation(9, 9), 1216Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "M0(1, 2, 3, 4, 5, 6)").WithLocation(10, 9), 1217Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "New Integer() { 2, 3, 4, 5 }").WithLocation(12, 15), 1218Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "New Integer() { 2, 3, 4, 5, 6 }").WithLocation(13, 15), 1219Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "D").WithLocation(14, 30), 1220Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "New Integer() { 2, 3, 4, 5 }").WithLocation(15, 26)) 1248Diagnostic(EqualsValueTestAnalyzer.EqualsValueDescriptor.Id, "= 44").WithLocation(2, 26), 1249Diagnostic(EqualsValueTestAnalyzer.EqualsValueDescriptor.Id, "= ""Hello""").WithLocation(3, 25), 1250Diagnostic(EqualsValueTestAnalyzer.EqualsValueDescriptor.Id, "= Goo()").WithLocation(4, 26), 1251Diagnostic(EqualsValueTestAnalyzer.EqualsValueDescriptor.Id, "= 20").WithLocation(10, 84)) 1280Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.Id, "0").WithLocation(8, 28), 1281Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.Id, "x").WithLocation(9, 28), 1282Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.Id, "12").WithLocation(12, 36)) 1326Diagnostic(NoneOperationTestAnalyzer.NoneOperationDescriptor.Id, <![CDATA[Public Sub Barney 1329Diagnostic(NoneOperationTestAnalyzer.NoneOperationDescriptor.Id, "Resume").WithLocation(23, 9)) 1379Diagnostic(LambdaTestAnalyzer.LambdaExpressionDescriptor.Id, "Sub() 1381Diagnostic(LambdaTestAnalyzer.LambdaExpressionDescriptor.Id, "Sub(s As Object, a As EventArgs) 1383Diagnostic(LambdaTestAnalyzer.LambdaExpressionDescriptor.Id, "Sub() 1386Diagnostic(LambdaTestAnalyzer.LambdaExpressionDescriptor.Id, "Sub(s As Object, a As EventArgs) 1392Diagnostic(LambdaTestAnalyzer.TooManyStatementsInLambdaExpressionDescriptor.Id, "Sub(s As Object, a As EventArgs) 1398Diagnostic(LambdaTestAnalyzer.LambdaExpressionDescriptor.Id, "Function(value As Integer) 1404Diagnostic(LambdaTestAnalyzer.TooManyStatementsInLambdaExpressionDescriptor.Id, "Function(value As Integer) 1454Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.Id, "AddHandler C.E, AddressOf D.Method").WithLocation(19, 9), 1455Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.Id, "AddressOf D.Method").WithLocation(19, 25), 1456Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.Id, "E").WithLocation(20, 20), 1457Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.Id, "C.Bar()").WithLocation(21, 9), 1458Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.Id, "AddHandler D.E, Sub() 1460Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.Id, "D.Field").WithLocation(25, 9), 1461Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.Id, "D.P").WithLocation(26, 17), 1462Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.Id, "D.Method()").WithLocation(27, 9)) 1485Diagnostic(LabelOperationsTestAnalyzer.LabelDescriptor.Id, "Wilma:").WithLocation(3, 9), 1486Diagnostic(LabelOperationsTestAnalyzer.GotoDescriptor.Id, "GoTo Betty").WithLocation(4, 9), 1487Diagnostic(LabelOperationsTestAnalyzer.LabelDescriptor.Id, "Betty:").WithLocation(5, 9), 1488Diagnostic(LabelOperationsTestAnalyzer.GotoDescriptor.Id, "GoTo Wilma").WithLocation(6, 9)) 1541Diagnostic(UnaryAndBinaryOperationsTestAnalyzer.BooleanNotDescriptor.Id, "Not b").WithLocation(33, 13), 1542Diagnostic(UnaryAndBinaryOperationsTestAnalyzer.DoubleMultiplyDescriptor.Id, "d * 100").WithLocation(34, 13), 1543Diagnostic(UnaryAndBinaryOperationsTestAnalyzer.OperatorAddMethodDescriptor.Id, "a1 + a2").WithLocation(35, 14), 1544Diagnostic(UnaryAndBinaryOperationsTestAnalyzer.OperatorMinusMethodDescriptor.Id, "-a2").WithLocation(36, 14)) 1783Diagnostic(NullOperationSyntaxTestAnalyzer.ParamsArrayOperationDescriptor.Id, "M0()").WithLocation(6, 9), 1784Diagnostic(NullOperationSyntaxTestAnalyzer.ParamsArrayOperationDescriptor.Id, "M0(1)").WithLocation(7, 9), 1785Diagnostic(NullOperationSyntaxTestAnalyzer.ParamsArrayOperationDescriptor.Id, "M0(1, 2)").WithLocation(8, 9)) 1815Diagnostic(InvalidOperatorExpressionTestAnalyzer.InvalidBinaryDescriptor.Id, "b + c").WithLocation(3, 16), 1816Diagnostic(InvalidOperatorExpressionTestAnalyzer.InvalidUnaryDescriptor.Id, "-s").WithLocation(7, 16)) 1846Diagnostic(ParamsArrayTestAnalyzer.InvalidConstructorDescriptor.Id, "New C.S()").WithLocation(7, 11)) 1906Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.Id, "p?.Prop").WithLocation(24, 17), 1907Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.Id, "p").WithLocation(24, 17), 1908Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.Id, "p?.Field").WithLocation(25, 13), 1909Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.Id, "p").WithLocation(25, 13), 1910Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.Id, "p?(0)").WithLocation(26, 13), 1911Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.Id, "p").WithLocation(26, 13), 1912Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.Id, "p?.M0(Nothing)").WithLocation(27, 9), 1913Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.Id, "p").WithLocation(27, 9), 1914Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.Id, "Field1?.Prop").WithLocation(29, 13), 1915Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.Id, "Field1").WithLocation(29, 13), 1916Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.Id, "Field1?.Field").WithLocation(30, 13), 1917Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.Id, "Field1").WithLocation(30, 13), 1918Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.Id, "Field1?(0)").WithLocation(31, 13), 1919Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.Id, "Field1").WithLocation(31, 13), 1920Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.Id, "Field1?.M0(Nothing)").WithLocation(32, 9), 1921Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.Id, "Field1").WithLocation(32, 9)) 1989Diagnostic(ForLoopConditionCrashVBTestAnalyzer.ForLoopConditionCrashDescriptor.Id, "Boo").WithLocation(41, 24), 1990Diagnostic(ForLoopConditionCrashVBTestAnalyzer.ForLoopConditionCrashDescriptor.Id, "10").WithLocation(19, 40)) 2123Diagnostic(TrueFalseUnaryOperationTestAnalyzer.UnaryTrueDescriptor.Id, "x").WithLocation(27, 12), 2124Diagnostic(TrueFalseUnaryOperationTestAnalyzer.UnaryTrueDescriptor.Id, "x AndAlso y").WithLocation(33, 12))
Microsoft.CodeAnalysis.Workspaces (11)
Diagnostics\DiagnosticAnalyzerInfoCache.cs (3)
191if (!_idToDescriptorsMap.TryGetValue(descriptor.Id, out var existingDescriptor)) 193_idToDescriptorsMap[descriptor.Id] = descriptor; 204_idToDescriptorsMap[descriptor.Id] = null;
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.UnitTests (1)
BatchFixAllProviderTests.cs (1)
91public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(LiteralZeroAnalyzer.Descriptor.Id);
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 (18)
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);
DiagDescriptorsTests.cs (2)
29Assert.True(descriptor.IsEnabledByDefault, descriptor.Id + " should be enabled by default"); 30Assert.EndsWith("/" + descriptor.Id, descriptor.HelpLinkUri, StringComparison.OrdinalIgnoreCase);
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 (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 (38)
DiagDescriptorsTests.cs (2)
28Assert.True(descriptor.IsEnabledByDefault, descriptor.Id + " should be enabled by default"); 29Assert.EndsWith("/" + descriptor.Id, descriptor.HelpLinkUri, StringComparison.OrdinalIgnoreCase);
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 (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))
Mvc.Api.Analyzers.Test (8)
ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzerIntegrationTest.cs (1)
77Assert.Equal(descriptor.Id, diagnostic.Id);
ApiConventionAnalyzerIntegrationTest.cs (7)
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); 312ApiDiagnosticDescriptors.API1002_ActionDoesNotReturnDocumentedStatusCode.Id,
System.Text.RegularExpressions.Generator (1)
UpgradeToGeneratedRegexCodeFixer.cs (1)
35public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(DiagnosticDescriptors.UseRegexSourceGeneration.Id);