1 write to Id
Microsoft.CodeAnalysis (1)
Diagnostic\DiagnosticDescriptor.cs (1)
174
this.
Id
= id;
868 references to Id
BuildActionTelemetryTable (5)
DiagnosticDescriptorExtensions.cs (5)
44
(!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.
Id
, out var reportDiagnostic) ||
47
if (treeOptions.TryGetValue(descriptor.
Id
, out reportDiagnostic) && reportDiagnostic != ReportDiagnostic.Default ||
61
var diagnosticKey = $"{DotnetDiagnosticPrefix}.{descriptor.
Id
}.{SeveritySuffix}";
103
var diagnosticKey = $"{DotnetDiagnosticPrefix}.{descriptor.
Id
}.{SeveritySuffix}";
198
return new DiagnosticDescriptor(descriptor.
Id
, descriptor.Title, messageFormat,
CodeStyleConfigFileGenerator (4)
Program.cs (4)
63
allRulesById[rule.
Id
] = rule;
149
result.AppendLine($"# {rule.
Id
}: {rule.Title}");
150
result.AppendLine($"dotnet_diagnostic.{rule.
Id
}.severity = {severityString}");
157
$"DiagnosticDescriptor for '{rule.
Id
}' must have a {nameof(EnforceOnBuild)} custom tag");
GenerateRulesMissingDocumentation (1)
Program.cs (1)
143
allRulesById[rule.
Id
] = rule;
Microsoft.CodeAnalysis (33)
CommandLine\CommonCompiler.SuppressionDiagnostic.cs (1)
49
public override string Id => Descriptor.
Id
;
CommandLine\ReportAnalyzerUtil.cs (1)
92
var analyzerIds = string.Join(", ", kvp.Key.SupportedDiagnostics.Select(d => d.
Id
).Distinct().OrderBy(id => id));
CommandLine\SarifDiagnosticComparer.cs (3)
53
&& x.
Id
== y.
Id
70
Hash.Combine(obj.
Id
.GetHashCode(),
CommandLine\SarifV1ErrorLogger.cs (8)
157
_writer.Write("id", descriptor.
Id
);
224
/// The first <see cref="DiagnosticDescriptor"/> added with a given <see cref="DiagnosticDescriptor.
Id
"/>
256
if (!_counters.TryGetValue(descriptor.
Id
, out int counter))
258
_counters.Add(descriptor.
Id
, 0);
259
_keys.Add(descriptor, descriptor.
Id
);
260
return descriptor.
Id
;
269
_counters[descriptor.
Id
] = ++counter;
270
key = descriptor.
Id
+ "-" + counter.ToString("000", CultureInfo.InvariantCulture);
CommandLine\SarifV2ErrorLogger.cs (3)
119
foreach (var (descriptor, hasAnyExternalSuppression) in descriptors.OrderBy(d => d.Descriptor.
Id
))
221
_writer.Write("id", descriptor.
Id
);
252
var hasAnySourceSuppression = _diagnosticIdsWithAnySourceSuppressions.Contains(descriptor.
Id
);
Diagnostic\Diagnostic.DiagnosticWithProgrammaticSuppression.cs (1)
40
get { return Descriptor.
Id
; }
Diagnostic\Diagnostic_SimpleDiagnostic.cs (1)
87
get { return _descriptor.
Id
; }
Diagnostic\DiagnosticDescriptor.cs (3)
198
this.
Id
== other.
Id
&&
215
Hash.Combine(this.
Id
.GetHashCode(),
DiagnosticAnalyzer\AnalyzerDriver.cs (4)
912
if (!uniqueDiagnosticIds.Add(descriptor.
Id
))
920
SuppressedDiagnosticIdsForUnsuppressedAnalyzers.Contains(descriptor.
Id
);
1312
if (options.TryGetDiagnosticValue(tree, descriptor.
Id
, AnalyzerExecutor.CancellationToken, out var severityFromOptions) ||
1313
options.TryGetGlobalDiagnosticValue(descriptor.
Id
, AnalyzerExecutor.CancellationToken, out severityFromOptions))
DiagnosticAnalyzer\AnalyzerExecutor.cs (1)
1231
diagnosticIds = diagnosticIds.Add(diagnostic.
Id
);
DiagnosticAnalyzer\AnalyzerManager.cs (4)
280
if (descriptor.
Id
.Equals(diagnostic.Id, StringComparison.OrdinalIgnoreCase))
332
if ((diagnosticOptions.TryGetValue(diag.
Id
, out var severity) ||
333
options.SyntaxTreeOptionsProvider is object && options.SyntaxTreeOptionsProvider.TryGetGlobalDiagnosticValue(diag.
Id
, analyzerExecutor.CancellationToken, out severity)) &&
387
if (treeOptions.TryGetDiagnosticValue(tree, descriptor.
Id
, cancellationToken, out var configuredValue) ||
DiagnosticAnalyzer\AnalyzerOptionsExtensions.cs (3)
53
if (compilation.Options.SpecificDiagnosticOptions.ContainsKey(descriptor.
Id
) ||
54
compilation.Options.SyntaxTreeOptionsProvider?.TryGetDiagnosticValue(tree, descriptor.
Id
, cancellationToken, out _) == true ||
55
compilation.Options.SyntaxTreeOptionsProvider?.TryGetGlobalDiagnosticValue(descriptor.
Id
, cancellationToken, out _) == true)
Microsoft.CodeAnalysis.CodeStyle (12)
AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs (2)
86
AddDiagnosticIdToOptionMapping(descriptor.
Id
, option);
99
AddDiagnosticIdToOptionMapping(descriptor.
Id
, options);
AbstractBuiltInUnnecessaryCodeStyleDiagnosticAnalyzer.cs (2)
95
AddDiagnosticIdToFadingOptionMapping(descriptor.
Id
, fadingOption);
134
IDEDiagnosticIdToOptionMappingHelper.AddFadingOptionMapping(descriptor.
Id
, fadingOption);
AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
425
if (!idsToAnalyze.Contains(descriptor.
Id
))
433
unhandledIds.Add(descriptor.
Id
);
DiagnosticDescriptorExtensions.cs (5)
44
(!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.
Id
, out var reportDiagnostic) ||
47
if (treeOptions.TryGetValue(descriptor.
Id
, out reportDiagnostic) && reportDiagnostic != ReportDiagnostic.Default ||
61
var diagnosticKey = $"{DotnetDiagnosticPrefix}.{descriptor.
Id
}.{SeveritySuffix}";
103
var diagnosticKey = $"{DotnetDiagnosticPrefix}.{descriptor.
Id
}.{SeveritySuffix}";
198
return new DiagnosticDescriptor(descriptor.
Id
, descriptor.Title, messageFormat,
DiagnosticHelper.cs (1)
241
descriptor.
Id
,
Microsoft.CodeAnalysis.CodeStyle.LegacyTestFramework.UnitTestUtilities (3)
AbstractDiagnosticProviderBasedUserDiagnosticTest.cs (3)
129
if (descriptor.
Id
is "RE0001" or "JSON001" or "JSON002") // Currently not documented. https://github.com/dotnet/roslyn/issues/48530
132
if (descriptor.
Id
== "IDE0043") // Intentionally undocumented. It will be removed in favor of CA2241
135
if (descriptor.
Id
== "IDE1007")
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (3)
ConvertSwitchStatementToExpressionTests.cs (1)
888
var descriptor = analyzer.SupportedDiagnostics.First(descriptor => descriptor.
Id
== IDEDiagnosticIds.ConvertSwitchStatementToExpressionDiagnosticId);
RemoveUnusedMembersTests.cs (1)
1441
var descriptor = new CSharpRemoveUnusedMembersDiagnosticAnalyzer().SupportedDiagnostics.First(x => x.
Id
== "IDE0052");
SimplifyInterpolationTests.cs (1)
50
diagnostics.Select(d => (d.Descriptor.
Id
, d.Severity)));
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (25)
CommandLineTests.cs (23)
9378
Assert.Contains(AnalyzerThatThrowsInGetMessage.Rule.
Id
, output, StringComparison.Ordinal);
9425
Assert.Contains(AnalyzerThatThrowsInGetMessage.Rule.
Id
, output, StringComparison.Ordinal);
12439
Assert.Contains($"warning {analyzer.Descriptor.
Id
}", output, StringComparison.Ordinal);
12443
var suppressor = new DiagnosticSuppressorForId(analyzer.Descriptor.
Id
);
12457
Assert.DoesNotContain($"warning {analyzer.Descriptor.
Id
}", output, StringComparison.Ordinal);
12466
Assert.Contains($"error {analyzer.Descriptor.
Id
}", output, StringComparison.Ordinal);
12475
Assert.DoesNotContain($"warning {analyzer.Descriptor.
Id
}", output, StringComparison.Ordinal);
12481
suppressor = new DiagnosticSuppressorForId(analyzer.Descriptor.
Id
);
12486
Assert.Contains($"warning {analyzer.Descriptor.
Id
}", output, StringComparison.Ordinal);
12506
Assert.Contains($"error {analyzer.Descriptor.
Id
}", output, StringComparison.Ordinal);
12509
var suppressor = new DiagnosticSuppressorForId(analyzer.Descriptor.
Id
);
12514
Assert.Contains($"error {analyzer.Descriptor.
Id
}", output, StringComparison.Ordinal);
12529
var diagnosticId = analyzer.Descriptor.
Id
;
12629
var diagnosticId = analyzer.Descriptor.
Id
;
12701
var diagnosticId = analyzer.Descriptor.
Id
;
12749
var diagnosticId = analyzer.Descriptor.
Id
;
12968
Assert.Contains($"{expectedDiagnosticSeverity} {WarningDiagnosticAnalyzer.Warning01.
Id
}", output);
13004
dotnet_diagnostic.{descriptor.
Id
}.severity = {analyzerConfigSeverity.ToAnalyzerConfigString()}");
13014
arguments = arguments.Append($"/nowarn:{descriptor.
Id
}");
13040
Assert.Contains($"{prefix} {descriptor.
Id
}: {descriptor.MessageFormat}", outWriter.ToString());
13044
Assert.DoesNotContain(descriptor.
Id
.ToString(), outWriter.ToString());
13140
var diagnosticId = analyzer.Descriptor.
Id
;
13187
var diagnosticId = analyzer.Descriptor.
Id
;
SarifErrorLoggerTests.cs (2)
152
Assert.Contains(AnalyzerForErrorLogTest.Descriptor1.
Id
, actualConsoleOutput);
153
Assert.Contains(AnalyzerForErrorLogTest.Descriptor2.
Id
, actualConsoleOutput);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (38)
ConvertSwitchStatementToExpressionTests.cs (1)
888
var descriptor = analyzer.SupportedDiagnostics.First(descriptor => descriptor.
Id
== IDEDiagnosticIds.ConvertSwitchStatementToExpressionDiagnosticId);
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (14)
263
var diagnosticsFromAnalyzer = diagnostics.Where(d => d.Id == CodeBlockAnalyzerFactory.Descriptor.
Id
);
282
var diagnosticsFromAnalyzer = diagnostics.Where(d => d.Id == CodeBlockAnalyzerFactory.Descriptor.
Id
);
366
Assert.Equal(reportedDiagnosticIds, nugetAnalyzer.SupportedDiagnostics.Select(d => d.
Id
).Order());
367
Assert.Equal(reportedDiagnosticIds, vsixAnalyzer.SupportedDiagnostics.Select(d => d.
Id
).Order());
426
Assert.Equal(nugetAnalyzerDiagnosticIds, nugetAnalyzer.SupportedDiagnostics.Select(d => d.
Id
).Order());
427
Assert.Equal(vsixAnalyzerDiagnosticIds, vsixAnalyzer.SupportedDiagnostics.Select(d => d.
Id
).Order());
478
Assert.Equal(nugetAnalyzerDiagnosticIds, nugetAnalyzer.SupportedDiagnostics.Select(d => d.
Id
).Order());
479
Assert.Equal(vsixAnalyzerDiagnosticIds, vsixAnalyzer.SupportedDiagnostics.Select(d => d.
Id
).Order());
531
Assert.Equal(firstNugetAnalyzerDiagnosticIds, firstNugetAnalyzer.SupportedDiagnostics.Select(d => d.
Id
).Order());
532
Assert.Equal(secondNugetAnalyzerDiagnosticIds, secondNugetAnalyzer.SupportedDiagnostics.Select(d => d.
Id
).Order());
533
Assert.Equal(vsixAnalyzerDiagnosticIds, vsixAnalyzer.SupportedDiagnostics.Select(d => d.
Id
).Order());
608
Assert.Equal(firstNugetAnalyzerDiagnosticIds, firstNugetAnalyzer.SupportedDiagnostics.Select(d => d.
Id
).Order());
609
Assert.Equal(secondNugetAnalyzerDiagnosticIds, secondNugetAnalyzer.SupportedDiagnostics.Select(d => d.
Id
).Order());
610
Assert.Equal(vsixAnalyzerDiagnosticIds, vsixAnalyzer.SupportedDiagnostics.Select(d => d.
Id
).Order());
Diagnostics\FixAllProvider\BatchFixerTests.cs (1)
67
return ImmutableArray.Create(QualifyWithThisAnalyzer.Descriptor.
Id
);
Diagnostics\Suppression\RemoveUnnecessaryPragmaSuppressionsTests.cs (17)
188
protected override string VariableDeclaredButNotUsedDiagnosticId => UserDiagnosticAnalyzer.Descriptor0168.
Id
;
189
protected override string VariableAssignedButNotUsedDiagnosticId => UserDiagnosticAnalyzer.Descriptor0219.
Id
;
192
CompilationEndDiagnosticAnalyzer.Descriptor.
Id
,
1048
[System.Diagnostics.CodeAnalysis.SuppressMessage(""Category"", ""{UserDiagnosticAnalyzer.Descriptor0168.
Id
}"")] // Variable is declared but never used - Unnecessary, but suppressed
1052
#pragma warning disable {UserDiagnosticAnalyzer.Descriptor0168.
Id
} // Variable is declared but never used - Unnecessary, but suppressed
1054
#pragma warning restore {UserDiagnosticAnalyzer.Descriptor0168.
Id
} // Variable is declared but never used - Unnecessary, but suppressed
1122
{ CodeStyleOptions2.RemoveUnnecessarySuppressionExclusions, excludeAll ? "all" : $"CS0168, {UserDiagnosticAnalyzer.Descriptor0168.
Id
}" }
1130
[System.Diagnostics.CodeAnalysis.SuppressMessage(""Category"", ""{UserDiagnosticAnalyzer.Descriptor0168.
Id
}"")] // Variable is declared but never used - Unnecessary, but suppressed
1134
#pragma warning disable {UserDiagnosticAnalyzer.Descriptor0168.
Id
} // Variable is declared but never used - Unnecessary, but suppressed
1136
#pragma warning restore {UserDiagnosticAnalyzer.Descriptor0168.
Id
} // Variable is declared but never used - Unnecessary, but suppressed
1147
? ("CS0168", UserDiagnosticAnalyzer.Descriptor0168.
Id
)
1148
: (UserDiagnosticAnalyzer.Descriptor0168.
Id
, "CS0168");
1212
#pragma warning disable {UserDiagnosticAnalyzer.Descriptor0168.
Id
}
1214
[System.Diagnostics.CodeAnalysis.SuppressMessage(""Category"", ""{UserDiagnosticAnalyzer.Descriptor0168.
Id
}"")]
1218
[System.Diagnostics.CodeAnalysis.SuppressMessage(""Category"", ""{UserDiagnosticAnalyzer.Descriptor0168.
Id
}"")]
1221
{disablePrefix}#pragma warning disable {UserDiagnosticAnalyzer.Descriptor0168.
Id
} // Variable is declared but never used - Unnecessary{disableSuffix}
1224
{restorePrefix}#pragma warning restore {UserDiagnosticAnalyzer.Descriptor0168.
Id
} // Variable is declared but never used - Unnecessary{restoreSuffix}
Diagnostics\Suppression\SuppressionTests.cs (2)
956
#pragma warning disable {UserDiagnosticAnalyzer.Decsciptor.
Id
} // {UserDiagnosticAnalyzer.Decsciptor.Title}
960
#pragma warning restore {UserDiagnosticAnalyzer.Decsciptor.
Id
} // {UserDiagnosticAnalyzer.Decsciptor.Title}
Formatting\CodeCleanupTests.cs (1)
730
var diagnosticIds = analyzer.SupportedDiagnostics.SelectAsArray(d => d.
Id
);
RemoveUnusedMembersTests.cs (1)
1441
var descriptor = new CSharpRemoveUnusedMembersDiagnosticAnalyzer().SupportedDiagnostics.First(x => x.
Id
== "IDE0052");
SimplifyInterpolationTests.cs (1)
50
diagnostics.Select(d => (d.Descriptor.
Id
, d.Severity)));
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (285)
Diagnostics\DiagnosticAnalyzerTests.cs (51)
316
specificDiagOptions.Add(noneDiagDescriptor.
Id
, ReportDiagnostic.Error);
317
specificDiagOptions.Add(infoDiagDescriptor.
Id
, ReportDiagnostic.Error);
318
specificDiagOptions.Add(warningDiagDescriptor.
Id
, ReportDiagnostic.Error);
331
specificDiagOptions.Add(noneDiagDescriptor.
Id
, ReportDiagnostic.Suppress);
332
specificDiagOptions.Add(infoDiagDescriptor.
Id
, ReportDiagnostic.Suppress);
333
specificDiagOptions.Add(warningDiagDescriptor.
Id
, ReportDiagnostic.Suppress);
334
specificDiagOptions.Add(errorDiagDescriptor.
Id
, ReportDiagnostic.Suppress);
343
specificDiagOptions.Add(noneDiagDescriptor.
Id
, ReportDiagnostic.Info);
344
specificDiagOptions.Add(infoDiagDescriptor.
Id
, ReportDiagnostic.Hidden);
345
specificDiagOptions.Add(warningDiagDescriptor.
Id
, ReportDiagnostic.Error);
346
specificDiagOptions.Add(errorDiagDescriptor.
Id
, ReportDiagnostic.Warn);
360
Assert.Equal(infoDiagDescriptor.
Id
, effectiveDiag.Id);
364
Assert.Equal(noneDiagDescriptor.
Id
, effectiveDiag.Id);
368
Assert.Equal(errorDiagDescriptor.
Id
, effectiveDiag.Id);
372
Assert.Equal(warningDiagDescriptor.
Id
, effectiveDiag.Id);
458
specificDiagOptions.Add(disabledDiagDescriptor.
Id
, ReportDiagnostic.Warn);
459
specificDiagOptions.Add(enabledDiagDescriptor.
Id
, ReportDiagnostic.Suppress);
530
specificDiagOptions.Add(FullyDisabledAnalyzer.desc1.
Id
, ReportDiagnostic.Warn);
531
specificDiagOptions.Add(PartiallyDisabledAnalyzer.desc2.
Id
, ReportDiagnostic.Suppress);
539
specificDiagOptions.Add(FullyDisabledAnalyzer.desc3.
Id
, ReportDiagnostic.Warn);
726
var id = Int32.Parse(descriptor.
Id
.Substring(2));
728
var message = string.Format("Add resource string named '{0}' for Title of '{1}' to '{2}'", missingResource, descriptor.
Id
, nameof(CSharpResources));
738
var message = string.Format("'{0}' must have a non-null non-empty 'Category'", descriptor.
Id
);
853
string message = new ArgumentException(string.Format(CodeAnalysisResources.UnsupportedDiagnosticReported, AnalyzerReportingUnsupportedDiagnostic.UnsupportedDescriptor.
Id
), "diagnostic").Message;
911
string message = new ArgumentException(string.Format(CodeAnalysisResources.InvalidDiagnosticIdReported, AnalyzerWithInvalidDiagnosticId.Descriptor.
Id
), "diagnostic").Message;
1014
string.Format(CodeAnalysisResources.InvalidDiagnosticLocationReported, AnalyzerWithInvalidDiagnosticLocation.Descriptor.
Id
, treeInAnotherCompilation.FilePath), "diagnostic").Message;
1107
string.Format(CodeAnalysisResources.InvalidDiagnosticSpanReported, AnalyzerWithInvalidDiagnosticSpan.Descriptor.
Id
, badSpan, treeInAnotherCompilation.FilePath), "diagnostic").Message;
1136
.VerifyAnalyzerDiagnostics(analyzers, null, null, expected: Diagnostic(NotConfigurableDiagnosticAnalyzer.EnabledRule.
Id
));
1140
specificDiagOptions.Add(NotConfigurableDiagnosticAnalyzer.EnabledRule.
Id
, ReportDiagnostic.Suppress);
1145
.VerifyAnalyzerDiagnostics(analyzers, null, null, expected: Diagnostic(NotConfigurableDiagnosticAnalyzer.EnabledRule.
Id
));
1149
specificDiagOptions.Add(NotConfigurableDiagnosticAnalyzer.DisabledRule.
Id
, ReportDiagnostic.Warn);
1154
.VerifyAnalyzerDiagnostics(analyzers, null, null, expected: Diagnostic(NotConfigurableDiagnosticAnalyzer.EnabledRule.
Id
));
1171
Diagnostic(CodeBlockActionAnalyzer.CodeBlockTopLevelRule.
Id
, "M").WithArguments("M").WithLocation(4, 17),
1172
Diagnostic(CodeBlockActionAnalyzer.CodeBlockPerCompilationRule.
Id
, "M").WithArguments("M").WithLocation(4, 17)
1189
.VerifyAnalyzerDiagnostics(analyzers, null, null, expected: Diagnostic(CodeBlockActionAnalyzer.CodeBlockTopLevelRule.
Id
, "M").WithArguments("M").WithLocation(4, 17));
1367
Diagnostic(CSharpCodeBlockObjectCreationAnalyzer.DiagnosticDescriptor.
Id
, "new C()").WithLocation(5, 18)
1431
expected[i] = Diagnostic(ConcurrentAnalyzer.Descriptor.
Id
, typeName)
1687
Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.
Id
, "0").WithLocation(12, 17),
1688
Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.
Id
, "x").WithLocation(13, 17),
1689
Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.
Id
, "12").WithLocation(16, 29));
1833
if (((string)builder[i].Code) != GeneratedCodeAnalyzer.Error.
Id
)
1859
var diagnostic = Diagnostic(GeneratedCodeAnalyzer.Warning.
Id
, squiggledText).WithArguments(arguments).WithLocation(line, column);
1862
diagnostic = Diagnostic(GeneratedCodeAnalyzer.Error.
Id
, squiggledText).WithArguments(arguments).WithLocation(line, column);
1869
AddExpectedDiagnostic(builder, descriptor.
Id
, squiggledText: null, line: 1, column: 1, arguments: arguments);
3627
Assert.Equal(((FieldAnalyzer)analyzer).Descriptor.
Id
, diagnostic.Id);
3811
Assert.Equal(analyzer.Descriptor.
Id
, diagnostic.Id);
3876
d => d.Id == analyzer.Descriptor.
Id
&& PathUtilities.Comparer.Equals(d.Location.GetLineSpan().Path, additionalFile.Path));
4031
new TestSyntaxTreeOptionsProvider(tree1, (AnalyzerWithDisabledRules.Rule.
Id
, ReportDiagnostic.Warn)));
4041
.WithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>.Empty.Add(AnalyzerWithDisabledRules.Rule.
Id
, ReportDiagnostic.Warn))
4043
(tree2, new[] { (AnalyzerWithDisabledRules.Rule.
Id
, ReportDiagnostic.Suppress) }),
4044
(tree3, new[] { (AnalyzerWithDisabledRules.Rule.
Id
, ReportDiagnostic.Suppress) })));
Diagnostics\DiagnosticSuppressorTests.cs (29)
147
Diagnostic(analyzer.Descriptor.
Id
, source1, isSuppressed: false).WithLocation(1, 1),
148
Diagnostic(analyzer.Descriptor.
Id
, source2, isSuppressed: false).WithLocation(1, 1),
152
var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, new DiagnosticSuppressorForId(analyzer.Descriptor.
Id
) };
154
Diagnostic(analyzer.Descriptor.
Id
, source1, isSuppressed: true).WithLocation(1, 1),
155
Diagnostic(analyzer.Descriptor.
Id
, source2, isSuppressed: true).WithLocation(1, 1),
169
var expectedDiagnostic = Diagnostic(analyzer.Descriptor.
Id
, source, isSuppressed: false).WithLocation(1, 1);
173
expectedDiagnostic = Diagnostic(analyzer.Descriptor.
Id
, source, isSuppressed: true).WithLocation(1, 1);
174
var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, new DiagnosticSuppressorForId(analyzer.Descriptor.
Id
), new DiagnosticSuppressorForId(analyzer.Descriptor.
Id
) };
179
analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, new DiagnosticSuppressorForId(analyzer.Descriptor.
Id
, suppressionId: "SPR0001"), new DiagnosticSuppressorForId(analyzer.Descriptor.
Id
, suppressionId: "SPR0002") };
196
Diagnostic(analyzer.Descriptor.
Id
, source));
199
var suppressor2 = new DiagnosticSuppressorForId(analyzer.Descriptor.
Id
);
204
Diagnostic(analyzer.Descriptor.
Id
, source, isSuppressed: true));
217
var expectedDiagnostic = Diagnostic(analyzer.Descriptor.
Id
, source, isSuppressed: false);
221
var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, new DiagnosticSuppressorForId(analyzer.Descriptor.
Id
, suppressionId) };
222
expectedDiagnostic = Diagnostic(analyzer.Descriptor.
Id
, source, isSuppressed: true);
267
var suppressor = new DiagnosticSuppressorForId(analyzer.Descriptor.
Id
);
272
key: analyzer.Descriptor.
Id
,
346
var suppressor = new DiagnosticSuppressorThrowsExceptionFromReportedSuppressions(analyzer.Descriptor.
Id
, expectedException);
392
var suppressor = new DiagnosticSuppressor_UnsupportedSuppressionReported(analyzer.Descriptor.
Id
, supportedSuppressionId, unsupportedSuppressionId);
445
var suppressor = new DiagnosticSuppressor_InvalidDiagnosticSuppressionReported(analyzer.Descriptor.
Id
, unsupportedSuppressedId);
449
var exceptionMessage = string.Format(CodeAnalysisResources.InvalidDiagnosticSuppressionReported, analyzer.Descriptor.
Id
, unsupportedSuppressedId);
498
var suppressor = new DiagnosticSuppressor_NonReportedDiagnosticCannotBeSuppressed(analyzer.Descriptor.
Id
, nonReportedDiagnosticId);
547
var expectedDiagnostic = Diagnostic(analyzer.Descriptor.
Id
, source);
551
var suppressor = new DiagnosticSuppressorForId(analyzer.Descriptor.
Id
, suppressionId);
560
var suppressor2 = new DiagnosticSuppressorForId(analyzer.Descriptor.
Id
, suppressionId2);
583
var expectedDiagnostic = Diagnostic(analyzer.Descriptor.
Id
, source);
586
var suppressor = new DiagnosticSuppressorForId_ThrowsOperationCancelledException(analyzer.Descriptor.
Id
);
Diagnostics\OperationAnalyzerTests.cs (205)
49
Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.
Id
, "new int[0]").WithLocation(6, 22),
50
Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.
Id
, "{ }").WithLocation(7, 23),
51
Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.
Id
, "new C[] { }").WithLocation(8, 20),
52
Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.
Id
, "new int[0][]").WithLocation(12, 24),
53
Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.
Id
, "new int[0][][][]").WithLocation(13, 28),
54
Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.
Id
, "new int[0][,]").WithLocation(15, 26)
111
Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.
Id
, "3").WithLocation(9, 25),
112
Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.
Id
, "v1").WithLocation(9, 34),
113
Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.
Id
, "v3").WithLocation(10, 22),
114
Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.
Id
, "3").WithLocation(13, 21),
115
Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.
Id
, "v3").WithLocation(17, 21),
116
Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.
Id
, "p1").WithLocation(35, 9),
117
Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.
Id
, "this").WithLocation(36, 13),
118
Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.
Id
, "33").WithLocation(45, 21)
141
Diagnostic(BadStuffTestAnalyzer.InvalidExpressionDescriptor.
Id
, "Framitz()").WithLocation(6, 9),
142
Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.
Id
, "Framitz()").WithLocation(6, 9),
143
Diagnostic(BadStuffTestAnalyzer.InvalidExpressionDescriptor.
Id
, "Framitz").WithLocation(6, 9),
144
Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.
Id
, "Framitz").WithLocation(6, 9),
145
Diagnostic(BadStuffTestAnalyzer.InvalidExpressionDescriptor.
Id
, "Bexley()").WithLocation(7, 17),
146
Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.
Id
, "Bexley()").WithLocation(7, 17),
147
Diagnostic(BadStuffTestAnalyzer.InvalidExpressionDescriptor.
Id
, "Bexley").WithLocation(7, 17),
148
Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.
Id
, "Bexley").WithLocation(7, 17),
149
Diagnostic(BadStuffTestAnalyzer.InvalidExpressionDescriptor.
Id
, "M1(y + d)").WithLocation(10, 9),
150
Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.
Id
, "M1(y + d)").WithLocation(10, 9),
151
Diagnostic(BadStuffTestAnalyzer.InvalidStatementDescriptor.
Id
, "goto;").WithLocation(11, 9),
152
Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.
Id
, "goto;").WithLocation(11, 9),
153
Diagnostic(BadStuffTestAnalyzer.InvalidStatementDescriptor.
Id
, "").WithLocation(11, 13),
154
Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.
Id
, "").WithLocation(11, 13)
218
Diagnostic(BigForTestAnalyzer.BigForDescriptor.
Id
, "for (x = 0; x < 2000000; x++) {}").WithLocation(9, 9),
219
Diagnostic(BigForTestAnalyzer.BigForDescriptor.
Id
, "for (x = 3000000; x > 0; x -= 2) {}").WithLocation(13, 9),
220
Diagnostic(BigForTestAnalyzer.BigForDescriptor.
Id
, "for (x = 0; x < 2000000; x = x + 1) {}").WithLocation(17, 9));
283
Diagnostic(SwitchTestAnalyzer.SparseSwitchDescriptor.
Id
, "y").WithLocation(16, 17),
284
Diagnostic(SwitchTestAnalyzer.SparseSwitchDescriptor.
Id
, "x").WithLocation(26, 17),
285
Diagnostic(SwitchTestAnalyzer.NoDefaultSwitchDescriptor.
Id
, "x").WithLocation(26, 17),
286
Diagnostic(SwitchTestAnalyzer.OnlyDefaultSwitchDescriptor.
Id
, "y").WithLocation(34, 17),
287
Diagnostic(SwitchTestAnalyzer.SparseSwitchDescriptor.
Id
, "y").WithLocation(40, 17),
288
Diagnostic(SwitchTestAnalyzer.NoDefaultSwitchDescriptor.
Id
, "y").WithLocation(40, 17));
348
Diagnostic(InvocationTestAnalyzer.BigParamArrayArgumentsDescriptor.
Id
, "M0(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)").WithLocation(19, 9),
349
Diagnostic(InvocationTestAnalyzer.BigParamArrayArgumentsDescriptor.
Id
, "M0(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)").WithLocation(20, 9),
350
Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.
Id
, "3").WithLocation(23, 21),
351
Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.
Id
, "M3(0)").WithArguments("y").WithLocation(33, 9),
352
Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.
Id
, "M3(y: null)").WithArguments("x").WithLocation(34, 9),
353
Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.
Id
, "M3(x: 0)").WithArguments("y").WithLocation(35, 9),
354
Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.
Id
, "M3()").WithArguments("x").WithLocation(36, 9),
355
Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.
Id
, "M3()").WithArguments("y").WithLocation(36, 9),
356
Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.
Id
, "M5(b: new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11})").WithArguments("x").WithLocation(47, 9));
425
Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.
Id
, "F5").WithLocation(8, 9),
426
Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.
Id
, "F6").WithLocation(9, 9),
427
Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.
Id
, "F10").WithLocation(13, 8));
497
Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.
Id
, "F5").WithLocation(8, 16),
498
Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.
Id
, "F6").WithLocation(9, 16),
499
Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.
Id
, "F10").WithLocation(13, 15));
552
Diagnostic(LocalCouldBeConstAnalyzer.LocalCouldBeConstDescriptor.
Id
, "e").WithLocation(13, 13),
553
Diagnostic(LocalCouldBeConstAnalyzer.LocalCouldBeConstDescriptor.
Id
, "s").WithLocation(14, 16));
723
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "a").WithArguments("a", "Middle").WithLocation(6, 16),
724
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "b").WithArguments("b", "Value").WithLocation(7, 16),
725
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "c").WithArguments("c", "Base").WithLocation(8, 16),
726
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "d").WithArguments("d", "Derived").WithLocation(10, 14),
727
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "e").WithArguments("e", "Middle").WithLocation(11, 14),
728
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "g").WithArguments("g", "Base").WithLocation(15, 16),
729
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "i").WithArguments("i", "int").WithLocation(20, 16),
730
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "k").WithArguments("k", "Derived").WithLocation(24, 16),
731
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "ia").WithArguments("ia", "IMiddle").WithLocation(34, 16),
732
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "ic").WithArguments("ic", "IBase1").WithLocation(35, 16),
733
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "id").WithArguments("id", "IDerived").WithLocation(37, 16),
734
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "ie").WithArguments("ie", "IMiddle").WithLocation(38, 16),
735
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "ig").WithArguments("ig", "IBase1").WithLocation(42, 16),
736
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "ik").WithArguments("ik", "IDerived").WithLocation(47, 17),
737
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "im").WithArguments("im", "IDerived").WithLocation(51, 16),
738
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fa").WithArguments("C.fa", "Middle").WithLocation(56, 12),
739
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fb").WithArguments("C.fb", "Value").WithLocation(57, 12),
740
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fc").WithArguments("C.fc", "Base").WithLocation(58, 12),
741
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fd").WithArguments("C.fd", "Derived").WithLocation(59, 10),
742
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fe").WithArguments("C.fe", "Middle").WithLocation(60, 10),
743
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fg").WithArguments("C.fg", "Base").WithLocation(62, 12),
744
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fi").WithArguments("C.fi", "int").WithLocation(64, 12),
745
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fk").WithArguments("C.fk", "Derived").WithLocation(66, 12),
746
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fia").WithArguments("C.fia", "IMiddle").WithLocation(75, 12),
747
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fic").WithArguments("C.fic", "IBase1").WithLocation(76, 12),
748
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fid").WithArguments("C.fid", "IDerived").WithLocation(77, 12),
749
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fie").WithArguments("C.fie", "IMiddle").WithLocation(78, 12),
750
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fig").WithArguments("C.fig", "IBase1").WithLocation(80, 12),
751
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fik").WithArguments("C.fik", "IDerived").WithLocation(82, 13),
752
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fim").WithArguments("C.fim", "IDerived").WithLocation(86, 12));
788
Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.
Id
, "17").WithLocation(4, 40),
789
Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.
Id
, "17").WithLocation(9, 21),
790
Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.
Id
, "17").WithLocation(14, 16),
791
Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.
Id
, "17").WithLocation(24, 9),
792
Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.
Id
, "M0()").WithLocation(16, 9));
828
Diagnostic(NullArgumentTestAnalyzer.NullArgumentsDescriptor.
Id
, "null").WithLocation(16, 12),
829
Diagnostic(NullArgumentTestAnalyzer.NullArgumentsDescriptor.
Id
, "null").WithLocation(17, 16),
830
Diagnostic(NullArgumentTestAnalyzer.NullArgumentsDescriptor.
Id
, "null").WithLocation(18, 12),
831
Diagnostic(NullArgumentTestAnalyzer.NullArgumentsDescriptor.
Id
, "null").WithLocation(18, 18),
832
Diagnostic(NullArgumentTestAnalyzer.NullArgumentsDescriptor.
Id
, "null").WithLocation(24, 26));
881
Diagnostic(MemberInitializerTestAnalyzer.DoNotUseFieldInitializerDescriptor.
Id
, "Field").WithLocation(19, 30),
882
Diagnostic(MemberInitializerTestAnalyzer.DoNotUsePropertyInitializerDescriptor.
Id
, "Property1").WithLocation(20, 30),
883
Diagnostic(MemberInitializerTestAnalyzer.DoNotUsePropertyInitializerDescriptor.
Id
, "Property1").WithLocation(21, 30),
884
Diagnostic(MemberInitializerTestAnalyzer.DoNotUseFieldInitializerDescriptor.
Id
, "Field").WithLocation(21, 46),
885
Diagnostic(MemberInitializerTestAnalyzer.DoNotUsePropertyInitializerDescriptor.
Id
, "Property2").WithLocation(22, 30),
886
Diagnostic(MemberInitializerTestAnalyzer.DoNotUseFieldInitializerDescriptor.
Id
, "Field").WithLocation(22, 52),
887
Diagnostic(MemberInitializerTestAnalyzer.DoNotUsePropertyInitializerDescriptor.
Id
, "Property2").WithLocation(24, 30));
980
Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.
Id
, "{ 1, 2, 3, 4, 5, 6 }").WithLocation(14, 32),
981
Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.
Id
, "{ 1, 2, 3, 4, 5, 6 }").WithLocation(15, 23),
982
Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.
Id
, "{ null, null, null, null, null, null }").WithLocation(16, 28),
983
Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.
Id
, "{ 1, 2, 3, 4, 5, 6 }").WithLocation(18, 37),
984
Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.
Id
, "{ 1, 2, 3, 4, 5, 6 }").WithLocation(20, 27),
985
Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.
Id
, "{ 7, 8, 9, 10, 11, 12 }").WithLocation(21, 27),
986
Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.
Id
, "{ null, null, null, null, null, null }").WithLocation(24, 33),
987
Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.
Id
, "{ 1, 2, 3, 4, 5, 6 }").WithLocation(28, 66)
1016
Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.
Id
, "int c1, c2, c3, c4;").WithLocation(9, 9),
1017
Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.
Id
, "C[] d1, d2, d3, d4 = { null, null };").WithLocation(10, 9),
1018
Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.
Id
, "d4 = { null, null }").WithLocation(10, 25),
1019
Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.
Id
, "int e1 = 1, e2, e3, e4 = 10;").WithLocation(11, 9),
1020
Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.
Id
, "e1 = 1").WithLocation(11, 13),
1021
Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.
Id
, "e4 = 10").WithLocation(11, 29),
1022
Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.
Id
, "int f1, f2, f3, ;").WithLocation(12, 9),
1023
Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.
Id
, "int g1, g2, g3, g4 =;").WithLocation(13, 9));
1080
Diagnostic(CaseTestAnalyzer.MultipleCaseClausesDescriptor.
Id
,
1084
Diagnostic(CaseTestAnalyzer.HasDefaultCaseDescriptor.
Id
, "default:").WithLocation(10, 13),
1085
Diagnostic(CaseTestAnalyzer.MultipleCaseClausesDescriptor.
Id
,
1089
Diagnostic(CaseTestAnalyzer.HasDefaultCaseDescriptor.
Id
, "default:").WithLocation(19, 13),
1090
Diagnostic(CaseTestAnalyzer.HasDefaultCaseDescriptor.
Id
, "default:").WithLocation(33, 13));
1121
Diagnostic(ExplicitVsImplicitInstanceAnalyzer.ExplicitInstanceDescriptor.
Id
, "this").WithLocation(6, 9),
1122
Diagnostic(ExplicitVsImplicitInstanceAnalyzer.ImplicitInstanceDescriptor.
Id
, "M1").WithLocation(7, 9),
1123
Diagnostic(ExplicitVsImplicitInstanceAnalyzer.ExplicitInstanceDescriptor.
Id
, "base").WithLocation(18, 9),
1124
Diagnostic(ExplicitVsImplicitInstanceAnalyzer.ImplicitInstanceDescriptor.
Id
, "M1").WithLocation(19, 9),
1125
Diagnostic(ExplicitVsImplicitInstanceAnalyzer.ImplicitInstanceDescriptor.
Id
, "M2").WithLocation(20, 9));
1158
Diagnostic(MemberReferenceAnalyzer.HandlerAddedDescriptor.
Id
, "Mumble += new MumbleEventHandler(Mumbler)").WithLocation(10, 9),
1159
Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.
Id
, "Mumble").WithLocation(10, 9),
1160
Diagnostic(MemberReferenceAnalyzer.MethodBindingDescriptor.
Id
, "Mumbler").WithLocation(10, 42),
1161
Diagnostic(MemberReferenceAnalyzer.HandlerAddedDescriptor.
Id
, "Mumble += (s, a) => {}").WithLocation(11, 9),
1162
Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.
Id
, "Mumble").WithLocation(11, 9),
1163
Diagnostic(MemberReferenceAnalyzer.HandlerAddedDescriptor.
Id
, "Mumble += new MumbleEventHandler((s, a) => {})").WithLocation(12, 9),
1164
Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.
Id
, "Mumble").WithLocation(12, 9),
1165
Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.
Id
, "Mumble").WithLocation(13, 9),
1166
Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.
Id
, "Mumble").WithLocation(14, 20),
1167
Diagnostic(MemberReferenceAnalyzer.MethodBindingDescriptor.
Id
, "Mumbler").WithLocation(15, 32),
1168
Diagnostic(MemberReferenceAnalyzer.HandlerRemovedDescriptor.
Id
, "Mumble -= new MumbleEventHandler(Mumbler)").WithLocation(17, 9),
1169
Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.
Id
, "Mumble").WithLocation(17, 9),
1170
Diagnostic(MemberReferenceAnalyzer.MethodBindingDescriptor.
Id
, "Mumbler").WithLocation(17, 42));
1220
Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.
Id
, "M0(1, 2, 3, 4, 5)").WithLocation(13, 9),
1221
Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.
Id
, "M0(1, 2, 3, 4, 5, 6)").WithLocation(14, 9),
1222
Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.
Id
, "new int[] { 2, 3, 4, 5 }"),
1223
Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.
Id
, "new int[] { 2, 3, 4, 5, 6 }"),
1224
Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.
Id
, @"new D(""Hello"", 1, 2, 3, 4)").WithLocation(20, 13),
1225
Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.
Id
, "new int[] { 1, 2, 3, 4 }"));
1245
Diagnostic(EqualsValueTestAnalyzer.EqualsValueDescriptor.
Id
, "= 44").WithLocation(4, 19),
1246
Diagnostic(EqualsValueTestAnalyzer.EqualsValueDescriptor.
Id
, "= \"Hello\"").WithLocation(5, 22),
1247
Diagnostic(EqualsValueTestAnalyzer.EqualsValueDescriptor.
Id
, "= Goo()").WithLocation(6, 19),
1248
Diagnostic(EqualsValueTestAnalyzer.EqualsValueDescriptor.
Id
, "= 33").WithLocation(9, 40));
1276
Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.
Id
, "0").WithLocation(12, 17),
1277
Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.
Id
, "x").WithLocation(13, 17),
1278
Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.
Id
, "12").WithLocation(16, 29)
1340
Diagnostic(AssignmentOperationSyntaxTestAnalyzer.AssignmentOperationDescriptor.
Id
, $"x = {expr}").WithLocation(7, 9),
1341
Diagnostic(AssignmentOperationSyntaxTestAnalyzer.AssignmentSyntaxDescriptor.
Id
, $"x = {expr}").WithLocation(7, 9));
1433
Diagnostic(LambdaTestAnalyzer.LambdaExpressionDescriptor.
Id
, "input => { }").WithLocation(8, 31),
1434
Diagnostic(LambdaTestAnalyzer.LambdaExpressionDescriptor.
Id
, "input => input++").WithLocation(9, 31),
1435
Diagnostic(LambdaTestAnalyzer.LambdaExpressionDescriptor.
Id
, "input => { input++; input++; if (input > 0) return true; return false; }").WithLocation(10, 32),
1436
Diagnostic(LambdaTestAnalyzer.TooManyStatementsInLambdaExpressionDescriptor.
Id
, "input => { input++; input++; if (input > 0) return true; return false; }").WithLocation(10, 32),
1437
Diagnostic(LambdaTestAnalyzer.LambdaExpressionDescriptor.
Id
, "(s, e) => { }").WithLocation(22, 42),
1438
Diagnostic(LambdaTestAnalyzer.LambdaExpressionDescriptor.
Id
, "(s, e) => { int i = 0; i++; i++; i++; }").WithLocation(23, 19),
1439
Diagnostic(LambdaTestAnalyzer.TooManyStatementsInLambdaExpressionDescriptor.
Id
, "(s, e) => { int i = 0; i++; i++; i++; }").WithLocation(23, 19));
1482
Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.
Id
, "C.E").WithLocation(23, 9),
1483
Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.
Id
, "D.Method").WithLocation(23, 16),
1484
Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.
Id
, "C.E").WithLocation(24, 9),
1485
Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.
Id
, "C.Bar()").WithLocation(25, 9),
1486
Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.
Id
, "D.E").WithLocation(27, 9),
1487
Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.
Id
, "D.Field").WithLocation(28, 9),
1488
Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.
Id
, "D.Property").WithLocation(29, 17),
1489
Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.
Id
, "D.Method()").WithLocation(30, 9));
1508
Diagnostic(LabelOperationsTestAnalyzer.LabelDescriptor.
Id
, "Wilma: goto Betty;").WithLocation(6, 9),
1509
Diagnostic(LabelOperationsTestAnalyzer.GotoDescriptor.
Id
, "goto Betty;").WithLocation(6, 16),
1510
Diagnostic(LabelOperationsTestAnalyzer.LabelDescriptor.
Id
, "Betty: goto Wilma;").WithLocation(7, 9),
1511
Diagnostic(LabelOperationsTestAnalyzer.GotoDescriptor.
Id
, "goto Wilma;").WithLocation(7, 16));
1567
Diagnostic(UnaryAndBinaryOperationsTestAnalyzer.BooleanNotDescriptor.
Id
, "!b").WithLocation(41, 13),
1568
Diagnostic(UnaryAndBinaryOperationsTestAnalyzer.DoubleMultiplyDescriptor.
Id
, "d * 100").WithLocation(42, 13),
1569
Diagnostic(UnaryAndBinaryOperationsTestAnalyzer.OperatorAddMethodDescriptor.
Id
, "a1 + a2").WithLocation(43, 14),
1570
Diagnostic(UnaryAndBinaryOperationsTestAnalyzer.OperatorMinusMethodDescriptor.
Id
, "-a2").WithLocation(44, 14));
1641
Diagnostic(NullOperationSyntaxTestAnalyzer.ParamsArrayOperationDescriptor.
Id
, "M0()"),
1642
Diagnostic(NullOperationSyntaxTestAnalyzer.ParamsArrayOperationDescriptor.
Id
, "M0(1)").WithLocation(11, 9),
1643
Diagnostic(NullOperationSyntaxTestAnalyzer.ParamsArrayOperationDescriptor.
Id
, "M0(1, 2)").WithLocation(12, 9));
1676
Diagnostic(ConversionExpressionCSharpTestAnalyzer.InvalidConversionExpressionDescriptor.
Id
, "null.Length").WithLocation(8, 17),
1677
Diagnostic(ConversionExpressionCSharpTestAnalyzer.InvalidConversionExpressionDescriptor.
Id
, "string.Empty").WithLocation(10, 17),
1678
Diagnostic(ConversionExpressionCSharpTestAnalyzer.InvalidConversionExpressionDescriptor.
Id
, "global::MyType()").WithLocation(12, 17));
1710
Diagnostic(InvalidOperatorExpressionTestAnalyzer.InvalidBinaryDescriptor.
Id
, "f == float.Nan").WithLocation(6, 16),
1711
Diagnostic(InvalidOperatorExpressionTestAnalyzer.InvalidUnaryDescriptor.
Id
, "-f").WithLocation(11, 16),
1712
Diagnostic(InvalidOperatorExpressionTestAnalyzer.InvalidIncrementDescriptor.
Id
, "f++").WithLocation(16, 9));
1783
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.
Id
, "p?.Prop").WithLocation(24, 17),
1784
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.
Id
, "p").WithLocation(24, 17),
1785
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.
Id
, "p?.Field").WithLocation(25, 13),
1786
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.
Id
, "p").WithLocation(25, 13),
1787
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.
Id
, "p?[0]").WithLocation(26, 13),
1788
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.
Id
, "p").WithLocation(26, 13),
1789
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.
Id
, "p?.M0(null)").WithLocation(27, 9),
1790
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.
Id
, "p").WithLocation(27, 9),
1791
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.
Id
, "Field1?.Prop").WithLocation(29, 13),
1792
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.
Id
, "Field1").WithLocation(29, 13),
1793
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.
Id
, "Field1?.Field").WithLocation(30, 13),
1794
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.
Id
, "Field1").WithLocation(30, 13),
1795
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.
Id
, "Field1?[0]").WithLocation(31, 13),
1796
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.
Id
, "Field1").WithLocation(31, 13),
1797
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.
Id
, "Field1?.M0(null)").WithLocation(32, 9),
1798
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.
Id
, "Field1").WithLocation(32, 9));
1874
Diagnostic(TrueFalseUnaryOperationTestAnalyzer.UnaryTrueDescriptor.
Id
, "x && y").WithLocation(29, 13),
1875
Diagnostic(TrueFalseUnaryOperationTestAnalyzer.UnaryTrueDescriptor.
Id
, "x").WithLocation(30, 18));
Microsoft.CodeAnalysis.CSharp.Features (4)
QuickInfo\CSharpDiagnosticAnalyzerQuickInfoProvider.cs (4)
144
var diagnosticDescriptor = supportedDiagnostics.FirstOrDefault(d => d.
Id
== errorCode);
160
descriptor.
Id
;
162
? new TaggedText(TextTags.Text, descriptor.
Id
, TaggedTextStyle.None, descriptor.HelpLinkUri, descriptor.HelpLinkUri)
163
: new TaggedText(TextTags.Text, descriptor.
Id
);
Microsoft.CodeAnalysis.EditorFeatures (2)
EditorConfigSettings\Data\AnalyzerSetting.cs (1)
45
public string Id => _descriptor.
Id
;
EditorConfigSettings\DataProvider\Analyzer\AnalyzerSettingsProvider.cs (1)
57
.GroupBy(d => d.
Id
)
Microsoft.CodeAnalysis.EditorFeatures.DiagnosticsTests.Utilities (3)
Diagnostics\AbstractDiagnosticProviderBasedUserDiagnosticTest.cs (3)
129
if (descriptor.
Id
is "RE0001" or "JSON001" or "JSON002") // Currently not documented. https://github.com/dotnet/roslyn/issues/48530
132
if (descriptor.
Id
== "IDE0043") // Intentionally undocumented. It will be removed in favor of CA2241
135
if (descriptor.
Id
== "IDE1007")
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (18)
CodeFixes\CodeFixServiceTests.cs (1)
135
Assert.Equal(codeFix.FixableDiagnosticIds.Single(), analyzerWithFix.SupportedDiagnostics.Single().
Id
);
Diagnostics\DiagnosticAnalyzerServiceTests.cs (12)
190
dotnet_diagnostic.{DisabledByDefaultAnalyzer.s_syntaxRule.
Id
}.severity = warning
191
dotnet_diagnostic.{DisabledByDefaultAnalyzer.s_semanticRule.
Id
}.severity = warning
192
dotnet_diagnostic.{DisabledByDefaultAnalyzer.s_compilationRule.
Id
}.severity = warning";
216
if (diagnostic.Id == DisabledByDefaultAnalyzer.s_syntaxRule.
Id
)
220
else if (diagnostic.Id == DisabledByDefaultAnalyzer.s_semanticRule.
Id
)
224
else if (diagnostic.Id == DisabledByDefaultAnalyzer.s_compilationRule.
Id
)
314
Assert.Equal(OpenFileOnlyAnalyzer.s_syntaxRule.
Id
, diagnostics[0].Id);
385
syntax |= diagnostics[0].Id == NoNameAnalyzer.s_syntaxRule.
Id
;
704
d => d.Id == analyzer.Descriptor.
Id
&& d.DataLocation.UnmappedFileSpan.Path == additionalDoc.FilePath);
1080
Assert.Equal(analyzer1.Descriptor.
Id
, diagnostic.Id);
1209
syntax |= diagnostics[0].Id == Analyzer.s_syntaxRule.
Id
;
1210
semantic |= diagnostics[0].Id == Analyzer.s_semanticRule.
Id
;
Diagnostics\IDEDiagnosticIDConfigurationTests.cs (1)
40
var diagnosticId = descriptor.
Id
;
EditAndContinue\EditAndContinueDiagnosticDescriptorsTests.cs (4)
21
Assert.Equal("ENC0001", d.
Id
);
30
Assert.Equal("ENC0087", EditAndContinueDiagnosticDescriptors.GetDescriptor(RudeEditKind.ComplexQueryExpression).
Id
);
33
Assert.Equal("ENC1001", d.
Id
);
43
Assert.Equal("ENC2012", d.
Id
);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (66)
Diagnostics\AdditionalFileDiagnosticsTests.vb (1)
110
Return ImmutableArray.Create(AdditionalFileAnalyzer.Rule.
Id
)
Diagnostics\DiagnosticProviderTests.vb (1)
250
<Error Id=<%= NoCompilationDocumentDiagnosticAnalyzer.Descriptor.
Id
%>
Diagnostics\DiagnosticServiceTests.vb (64)
90
Assert.Equal(workspaceDiagnosticAnalyzer.DiagDescriptor.
Id
, descriptors(0).
Id
)
107
descriptors = descriptorsMap.Values.SelectMany(Function(d) d).OrderBy(Function(d) d.
Id
).ToImmutableArray()
108
Assert.Equal(workspaceDiagnosticAnalyzer.DiagDescriptor.
Id
, descriptors(0).
Id
)
109
Assert.Equal(projectDiagnosticAnalyzer1.DiagDescriptor.
Id
, descriptors(1).
Id
)
122
descriptors = descriptorsMap.Values.SelectMany(Function(d) d).OrderBy(Function(d) d.
Id
).ToImmutableArray()
123
Assert.Equal(workspaceDiagnosticAnalyzer.DiagDescriptor.
Id
, descriptors(0).
Id
)
124
Assert.Equal(projectDiagnosticAnalyzer1.DiagDescriptor.
Id
, descriptors(1).
Id
)
125
Assert.Equal(projectDiagnosticAnalyzer2.DiagDescriptor.
Id
, descriptors(2).
Id
)
137
descriptors = descriptorsMap.Values.SelectMany(Function(d) d).OrderBy(Function(d) d.
Id
).ToImmutableArray()
138
Assert.Equal(workspaceDiagnosticAnalyzer.DiagDescriptor.
Id
, descriptors(0).
Id
)
139
Assert.Equal(projectDiagnosticAnalyzer2.DiagDescriptor.
Id
, descriptors(1).
Id
)
151
Assert.Equal(workspaceDiagnosticAnalyzer.DiagDescriptor.
Id
, descriptors(0).
Id
)
159
descriptors = descriptorsMap.Values.SelectMany(Function(d) d).OrderBy(Function(d) d.
Id
).ToImmutableArray()
160
Assert.Equal(workspaceDiagnosticAnalyzer.DiagDescriptor.
Id
, descriptors(0).
Id
)
204
Assert.Equal(workspaceDiagnosticAnalyzer.DiagDescriptor.
Id
, descriptors(0).
Id
)
278
Assert.Equal(workspaceDiagnosticAnalyzer.DiagDescriptor.
Id
, descriptors(0).
Id
)
286
Assert.Equal(workspaceDiagnosticAnalyzer.DiagDescriptor.
Id
, diagnostics(0).Id)
291
suppressDiagOptions.Add(workspaceDiagnosticAnalyzer.DiagDescriptor.
Id
, ReportDiagnostic.Suppress)
299
changeSeverityDiagOptions.Add(workspaceDiagnosticAnalyzer.DiagDescriptor.
Id
, ReportDiagnostic.Error)
305
Assert.Equal(workspaceDiagnosticAnalyzer.DiagDescriptor.
Id
, diagnostics(0).Id)
350
Assert.Equal("XX0001", descriptors1.Single().Value.Single().
Id
)
355
Assert.Equal("XX0002", descriptors2.Single().Value.Single().
Id
)
441
Select(Function(d) d.Id = WorkspaceDiagnosticAnalyzer.Descriptor.
Id
)
640
Assert.Equal(OperationAnalyzer.Descriptor.
Id
, diagnostic.Id)
678
Assert.Equal(CodeBlockEndedAnalyzer.Descriptor.
Id
, diagnostic.Id)
713
Assert.Equal(CodeBlockEndedAnalyzer.Descriptor.
Id
, diagnostic.Id)
791
Assert.Equal(CodeBlockEndedAnalyzer.Descriptor.
Id
, diagnostic.Id)
841
Assert.Equal(CompilationEndedAnalyzer.Descriptor.
Id
, noLocationDiagnostic.Id)
845
Assert.Equal(CompilationEndedAnalyzer.Descriptor.
Id
, withDocumentLocationDiagnostic.Id)
875
Assert.Equal(StatefulCompilationAnalyzer.Descriptor.
Id
, diagnostic.Id)
907
Assert.Equal(StatefulCompilationAnalyzer.Descriptor.
Id
, diagnostic.Id)
981
Select(Function(d) d.Id = NamedTypeAnalyzer.DiagDescriptor.
Id
)
1022
Assert.Equal(PartialTypeDiagnosticAnalyzer.DiagDescriptor.
Id
, diagnostics.Single().Id)
1079
Assert.Equal(PartialTypeDiagnosticAnalyzer.DiagDescriptor.
Id
, diagnostic.Id)
1130
Assert.Equal(3, diagnostics.Where(Function(d) d.Id = CodeBlockOrSyntaxNodeAnalyzer.Descriptor1.
Id
).Count)
1131
Assert.Equal(1, diagnostics.Where(Function(d) d.Id = CodeBlockOrSyntaxNodeAnalyzer.Descriptor4.
Id
).Count)
1132
Assert.Equal(1, diagnostics.Where(Function(d) d.Id = CodeBlockOrSyntaxNodeAnalyzer.Descriptor5.
Id
).Count)
1133
Assert.Equal(1, diagnostics.Where(Function(d) d.Id = CodeBlockOrSyntaxNodeAnalyzer.Descriptor6.
Id
).Count)
1175
Assert.Equal(1, diagnostics.Where(Function(d) d.Id = CodeBlockOrSyntaxNodeAnalyzer.Descriptor4.
Id
).Count)
1176
Assert.Equal(1, diagnostics.Where(Function(d) d.Id = CodeBlockOrSyntaxNodeAnalyzer.Descriptor5.
Id
).Count)
1177
Assert.Equal(1, diagnostics.Where(Function(d) d.Id = CodeBlockOrSyntaxNodeAnalyzer.Descriptor6.
Id
).Count)
1222
Assert.True(diagnostics.All(Function(d) d.Id = MethodSymbolAnalyzer.Descriptor.
Id
))
1271
Assert.Equal(1, diagnostics.Where(Function(d) d.Id = MustOverrideMethodAnalyzer.Descriptor1.
Id
).Count)
1338
Assert.Equal(4, diagnostics.Where(Function(d) d.Id = FieldDeclarationAnalyzer.Descriptor1.
Id
).Count)
1468
Assert.Equal(CompilationAnalyzerWithAnalyzerOptions.Descriptor.
Id
, diagnostics(0).Id)
2008
Dim diagnostic = diagnostics.Single(Function(d) d.Id = CodeBlockActionAnalyzer.CodeBlockTopLevelRule.
Id
)
2011
Dim stateFullDiagnostics = diagnostics.Where(Function(d) d.Id = CodeBlockActionAnalyzer.CodeBlockPerCompilationRule.
Id
)
2172
Assert.Equal(analyzer.Descriptor.
Id
, descriptors.Single().
Id
)
2188
Assert.Equal(analyzer.Descriptor.
Id
, hiddenDiagnostics.Single().Id)
2323
Assert.Equal(analyzer.Descriptor.
Id
, descriptors.Single().
Id
)
Microsoft.CodeAnalysis.Features (10)
AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs (2)
86
AddDiagnosticIdToOptionMapping(descriptor.
Id
, option);
99
AddDiagnosticIdToOptionMapping(descriptor.
Id
, options);
AbstractBuiltInUnnecessaryCodeStyleDiagnosticAnalyzer.cs (2)
95
AddDiagnosticIdToFadingOptionMapping(descriptor.
Id
, fadingOption);
134
IDEDiagnosticIdToOptionMappingHelper.AddFadingOptionMapping(descriptor.
Id
, fadingOption);
AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
425
if (!idsToAnalyze.Contains(descriptor.
Id
))
433
unhandledIds.Add(descriptor.
Id
);
DiagnosticHelper.cs (1)
241
descriptor.
Id
,
EditAndContinue\EditSession.cs (2)
852
Telemetry.LogProjectAnalysisSummary(ProjectAnalysisSummary.ValidChanges, newProject.State.ProjectInfo.Attributes.TelemetryId, ImmutableArray.Create(mvidReadError.Descriptor.
Id
));
937
Telemetry.LogProjectAnalysisSummary(projectSummary, newProject.State.ProjectInfo.Attributes.TelemetryId, moduleDiagnostics.NullToEmpty().SelectAsArray(d => d.Descriptor.
Id
));
EditAndContinue\EmitSolutionUpdateResults.cs (1)
203
descriptor.
Id
,
Microsoft.CodeAnalysis.LanguageServer.Protocol (5)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_BuildSynchronization.cs (3)
149
if (!seen.Add(descriptor.
Id
))
155
var items = lookup[descriptor.
Id
];
171
descriptor.
Id
,
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnostics.cs (1)
296
if (_diagnosticIds != null && Owner.DiagnosticAnalyzerInfoCache.GetDiagnosticDescriptors(stateSet.Analyzer).All(d => !_diagnosticIds.Contains(d.
Id
)))
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs (1)
261
!owner.DiagnosticAnalyzerInfoCache.GetDiagnosticDescriptors(analyzer).Any(static (a, shouldIncludeDiagnostic) => shouldIncludeDiagnostic(a.
Id
), shouldIncludeDiagnostic))
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (2)
Diagnostics\PullDiagnosticTests.cs (2)
688
Assert.Equal(DiagnosticProducingGenerator.Descriptor.
Id
, diagnostic.Code);
1011
Assert.Equal(DiagnosticProducingGenerator.Descriptor.
Id
, results[0].Diagnostics.Single().Code);
Microsoft.CodeAnalysis.Test.Utilities (23)
Diagnostics\CommonDiagnosticAnalyzers.cs (20)
112
""ruleId"": """ + Descriptor1.
Id
+ @""",
133
""ruleId"": """ + Descriptor2.
Id
+ @""",
142
""" + Descriptor1.
Id
+ @""": {
143
""id"": """ + Descriptor1.
Id
+ @""",
156
""" + Descriptor2.
Id
+ @""": {
157
""id"": """ + Descriptor2.
Id
+ @""",
186
""ruleId"": """ + Descriptor1.
Id
+ @""",
210
""ruleId"": """ + Descriptor2.
Id
+ @""",
219
""" + Descriptor1.
Id
+ @""": {
220
""id"": """ + Descriptor1.
Id
+ @""",
233
""" + Descriptor2.
Id
+ @""": {
234
""id"": """ + Descriptor2.
Id
+ @""",
263
""ruleId"": """ + Descriptor1.
Id
+ @""",
289
""ruleId"": """ + Descriptor2.
Id
+ @""",
315
""ruleId"": """ + Descriptor1.
Id
+ @""",
347
""ruleId"": """ + Descriptor2.
Id
+ @""",
379
""id"": """ + Descriptor1.
Id
+ @""",
395
""id"": """ + Descriptor2.
Id
+ @""",
428
public static readonly SuppressionDescriptor Descriptor1 = new("SPR0001", AnalyzerForErrorLogTest.Descriptor1.
Id
, "SuppressorJustification1");
429
public 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)
310
Assert.Equal(descriptor.
Id
, descriptors[0].
Id
);
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.UnitTests (1)
SimplifyInterpolationTests.vb (1)
37
diagnostics.Select(Function(d) (d.Descriptor.
Id
, d.Severity)))
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (18)
CommandLineTests.vb (16)
8925
Assert.Contains(AnalyzerThatThrowsInGetMessage.Rule.
Id
, output, StringComparison.Ordinal)
8970
Assert.Contains(AnalyzerThatThrowsInGetMessage.Rule.
Id
, output, StringComparison.Ordinal)
9783
Assert.Contains($"warning {analyzer.Descriptor.
Id
}", output, StringComparison.Ordinal)
9787
Dim suppressor = New DiagnosticSuppressorForId(analyzer.Descriptor.
Id
)
9800
Assert.DoesNotContain($"warning {analyzer.Descriptor.
Id
}", output, StringComparison.Ordinal)
9809
Assert.Contains($"error {analyzer.Descriptor.
Id
}", output, StringComparison.Ordinal)
9817
Assert.DoesNotContain($"warning {analyzer.Descriptor.
Id
}", output, StringComparison.Ordinal)
9823
suppressor = New DiagnosticSuppressorForId(analyzer.Descriptor.
Id
)
9828
Assert.Contains($"warning {analyzer.Descriptor.
Id
}", output, StringComparison.Ordinal)
9848
Assert.Contains($"error {analyzer.Descriptor.
Id
}", output, StringComparison.Ordinal)
9851
Dim suppressor = New DiagnosticSuppressorForId(analyzer.Descriptor.
Id
)
9856
Assert.Contains($"error {analyzer.Descriptor.
Id
}", output, StringComparison.Ordinal)
10041
Assert.Contains($"{expectedODiagnosticSeverity} {WarningDiagnosticAnalyzer.Warning01.
Id
}", output)
10042
Assert.Contains($"{expectedODiagnosticSeverity} {WarningDiagnosticAnalyzer.Warning03.
Id
}", output)
10095
Dim diagnosticId = analyzer.Descriptor.
Id
10135
Dim diagnosticId = analyzer.Descriptor.
Id
SarifErrorLoggerTests.vb (2)
183
Assert.Contains(AnalyzerForErrorLogTest.Descriptor1.
Id
, actualConsoleOutput)
184
Assert.Contains(AnalyzerForErrorLogTest.Descriptor2.
Id
, actualConsoleOutput)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (1)
LineCommit\CommitFormatter.vb (1)
136
Function(d) d.Descriptor.
Id
= UnterminatedStringId)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests (2)
Formatting\CodeCleanUpTests.vb (1)
519
Dim diagnosticIds = analyzer.SupportedDiagnostics.SelectAsArray(Function(d) d.
Id
)
SimplifyInterpolationTests.vb (1)
37
diagnostics.Select(Function(d) (d.Descriptor.
Id
, d.Severity)))
Microsoft.CodeAnalysis.VisualBasic.Features (2)
CodeFixes\OverloadBase\OverloadBaseCodeFixProvider.vb (2)
48
If diagnostic.Descriptor.
Id
= BC40003 Then
50
ElseIf diagnostic.Descriptor.
Id
= BC40004 Then
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (273)
Diagnostics\DiagnosticAnalyzerTests.vb (41)
63
specificDiagOptions.Add(noneDiagDescriptor.
Id
, ReportDiagnostic.[Error])
64
specificDiagOptions.Add(infoDiagDescriptor.
Id
, ReportDiagnostic.[Error])
65
specificDiagOptions.Add(warningDiagDescriptor.
Id
, ReportDiagnostic.[Error])
78
specificDiagOptions.Add(noneDiagDescriptor.
Id
, ReportDiagnostic.Suppress)
79
specificDiagOptions.Add(infoDiagDescriptor.
Id
, ReportDiagnostic.Suppress)
80
specificDiagOptions.Add(warningDiagDescriptor.
Id
, ReportDiagnostic.Suppress)
81
specificDiagOptions.Add(errorDiagDescriptor.
Id
, ReportDiagnostic.Suppress)
90
specificDiagOptions.Add(noneDiagDescriptor.
Id
, ReportDiagnostic.Info)
91
specificDiagOptions.Add(infoDiagDescriptor.
Id
, ReportDiagnostic.Hidden)
92
specificDiagOptions.Add(warningDiagDescriptor.
Id
, ReportDiagnostic.[Error])
93
specificDiagOptions.Add(errorDiagDescriptor.
Id
, ReportDiagnostic.Warn)
105
Assert.Equal(infoDiagDescriptor.
Id
, effectiveDiag.Id)
108
Assert.Equal(noneDiagDescriptor.
Id
, effectiveDiag.Id)
112
Assert.Equal(errorDiagDescriptor.
Id
, effectiveDiag.Id)
116
Assert.Equal(warningDiagDescriptor.
Id
, effectiveDiag.Id)
202
specificDiagOptions.Add(disabledDiagDescriptor.
Id
, ReportDiagnostic.Warn)
203
specificDiagOptions.Add(enabledDiagDescriptor.
Id
, ReportDiagnostic.Suppress)
254
specificDiagOptions.Add(FullyDisabledAnalyzer.desc1.
Id
, ReportDiagnostic.Warn)
255
specificDiagOptions.Add(PartiallyDisabledAnalyzer.desc2.
Id
, ReportDiagnostic.Suppress)
477
Dim id = Integer.Parse(descriptor.
Id
.Substring(2))
479
Dim message = String.Format("Add resource string named '{0}' for Title of '{1}' to '{2}'", missingResource, descriptor.
Id
, NameOf(VBResources))
488
Dim message = String.Format("'{0}' must have a non-null non-empty 'Category'", descriptor.
Id
)
659
Diagnostic(VisualBasicCodeBlockObjectCreationAnalyzer.DiagnosticDescriptor.
Id
, <![CDATA[New C1()]]>),
660
Diagnostic(VisualBasicCodeBlockObjectCreationAnalyzer.DiagnosticDescriptor.
Id
, <![CDATA[New C2()]]>),
661
Diagnostic(VisualBasicCodeBlockObjectCreationAnalyzer.DiagnosticDescriptor.
Id
, <![CDATA[New C3()]]>))
681
Diagnostic(NotConfigurableDiagnosticAnalyzer.EnabledRule.
Id
))
685
specificDiagOptions.Add(NotConfigurableDiagnosticAnalyzer.EnabledRule.
Id
, ReportDiagnostic.Suppress)
694
Diagnostic(NotConfigurableDiagnosticAnalyzer.EnabledRule.
Id
))
698
specificDiagOptions.Add(NotConfigurableDiagnosticAnalyzer.DisabledRule.
Id
, ReportDiagnostic.Warn)
706
compilation.VerifyAnalyzerDiagnostics({analyzer}, Nothing, Nothing, Diagnostic(NotConfigurableDiagnosticAnalyzer.EnabledRule.
Id
))
727
Diagnostic(CodeBlockActionAnalyzer.CodeBlockTopLevelRule.
Id
, <![CDATA[M]]>).WithArguments("M"),
728
Diagnostic(CodeBlockActionAnalyzer.CodeBlockPerCompilationRule.
Id
, <![CDATA[M]]>).WithArguments("M"))
749
Diagnostic(CodeBlockActionAnalyzer.CodeBlockTopLevelRule.
Id
, <![CDATA[M]]>).WithArguments("M"))
996
Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.
Id
, "0").WithLocation(8, 28),
997
Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.
Id
, "x").WithLocation(9, 28),
998
Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.
Id
, "12").WithLocation(12, 36))
1293
If DirectCast(builder(i).Code, String) <> GeneratedCodeAnalyzer.Error.
Id
Then
1317
Dim diag = Diagnostic(GeneratedCodeAnalyzer.Warning.
Id
, squiggledText).WithArguments(arguments).WithLocation(line, column)
1320
diag = Diagnostic(GeneratedCodeAnalyzer.Error.
Id
, squiggledText).WithArguments(arguments).WithLocation(line, column)
1326
AddExpectedDiagnostic(builder, descriptor.
Id
, Nothing, 1, 1, arguments)
1678
Assert.Equal(Analyzer.Descriptor.
Id
, diagnostic.Id)
Diagnostics\OperationAnalyzerTests.vb (232)
49
Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.
Id
, "New Integer(-1) { }").WithLocation(3, 33),
50
Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.
Id
, "{ }").WithLocation(4, 30),
51
Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.
Id
, "New C(-1) { }").WithLocation(5, 27),
52
Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.
Id
, "New Integer(-1)() { }").WithLocation(9, 35),
53
Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.
Id
, "New Integer( -1)()()() { }").WithLocation(10, 39),
54
Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.
Id
, "New Integer(-1)(,) { }").WithLocation(12, 37))
100
Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.
Id
, "3").WithLocation(6, 32),
101
Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.
Id
, "v1").WithLocation(6, 39),
102
Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.
Id
, "v3").WithLocation(7, 29),
103
Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.
Id
, "3").WithLocation(9, 21),
104
Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.
Id
, "v3").WithLocation(12, 21),
105
Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.
Id
, "p1").WithLocation(27, 9),
106
Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.
Id
, "Me").WithLocation(28, 13))
130
Diagnostic(BadStuffTestAnalyzer.InvalidExpressionDescriptor.
Id
, "Framitz()").WithLocation(3, 9),
131
Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.
Id
, "Framitz()").WithLocation(3, 9),
132
Diagnostic(BadStuffTestAnalyzer.InvalidExpressionDescriptor.
Id
, "Framitz").WithLocation(3, 9),
133
Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.
Id
, "Framitz").WithLocation(3, 9),
134
Diagnostic(BadStuffTestAnalyzer.InvalidExpressionDescriptor.
Id
, "Bexley()").WithLocation(4, 28),
135
Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.
Id
, "Bexley()").WithLocation(4, 28),
136
Diagnostic(BadStuffTestAnalyzer.InvalidExpressionDescriptor.
Id
, "Bexley").WithLocation(4, 28),
137
Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.
Id
, "Bexley").WithLocation(4, 28),
138
Diagnostic(BadStuffTestAnalyzer.InvalidExpressionDescriptor.
Id
, "M1(d)").WithLocation(7, 9),
139
Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.
Id
, "M1(d)").WithLocation(7, 9),
140
Diagnostic(BadStuffTestAnalyzer.InvalidStatementDescriptor.
Id
, "Goto").WithLocation(8, 9),
141
Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.
Id
, "Goto").WithLocation(8, 9),
142
Diagnostic(BadStuffTestAnalyzer.InvalidStatementDescriptor.
Id
, "").WithLocation(8, 13),
143
Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.
Id
, "").WithLocation(8, 13))
238
Diagnostic(SwitchTestAnalyzer.SparseSwitchDescriptor.
Id
, "x").WithLocation(12, 21),
239
Diagnostic(SwitchTestAnalyzer.SparseSwitchDescriptor.
Id
, "x").WithLocation(30, 21),
240
Diagnostic(SwitchTestAnalyzer.SparseSwitchDescriptor.
Id
, "x").WithLocation(37, 21),
241
Diagnostic(SwitchTestAnalyzer.NoDefaultSwitchDescriptor.
Id
, "x").WithLocation(37, 21),
242
Diagnostic(SwitchTestAnalyzer.NoDefaultSwitchDescriptor.
Id
, "x").WithLocation(42, 21),
243
Diagnostic(SwitchTestAnalyzer.OnlyDefaultSwitchDescriptor.
Id
, "x").WithLocation(49, 21),
244
Diagnostic(SwitchTestAnalyzer.SparseSwitchDescriptor.
Id
, "x").WithLocation(54, 21),
245
Diagnostic(SwitchTestAnalyzer.NoDefaultSwitchDescriptor.
Id
, "x").WithLocation(54, 21))
289
Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.
Id
, "M3(Nothing,)").WithArguments("b").WithLocation(25, 9),
290
Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.
Id
, "M3(,0)").WithArguments("a").WithLocation(26, 9),
291
Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.
Id
, "M3(,)").WithArguments("a").WithLocation(27, 9),
292
Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.
Id
, "M3(,)").WithArguments("b").WithLocation(27, 9),
293
Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.
Id
, "2").WithLocation(11, 21),
294
Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.
Id
, "4").WithLocation(12, 33),
295
Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.
Id
, "2").WithLocation(12, 21),
296
Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.
Id
, "1").WithLocation(12, 15),
297
Diagnostic(InvocationTestAnalyzer.BigParamArrayArgumentsDescriptor.
Id
, "M0(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)").WithLocation(14, 9),
298
Diagnostic(InvocationTestAnalyzer.BigParamArrayArgumentsDescriptor.
Id
, "M0(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)").WithLocation(15, 9),
299
Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.
Id
, "3").WithLocation(17, 21))
363
Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.
Id
, "F5").WithLocation(6, 12),
364
Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.
Id
, "F6").WithLocation(7, 12),
365
Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.
Id
, "F10").WithLocation(10, 12))
429
Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.
Id
, "F5").WithLocation(6, 19),
430
Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.
Id
, "F6").WithLocation(7, 19),
431
Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.
Id
, "F10").WithLocation(10, 19))
483
Diagnostic(LocalCouldBeConstAnalyzer.LocalCouldBeConstDescriptor.
Id
, "e").WithLocation(10, 13),
484
Diagnostic(LocalCouldBeConstAnalyzer.LocalCouldBeConstDescriptor.
Id
, "s").WithLocation(11, 13))
648
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "a").WithArguments("a", "Middle").WithLocation(3, 13),
649
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "b").WithArguments("b", "Value").WithLocation(4, 13),
650
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "c").WithArguments("c", "Base").WithLocation(5, 13),
651
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "d").WithArguments("d", "Derived").WithLocation(7, 13),
652
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "e").WithArguments("e", "Middle").WithLocation(8, 13),
653
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "g").WithArguments("g", "Base").WithLocation(12, 13),
654
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "i").WithArguments("i", "Integer").WithLocation(17, 13),
655
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "k").WithArguments("k", "Derived").WithLocation(21, 13),
656
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "ia").WithArguments("ia", "IMiddle").WithLocation(31, 13),
657
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "ic").WithArguments("ic", "IBase1").WithLocation(32, 13),
658
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "id").WithArguments("id", "IDerived").WithLocation(34, 13),
659
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "ie").WithArguments("ie", "IMiddle").WithLocation(35, 13),
660
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "ig").WithArguments("ig", "IBase1").WithLocation(39, 13),
661
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "ik").WithArguments("ik", "IDerived").WithLocation(44, 13),
662
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.
Id
, "im").WithArguments("im", "IDerived").WithLocation(48, 13),
663
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fa").WithArguments("Private fa As Object", "Middle").WithLocation(53, 13),
664
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fb").WithArguments("Private fb As Object", "Value").WithLocation(54, 13),
665
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fc").WithArguments("Private fc As Object", "Base").WithLocation(55, 13),
666
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fd").WithArguments("Private fd As Base", "Derived").WithLocation(56, 13),
667
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fe").WithArguments("Private fe As Base", "Middle").WithLocation(57, 13),
668
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fg").WithArguments("Private fg As Object", "Base").WithLocation(59, 13),
669
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fi").WithArguments("Private fi As Object", "Integer").WithLocation(61, 13),
670
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fk").WithArguments("Private fk As Middle", "Derived").WithLocation(63, 13),
671
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fia").WithArguments("Private fia As Object", "IMiddle").WithLocation(72, 13),
672
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fic").WithArguments("Private fic As Object", "IBase1").WithLocation(73, 13),
673
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fid").WithArguments("Private fid As IBase1", "IDerived").WithLocation(74, 13),
674
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fie").WithArguments("Private fie As IBase1", "IMiddle").WithLocation(75, 13),
675
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fig").WithArguments("Private fig As Object", "IBase1").WithLocation(77, 13),
676
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fik").WithArguments("Private fik As IMiddle", "IDerived").WithLocation(79, 13),
677
Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.
Id
, "fim").WithArguments("Private fim As IBase2", "IDerived").WithLocation(83, 13))
726
Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.
Id
, "17").WithLocation(2, 71),
727
Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.
Id
, "17").WithLocation(6, 28),
728
Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.
Id
, "17").WithLocation(10, 16),
729
Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.
Id
, "17").WithLocation(19, 9),
730
Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.
Id
, "17").WithLocation(27, 40),
731
Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.
Id
, "17").WithLocation(28, 29),
732
Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.
Id
, "17").WithLocation(33, 42),
733
Diagnostic(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.
770
Diagnostic(NullArgumentTestAnalyzer.NullArgumentsDescriptor.
Id
, "Nothing").WithLocation(13, 12),
771
Diagnostic(NullArgumentTestAnalyzer.NullArgumentsDescriptor.
Id
, "Nothing").WithLocation(14, 18),
772
Diagnostic(NullArgumentTestAnalyzer.NullArgumentsDescriptor.
Id
, "Nothing").WithLocation(15, 12),
773
Diagnostic(NullArgumentTestAnalyzer.NullArgumentsDescriptor.
Id
, "Nothing").WithLocation(15, 21),
774
Diagnostic(NullArgumentTestAnalyzer.NullArgumentsDescriptor.
Id
, "Nothing").WithLocation(20, 26))
811
Diagnostic(MemberInitializerTestAnalyzer.DoNotUseFieldInitializerDescriptor.
Id
, "Field").WithLocation(14, 35),
812
Diagnostic(MemberInitializerTestAnalyzer.DoNotUsePropertyInitializerDescriptor.
Id
, "Prop1").WithLocation(15, 33),
813
Diagnostic(MemberInitializerTestAnalyzer.DoNotUseFieldInitializerDescriptor.
Id
, "Field").WithLocation(16, 33),
814
Diagnostic(MemberInitializerTestAnalyzer.DoNotUsePropertyInitializerDescriptor.
Id
, "Prop1").WithLocation(16, 46),
815
Diagnostic(MemberInitializerTestAnalyzer.DoNotUsePropertyInitializerDescriptor.
Id
, "Prop2").WithLocation(17, 33),
816
Diagnostic(MemberInitializerTestAnalyzer.DoNotUseFieldInitializerDescriptor.
Id
, "Field").WithLocation(17, 58),
817
Diagnostic(MemberInitializerTestAnalyzer.DoNotUsePropertyInitializerDescriptor.
Id
, "Prop1").WithLocation(19, 35))
860
Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.
Id
, ".Prop2 = New Bar() With {.Field = True}").WithLocation(21, 32),
861
Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.
Id
, ".Field = 10").WithLocation(14, 34),
862
Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.
Id
, ".Prop1 = Nothing").WithLocation(15, 32),
863
Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.
Id
, ".Field = 10").WithLocation(16, 32),
864
Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.
Id
, ".Prop1 = Nothing").WithLocation(16, 45),
865
Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.
Id
, ".Prop2 = New Bar() With {.Field = True}").WithLocation(17, 32),
866
Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.
Id
, ".Field = True").WithLocation(17, 57),
867
Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.
Id
, ".Field = True").WithLocation(21, 57),
868
Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.
Id
, "f1.Field = 0").WithLocation(22, 9),
869
Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.
Id
, "f1.Prop1 = Nothing").WithLocation(23, 9),
870
Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.
Id
, "f2.Field = True").WithLocation(26, 9))
911
Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.
Id
, "{1, 2, 3, 4, 5, 6}").WithLocation(11, 34),
912
Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.
Id
, "{1, 2, 3, 4, 5, 6}").WithLocation(12, 20),
913
Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.
Id
, "{Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}").WithLocation(13, 27),
914
Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.
Id
, "{1, 2, 3, 4, 5, 6}").WithLocation(15, 36),
915
Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.
Id
, "{1, 2, 3, 4, 5, 6}").WithLocation(16, 37),
916
Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.
Id
, "{7, 8, 9, 10, 11, 12}").WithLocation(17, 37),
917
Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.
Id
, "{Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}").WithLocation(18, 30),
918
Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.
Id
, "{Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}").WithLocation(19, 29),
919
Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.
Id
, "{1, 2, 3, 4, 5, 6}").WithLocation(24, 25))
965
Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.
Id
, "a1").WithLocation(5, 13),
966
Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.
Id
, "Dim b1 As New Integer, b2, b3, b4 As New Goo(1)").WithLocation(6, 9),
967
Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.
Id
, "b1").WithLocation(6, 13),
968
Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.
Id
, "b2").WithLocation(6, 32),
969
Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.
Id
, "b3").WithLocation(6, 36),
970
Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.
Id
, "b4").WithLocation(6, 40),
971
Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.
Id
, "Dim c1, c2 As Integer, c3, c4 As Goo").WithLocation(7, 9),
972
Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.
Id
, "Dim e1 As Integer = 10, e2 = {1, 2, 3}, e3, e4 As C").WithLocation(9, 9),
973
Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.
Id
, "e1").WithLocation(9, 13),
974
Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.
Id
, "e2").WithLocation(9, 33),
975
Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.
Id
, "f1").WithLocation(10, 13),
976
Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.
Id
, "f2").WithLocation(10, 22),
977
Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.
Id
, "Dim h1, h2, , h3 As Integer").WithLocation(11, 9),
978
Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.
Id
, "Dim i1, i2, i3, i4 As New UndefType").WithLocation(12, 9),
979
Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.
Id
, "Dim j1, j2, j3, j4 As UndefType").WithLocation(13, 9),
980
Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.
Id
, "Dim k1 As Integer, k2, k3, k4 As New Goo(1)").WithLocation(14, 9),
981
Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.
Id
, "k2").WithLocation(14, 28),
982
Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.
Id
, "k3").WithLocation(14, 32),
983
Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.
Id
, "k4").WithLocation(14, 36))
1077
Diagnostic(CaseTestAnalyzer.MultipleCaseClausesDescriptor.
Id
,
1080
Diagnostic(CaseTestAnalyzer.HasDefaultCaseDescriptor.
Id
, "Case Else").WithLocation(8, 13),
1081
Diagnostic(CaseTestAnalyzer.HasDefaultCaseDescriptor.
Id
, "Case Else").WithLocation(17, 13),
1082
Diagnostic(CaseTestAnalyzer.HasDefaultCaseDescriptor.
Id
, "Case Else").WithLocation(26, 13),
1083
Diagnostic(CaseTestAnalyzer.MultipleCaseClausesDescriptor.
Id
,
1086
Diagnostic(CaseTestAnalyzer.HasDefaultCaseDescriptor.
Id
, "Case Else").WithLocation(33, 13),
1087
Diagnostic(CaseTestAnalyzer.MultipleCaseClausesDescriptor.
Id
,
1090
Diagnostic(CaseTestAnalyzer.HasDefaultCaseDescriptor.
Id
, "Case Else").WithLocation(50, 13))
1122
Diagnostic(ExplicitVsImplicitInstanceAnalyzer.ExplicitInstanceDescriptor.
Id
, "Me").WithLocation(3, 9),
1123
Diagnostic(ExplicitVsImplicitInstanceAnalyzer.ImplicitInstanceDescriptor.
Id
, "M1").WithLocation(4, 9),
1124
Diagnostic(ExplicitVsImplicitInstanceAnalyzer.ExplicitInstanceDescriptor.
Id
, "MyBase").WithLocation(13, 9),
1125
Diagnostic(ExplicitVsImplicitInstanceAnalyzer.ImplicitInstanceDescriptor.
Id
, "M1").WithLocation(14, 9),
1126
Diagnostic(ExplicitVsImplicitInstanceAnalyzer.ImplicitInstanceDescriptor.
Id
, "M2").WithLocation(15, 9))
1162
Diagnostic(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
1163
Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.
Id
, "Mumble").WithLocation(7, 20),
1164
Diagnostic(MemberReferenceAnalyzer.MethodBindingDescriptor.
Id
, "AddressOf Mumbler").WithLocation(7, 51),
1165
Diagnostic(MemberReferenceAnalyzer.HandlerAddedDescriptor.
Id
, "AddHandler Mumble, New MumbleEventHandler(Sub(s As Object, a As System.EventArgs)
1167
Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.
Id
, "Mumble").WithLocation(8, 20),
1168
Diagnostic(MemberReferenceAnalyzer.HandlerAddedDescriptor.
Id
, "AddHandler Mumble, Sub(s As Object, a As System.EventArgs)
1170
Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.
Id
, "Mumble").WithLocation(10, 20),
1171
Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.
Id
, "Mumble").WithLocation(12, 20),
1172
Diagnostic(MemberReferenceAnalyzer.MethodBindingDescriptor.
Id
, "AddressOf Mumbler").WithLocation(14, 39),
1173
Diagnostic(MemberReferenceAnalyzer.HandlerRemovedDescriptor.
Id
, "RemoveHandler Mumble, AddressOf Mumbler").WithLocation(16, 9),
1174
Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.
Id
, "Mumble").WithLocation(16, 23),
1175
Diagnostic(MemberReferenceAnalyzer.MethodBindingDescriptor.
Id
, "AddressOf Mumbler").WithLocation(16, 31)
1215
Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.
Id
, "M0(1, 2, 3, 4, 5)").WithLocation(9, 9),
1216
Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.
Id
, "M0(1, 2, 3, 4, 5, 6)").WithLocation(10, 9),
1217
Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.
Id
, "New Integer() { 2, 3, 4, 5 }").WithLocation(12, 15),
1218
Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.
Id
, "New Integer() { 2, 3, 4, 5, 6 }").WithLocation(13, 15),
1219
Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.
Id
, "D").WithLocation(14, 30),
1220
Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.
Id
, "New Integer() { 2, 3, 4, 5 }").WithLocation(15, 26))
1248
Diagnostic(EqualsValueTestAnalyzer.EqualsValueDescriptor.
Id
, "= 44").WithLocation(2, 26),
1249
Diagnostic(EqualsValueTestAnalyzer.EqualsValueDescriptor.
Id
, "= ""Hello""").WithLocation(3, 25),
1250
Diagnostic(EqualsValueTestAnalyzer.EqualsValueDescriptor.
Id
, "= Goo()").WithLocation(4, 26),
1251
Diagnostic(EqualsValueTestAnalyzer.EqualsValueDescriptor.
Id
, "= 20").WithLocation(10, 84))
1280
Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.
Id
, "0").WithLocation(8, 28),
1281
Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.
Id
, "x").WithLocation(9, 28),
1282
Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.
Id
, "12").WithLocation(12, 36))
1326
Diagnostic(NoneOperationTestAnalyzer.NoneOperationDescriptor.
Id
, <![CDATA[Public Sub Barney
1329
Diagnostic(NoneOperationTestAnalyzer.NoneOperationDescriptor.
Id
, "Resume").WithLocation(23, 9))
1379
Diagnostic(LambdaTestAnalyzer.LambdaExpressionDescriptor.
Id
, "Sub()
1381
Diagnostic(LambdaTestAnalyzer.LambdaExpressionDescriptor.
Id
, "Sub(s As Object, a As EventArgs)
1383
Diagnostic(LambdaTestAnalyzer.LambdaExpressionDescriptor.
Id
, "Sub()
1386
Diagnostic(LambdaTestAnalyzer.LambdaExpressionDescriptor.
Id
, "Sub(s As Object, a As EventArgs)
1392
Diagnostic(LambdaTestAnalyzer.TooManyStatementsInLambdaExpressionDescriptor.
Id
, "Sub(s As Object, a As EventArgs)
1398
Diagnostic(LambdaTestAnalyzer.LambdaExpressionDescriptor.
Id
, "Function(value As Integer)
1404
Diagnostic(LambdaTestAnalyzer.TooManyStatementsInLambdaExpressionDescriptor.
Id
, "Function(value As Integer)
1454
Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.
Id
, "AddHandler C.E, AddressOf D.Method").WithLocation(19, 9),
1455
Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.
Id
, "AddressOf D.Method").WithLocation(19, 25),
1456
Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.
Id
, "E").WithLocation(20, 20),
1457
Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.
Id
, "C.Bar()").WithLocation(21, 9),
1458
Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.
Id
, "AddHandler D.E, Sub()
1460
Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.
Id
, "D.Field").WithLocation(25, 9),
1461
Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.
Id
, "D.P").WithLocation(26, 17),
1462
Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.
Id
, "D.Method()").WithLocation(27, 9))
1485
Diagnostic(LabelOperationsTestAnalyzer.LabelDescriptor.
Id
, "Wilma:").WithLocation(3, 9),
1486
Diagnostic(LabelOperationsTestAnalyzer.GotoDescriptor.
Id
, "GoTo Betty").WithLocation(4, 9),
1487
Diagnostic(LabelOperationsTestAnalyzer.LabelDescriptor.
Id
, "Betty:").WithLocation(5, 9),
1488
Diagnostic(LabelOperationsTestAnalyzer.GotoDescriptor.
Id
, "GoTo Wilma").WithLocation(6, 9))
1541
Diagnostic(UnaryAndBinaryOperationsTestAnalyzer.BooleanNotDescriptor.
Id
, "Not b").WithLocation(33, 13),
1542
Diagnostic(UnaryAndBinaryOperationsTestAnalyzer.DoubleMultiplyDescriptor.
Id
, "d * 100").WithLocation(34, 13),
1543
Diagnostic(UnaryAndBinaryOperationsTestAnalyzer.OperatorAddMethodDescriptor.
Id
, "a1 + a2").WithLocation(35, 14),
1544
Diagnostic(UnaryAndBinaryOperationsTestAnalyzer.OperatorMinusMethodDescriptor.
Id
, "-a2").WithLocation(36, 14))
1783
Diagnostic(NullOperationSyntaxTestAnalyzer.ParamsArrayOperationDescriptor.
Id
, "M0()").WithLocation(6, 9),
1784
Diagnostic(NullOperationSyntaxTestAnalyzer.ParamsArrayOperationDescriptor.
Id
, "M0(1)").WithLocation(7, 9),
1785
Diagnostic(NullOperationSyntaxTestAnalyzer.ParamsArrayOperationDescriptor.
Id
, "M0(1, 2)").WithLocation(8, 9))
1815
Diagnostic(InvalidOperatorExpressionTestAnalyzer.InvalidBinaryDescriptor.
Id
, "b + c").WithLocation(3, 16),
1816
Diagnostic(InvalidOperatorExpressionTestAnalyzer.InvalidUnaryDescriptor.
Id
, "-s").WithLocation(7, 16))
1846
Diagnostic(ParamsArrayTestAnalyzer.InvalidConstructorDescriptor.
Id
, "New C.S()").WithLocation(7, 11))
1906
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.
Id
, "p?.Prop").WithLocation(24, 17),
1907
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.
Id
, "p").WithLocation(24, 17),
1908
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.
Id
, "p?.Field").WithLocation(25, 13),
1909
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.
Id
, "p").WithLocation(25, 13),
1910
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.
Id
, "p?(0)").WithLocation(26, 13),
1911
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.
Id
, "p").WithLocation(26, 13),
1912
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.
Id
, "p?.M0(Nothing)").WithLocation(27, 9),
1913
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.
Id
, "p").WithLocation(27, 9),
1914
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.
Id
, "Field1?.Prop").WithLocation(29, 13),
1915
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.
Id
, "Field1").WithLocation(29, 13),
1916
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.
Id
, "Field1?.Field").WithLocation(30, 13),
1917
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.
Id
, "Field1").WithLocation(30, 13),
1918
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.
Id
, "Field1?(0)").WithLocation(31, 13),
1919
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.
Id
, "Field1").WithLocation(31, 13),
1920
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.
Id
, "Field1?.M0(Nothing)").WithLocation(32, 9),
1921
Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.
Id
, "Field1").WithLocation(32, 9))
1989
Diagnostic(ForLoopConditionCrashVBTestAnalyzer.ForLoopConditionCrashDescriptor.
Id
, "Boo").WithLocation(41, 24),
1990
Diagnostic(ForLoopConditionCrashVBTestAnalyzer.ForLoopConditionCrashDescriptor.
Id
, "10").WithLocation(19, 40))
2123
Diagnostic(TrueFalseUnaryOperationTestAnalyzer.UnaryTrueDescriptor.
Id
, "x").WithLocation(27, 12),
2124
Diagnostic(TrueFalseUnaryOperationTestAnalyzer.UnaryTrueDescriptor.
Id
, "x AndAlso y").WithLocation(33, 12))
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (2)
Parser\ParseDirectives.vb (2)
3213
Dim expectedId = analyzer.SupportedDiagnostics.Single.
Id
3320
Dim expectedId = analyzer.SupportedDiagnostics.Single.
Id
Microsoft.CodeAnalysis.Workspaces (11)
DiagnosticDescriptorExtensions.cs (5)
44
(!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.
Id
, out var reportDiagnostic) ||
47
if (treeOptions.TryGetValue(descriptor.
Id
, out reportDiagnostic) && reportDiagnostic != ReportDiagnostic.Default ||
61
var diagnosticKey = $"{DotnetDiagnosticPrefix}.{descriptor.
Id
}.{SeveritySuffix}";
103
var diagnosticKey = $"{DotnetDiagnosticPrefix}.{descriptor.
Id
}.{SeveritySuffix}";
198
return new DiagnosticDescriptor(descriptor.
Id
, descriptor.Title, messageFormat,
Diagnostics\DiagnosticAnalyzerInfoCache.cs (3)
145
if (!_idToDescriptorsMap.TryGetValue(descriptor.
Id
, out var existingDescriptor))
147
_idToDescriptorsMap[descriptor.
Id
] = descriptor;
158
_idToDescriptorsMap[descriptor.
Id
] = null;
Diagnostics\SkippedHostAnalyzersInfo.cs (3)
65
projectAnalyzerDiagnosticIds.Add(descriptor.
Id
);
136
if (projectAnalyzerDiagnosticIds.Contains(descriptor.
Id
))
138
skippedDiagnosticIdsBuilder.Add(descriptor.
Id
);
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
BatchFixAllProviderTests.cs (1)
91
public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(LiteralZeroAnalyzer.Descriptor.
Id
);
Microsoft.VisualStudio.LanguageServices (2)
TaskList\ExternalErrorDiagnosticUpdateSource.cs (2)
697
builder.UnionWith(descriptorMap.Values.SelectMany(v => v.Select(d => d.
Id
)));
875
var diagnosticIds = infoCache.GetNonCompilationEndDiagnosticDescriptors(analyzer).Select(d => d.
Id
);
Microsoft.VisualStudio.LanguageServices.Implementation (7)
SolutionExplorer\DiagnosticItem\BaseDiagnosticAndGeneratorItemSource.cs (1)
115
.GroupBy(d => d.
Id
)
SolutionExplorer\DiagnosticItem\BaseDiagnosticAndGeneratorItemSource.DiagnosticDescriptorComparer.cs (2)
18
var comparison = StringComparer.CurrentCulture.Compare(x.
Id
, y.
Id
);
SolutionExplorer\DiagnosticItem\DiagnosticItem.BrowseObject.cs (2)
31
return _diagnosticItem.Descriptor.
Id
;
123
return _diagnosticItem.Descriptor.
Id
;
SolutionExplorer\DiagnosticItem\DiagnosticItem.cs (2)
31
: base(descriptor.
Id
+ ": " + descriptor.Title)
81
ruleSetDocument.SetSeverity(_analyzerReference.Display, Descriptor.
Id
, value);
Microsoft.VisualStudio.LanguageServices.UnitTests (4)
Diagnostics\ExternalDiagnosticUpdateSourceTests.vb (4)
292
Dim diagnostic = GetDiagnosticData(project.Id, id:=analyzer.SupportedDiagnostics(0).
Id
)
344
Dim diagnostic = GetDiagnosticData(project.Id, id:=analyzer.SupportedDiagnostics(0).
Id
)
383
Dim diagnostic = GetDiagnosticData(project.Id, id:=analyzer.SupportedDiagnostics(0).
Id
)
514
id:=analyzer.Descriptor.
Id
,