151 references to ReportDiagnostic
ILLink.RoslynAnalyzer (17)
DynamicallyAccessedMembersAnalyzer.cs (13)
126 GenericArgumentDataFlow.ProcessGenericArgumentDataFlow (location, baseType, context.ReportDiagnostic); 129 GenericArgumentDataFlow.ProcessGenericArgumentDataFlow (location, interfaceType, context.ReportDiagnostic); 131 DynamicallyAccessedMembersTypeHierarchy.ApplyDynamicallyAccessedMembersToTypeHierarchy (location, type, context.ReportDiagnostic); 154 context.ReportDiagnostic (Diagnostic.Create (DiagnosticDescriptors.GetDiagnosticDescriptor (DiagnosticId.DynamicallyAccessedMembersOnFieldCanOnlyApplyToTypesOrStrings), location, member.GetDisplayName ())); 157 context.ReportDiagnostic (Diagnostic.Create (DiagnosticDescriptors.GetDiagnosticDescriptor (DiagnosticId.DynamicallyAccessedMembersOnMethodReturnValueCanOnlyApplyToTypesOrStrings), location, member.GetDisplayName ())); 159 context.ReportDiagnostic (Diagnostic.Create (DiagnosticDescriptors.GetDiagnosticDescriptor (DiagnosticId.DynamicallyAccessedMembersIsNotAllowedOnMethods), location)); 162 context.ReportDiagnostic (Diagnostic.Create (DiagnosticDescriptors.GetDiagnosticDescriptor (DiagnosticId.DynamicallyAccessedMembersOnMethodParameterCanOnlyApplyToTypesOrStrings), location, parameter.GetDisplayName (), member.GetDisplayName ())); 165 context.ReportDiagnostic (Diagnostic.Create (DiagnosticDescriptors.GetDiagnosticDescriptor (DiagnosticId.DynamicallyAccessedMembersOnPropertyCanOnlyApplyToTypesOrStrings), location, member.GetDisplayName ())); 195 context.ReportDiagnostic (Diagnostic.Create ( 217 context.ReportDiagnostic (Diagnostic.Create ( 241 context.ReportDiagnostic (Diagnostic.Create ( 254 context.ReportDiagnostic (Diagnostic.Create ( 293 context.ReportDiagnostic (Diagnostic.Create (
RequiresAnalyzerBase.cs (3)
243 symbolAnalysisContext.ReportDiagnostic (Diagnostic.Create ( 251 symbolAnalysisContext.ReportDiagnostic (Diagnostic.Create ( 261 symbolAnalysisContext.ReportDiagnostic (Diagnostic.Create (
RequiresUnreferencedCodeAnalyzer.cs (1)
42 symbolAnalysisContext.ReportDiagnostic (diag);
Microsoft.Analyzers.Extra (1)
MakeExeTypesInternalAnalyzer.cs (1)
135symbolActionContext.ReportDiagnostic(diagnostic);
Microsoft.AspNetCore.Analyzers (4)
BuildServiceProviderAnalyzer.cs (1)
31context.ReportDiagnostic(Diagnostic.Create(
UseAuthorizationAnalyzer.cs (2)
49context.ReportDiagnostic(Diagnostic.Create( 69context.ReportDiagnostic(Diagnostic.Create(
UseMvcAnalyzer.cs (1)
43context.ReportDiagnostic(Diagnostic.Create(
Microsoft.AspNetCore.App.Analyzers (2)
Mvc\DetectAmbiguousActionRoutes.cs (1)
42context.ReportDiagnostic(Diagnostic.Create(
Mvc\DetectOverriddenAuthorizeAttribute.cs (1)
216context.ReportDiagnostic(Diagnostic.Create(
Microsoft.AspNetCore.Components.Analyzers (7)
ComponentParameterAnalyzer.cs (5)
84context.ReportDiagnostic(Diagnostic.Create( 91context.ReportDiagnostic(Diagnostic.Create( 105context.ReportDiagnostic(Diagnostic.Create( 115context.ReportDiagnostic(Diagnostic.Create( 126context.ReportDiagnostic(Diagnostic.Create(
InternalUsageAnalyzer.cs (2)
166context.ReportDiagnostic(Diagnostic.Create( 176context.ReportDiagnostic(Diagnostic.Create(
Microsoft.AspNetCore.Components.SdkAnalyzers (6)
ComponentParameterAnalyzer.cs (4)
78context.ReportDiagnostic(Diagnostic.Create( 85context.ReportDiagnostic(Diagnostic.Create( 99context.ReportDiagnostic(Diagnostic.Create( 113context.ReportDiagnostic(Diagnostic.Create(
InternalUsageAnalyzer.cs (2)
166context.ReportDiagnostic(Diagnostic.Create( 176context.ReportDiagnostic(Diagnostic.Create(
Microsoft.AspNetCore.Mvc.Analyzers (4)
AttributesShouldNotBeAppliedToPageModelAnalyzer.cs (3)
89context.ReportDiagnostic(Diagnostic.Create( 103context.ReportDiagnostic(Diagnostic.Create( 117context.ReportDiagnostic(Diagnostic.Create(
TopLevelParameterNameAnalyzer.cs (1)
73context.ReportDiagnostic(
Microsoft.CodeAnalysis.Analyzers (19)
FixAnalyzers\FixerWithFixAllAnalyzer.cs (3)
231context.ReportDiagnostic(diagnostic); 284context.ReportDiagnostic(diagnostic); 297context.ReportDiagnostic(diagnostic);
ImplementationIsObsoleteAnalyzer.cs (1)
58context.ReportDiagnostic(namedTypeSymbol.CreateDiagnostic(Rule, namedTypeSymbol.Name, iface.Name, (string)attr.ConstructorArguments[0].Value!));
InternalImplementationOnlyAnalyzer.cs (1)
61context.ReportDiagnostic(namedTypeSymbol.CreateDiagnostic(Rule, namedTypeSymbol.Name, iface.Name));
MetaAnalyzers\ClassIsNotDiagnosticAnalyzer.cs (1)
55sac.ReportDiagnostic(namedType.Locations[0].CreateDiagnostic(Rule, namedType.Name));
MetaAnalyzers\CompilerExtensionStrictApiAnalyzer.cs (1)
153context.ReportDiagnostic(Diagnostic.Create(descriptor, Location.Create(applicationSyntaxReference.SyntaxTree, applicationSyntaxReference.Span)));
MetaAnalyzers\CompilerExtensionTargetFrameworkAnalyzer.cs (1)
102context.ReportDiagnostic(Diagnostic.Create(
MetaAnalyzers\DiagnosticAnalyzerAttributeAnalyzer.cs (2)
125symbolContext.ReportDiagnostic(diagnostic); 140symbolContext.ReportDiagnostic(diagnostic);
MetaAnalyzers\DiagnosticAnalyzerFieldsAnalyzer.cs (1)
167context.ReportDiagnostic(diagnostic);
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer.cs (4)
310resourcesDataValueMap, context.Options, context.ReportDiagnostic, context.CancellationToken); 312resourcesDataValueMap, context.Options, context.ReportDiagnostic, context.CancellationToken); 314resourcesDataValueMap, context.Options, context.ReportDiagnostic, context.CancellationToken); 440context.ReportDiagnostic(Diagnostic.Create(AddCompilationEndCustomTagRule, field.Locations[0], field.Name));
MetaAnalyzers\DoNotUseFileTypesForAnalyzersOrGenerators.cs (1)
65context.ReportDiagnostic(diagnostic);
MetaAnalyzers\ReportDiagnosticAnalyzer.cs (1)
245symbolContext.ReportDiagnostic(diagnostic);
MetaAnalyzers\SymbolIsBannedInAnalyzersAnalyzer.cs (1)
77symbolAnalysisContext.ReportDiagnostic(symbol.Locations.CreateDiagnostic(SymbolIsBannedInAnalyzersAnalyzer.NoSettingSpecifiedSymbolIsBannedRule, symbol));
src\RoslynAnalyzers\Microsoft.CodeAnalysis.BannedApiAnalyzers\Core\SymbolIsBannedAnalyzerBase.cs (1)
61context => VerifyAttributes(context.ReportDiagnostic, context.Symbol.GetAttributes(), context.CancellationToken),
Microsoft.CodeAnalysis.BannedApiAnalyzers (1)
SymbolIsBannedAnalyzerBase.cs (1)
61context => VerifyAttributes(context.ReportDiagnostic, context.Symbol.GetAttributes(), context.CancellationToken),
Microsoft.CodeAnalysis.CodeStyle (6)
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
133symbolEndContext.ReportDiagnostic(diagnostic);
src\Analyzers\Core\Analyzers\NamingStyle\NamingStyleDiagnosticAnalyzerBase.cs (1)
74symbolContext.ReportDiagnostic(diagnostic);
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
610symbolEndContext.ReportDiagnostic(DiagnosticHelper.CreateWithLocationTags(
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
115ReportUnusedParameterDiagnostic(parameter, hasReference, context.ReportDiagnostic, context.Options, interpolatedStringHandlerAttribute, context.CancellationToken);
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (2)
657context.ReportDiagnostic(DiagnosticHelper.Create( 667context.ReportDiagnostic(Diagnostic.Create(
Microsoft.CodeAnalysis.CSharp.CodeStyle (4)
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
115context.ReportDiagnostic(diagnostic);
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
59context.ReportDiagnostic(DiagnosticHelper.Create(
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
187context.ReportDiagnostic(DiagnosticHelper.Create(
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (1)
233context.ReportDiagnostic(DiagnosticHelper.Create(
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (2)
CommandLineTests.cs (2)
16003symbolContext.ReportDiagnostic(Diagnostic.Create(Warning01, symbolContext.Symbol.Locations.First())); 16020symbolContext.ReportDiagnostic(Diagnostic.Create(Warning02, symbolContext.Symbol.Locations.First()));
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (1)
866context.ReportDiagnostic(diagnostic);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (3)
Diagnostics\DiagnosticAnalyzerTests.cs (2)
273context.ReportDiagnostic(diag1); 841ctxt.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(Descriptor1, method.Locations[0], method.ToDisplayString()));
Diagnostics\GetDiagnosticsTests.cs (1)
1851symbolContext.ReportDiagnostic(diag);
Microsoft.CodeAnalysis.CSharp.Features (4)
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
115context.ReportDiagnostic(diagnostic);
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
59context.ReportDiagnostic(DiagnosticHelper.Create(
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
187context.ReportDiagnostic(DiagnosticHelper.Create(
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (1)
233context.ReportDiagnostic(DiagnosticHelper.Create(
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
Diagnostics\Suppression\RemoveUnnecessaryPragmaSuppressionsTests.cs (1)
1310context.ReportDiagnostic(diagnostic);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
CodeFixes\CodeFixServiceTests.cs (1)
1199context.ReportDiagnostic(Diagnostic.Create(Descriptor, decl.GetLocation()));
Diagnostics\DiagnosticAnalyzerServiceTests.cs (1)
926c.ReportDiagnostic(Diagnostic.Create(_supportedDiagnostics[0], c.Symbol.Locations[0]));
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (3)
Diagnostics\DiagnosticServiceTests.vb (3)
1464symbolContext.ReportDiagnostic(diag) 1578context.ReportDiagnostic(Diagnostic.Create(DiagDescriptor, location)) 1889ctxt.ReportDiagnostic(Diagnostic.Create(Descriptor, method.Locations(0), method.ToDisplayString))
Microsoft.CodeAnalysis.Features (5)
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
133symbolEndContext.ReportDiagnostic(diagnostic);
src\Analyzers\Core\Analyzers\NamingStyle\NamingStyleDiagnosticAnalyzerBase.cs (1)
74symbolContext.ReportDiagnostic(diagnostic);
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
610symbolEndContext.ReportDiagnostic(DiagnosticHelper.CreateWithLocationTags(
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (2)
657context.ReportDiagnostic(DiagnosticHelper.Create( 667context.ReportDiagnostic(Diagnostic.Create(
Microsoft.CodeAnalysis.PublicApiAnalyzers (2)
DeclarePublicApiAnalyzer.Impl.cs (2)
119OnSymbolActionCore(symbolContext.Symbol, symbolContext.ReportDiagnostic, obsoleteAttribute, symbolContext.CancellationToken); 161this.OnSymbolActionCore(accessor, symbolContext.ReportDiagnostic, isImplicitlyDeclaredConstructor: false, obsoleteAttribute, symbolContext.CancellationToken);
Microsoft.CodeAnalysis.Test.Utilities (20)
Diagnostics\CommonDiagnosticAnalyzers.cs (18)
766context.ReportDiagnostic(Diagnostic.Create(Rule, context.Symbol.Locations[0])); 798context.ReportDiagnostic(Diagnostic.Create(Rule, ns.Locations[0])); 964cc.RegisterSymbolAction(c => ReportDiagnostic(c.ReportDiagnostic, ActionKind.Symbol), SymbolKind.NamedType); 1003symbolContext.ReportDiagnostic(Diagnostic.Create(Rule, symbolContext.Symbol.Locations[0])); 1043symbolContext.ReportDiagnostic(Diagnostic.Create(Rule, symbolContext.Symbol.Locations[0], symbolContext.Symbol.Name)); 1178symbolContext.ReportDiagnostic(diagnostic); 1220symbolContext.ReportDiagnostic(diagnostic); 1537ReportSymbolDiagnostics(symbolContext.Symbol, symbolContext.ReportDiagnostic); 1815symbolContext.ReportDiagnostic(diagnostic); 1864context.ReportDiagnostic(Diagnostic.Create(ParameterDescriptor, context.Symbol.Locations[0])); 2064symbolEndContext.ReportDiagnostic(Diagnostic.Create(rule, Location.None, symbolStartContext.Symbol.Name, _analyzerId)); 2429ReportDiagnostic(c.Symbol, c.ReportDiagnostic); 2439ReportDiagnostic(symbolEndContext.Symbol, symbolEndContext.ReportDiagnostic); 2543context.ReportDiagnostic(diagnostic); 2610context => context.ReportDiagnostic(Diagnostic.Create(Descriptor, context.Symbol.Locations[0])), 2750ReportSymbolDiagnostics("RegisterSymbolAction", symbolContext.Symbol, symbolContext.Compilation, symbolContext.ReportDiagnostic), 2766ReportSymbolDiagnostics("RegisterSymbolEndAction", symbolEndContext.Symbol, symbolEndContext.Compilation, symbolEndContext.ReportDiagnostic)); 2940context.RegisterSymbolAction(context => HandleCallback(context.Symbol.Locations[0], context.Compilation, context.ReportDiagnostic, context.CancellationToken), SymbolKind.NamedType);
Diagnostics\SuppressMessageAttributeTests.DiagnosticAnalyzers.cs (2)
69context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_rule, context.Symbol.Locations.First(), messageArgs: context.Symbol.Name)); 100context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_rule, context.Symbol.Locations.First(), messageArgs: context.Symbol.Name));
Microsoft.DotNet.CodeAnalysis (1)
Analyzers\PinvokeAnalyzer.cs (1)
163context.ReportDiagnostic(Diagnostic.Create(InvalidPinvokeCall, synref.GetSyntax().GetLocation(), data.ModuleName + "!" + (data.EntryPointName ?? methodSymbol.Name), altMsg));
Microsoft.Interop.ComInterfaceGenerator (4)
Analyzers\AddGeneratedComClassAnalyzer.cs (2)
51context.ReportDiagnostic(type.CreateDiagnostic(AddGeneratedComClassAttribute, type.Name)); 59context.ReportDiagnostic(type.CreateDiagnostic(AddGeneratedComClassAttribute, type.Name));
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (1)
141context.ReportDiagnostic(type.CreateDiagnostic(ConvertToGeneratedComInterface, properties.ToImmutable(), type.Name));
Analyzers\GeneratedComInterfaceAttributeAnalyzer.cs (1)
44context.ReportDiagnostic(comInterfaceAttribute.CreateDiagnosticInfo(GeneratorDiagnostics.InterfaceTypeNotSupported, unsupportedValue).ToDiagnostic());
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\ConvertToLibraryImportAnalyzer.cs (1)
89context.ReportDiagnostic(method.CreateDiagnosticInfo(ConvertToLibraryImport, properties.ToImmutable(), method.Name).ToDiagnostic());
Microsoft.ML.CodeAnalyzer.Tests (1)
Code\RelaxTestNamingTest.cs (1)
133context.ReportDiagnostic(Diagnostic.Create(Rule, method.Locations[0]));
Microsoft.ML.InternalCodeAnalyzer (4)
BaseTestClassAnalyzer.cs (1)
78context.ReportDiagnostic(Diagnostic.Create(Rule, namedType.Locations[0], namedType));
BestFriendOnPublicDeclarationsAnalyzer.cs (1)
67context.ReportDiagnostic(diagnostic);
InstanceInitializerAnalyzer.cs (2)
60context.ReportDiagnostic(diagnostic); 76context.ReportDiagnostic(diagnostic);
Roslyn.Diagnostics.Analyzers (18)
AbstractDoNotCopyValue.cs (2)
284_context.ReportDiagnostic(symbol.CreateDiagnostic(NoFieldOfCopyableTypeRule, symbol.Type, symbol)); 342_context.ReportDiagnostic(symbol.CreateDiagnostic(NoAutoPropertyRule, symbol.Type, symbol));
DefaultableTypeShouldHaveDefaultableFieldsAnalyzer.cs (1)
107originalContext.ReportDiagnostic(field.CreateDiagnostic(Rule, field.ContainingType, sourceSymbol.Name));
DoNotMixAttributesFromDifferentVersionsOfMEF.cs (2)
123symbolContext.ReportDiagnostic(symbolContext.Symbol.CreateDiagnostic(Rule, problematicAttribute.AttributeClass.Name, exportedType.Name)); 130symbolContext.ReportDiagnostic(diagnostic);
ExportedPartsShouldHaveImportingConstructor.cs (3)
110context.ReportDiagnostic( 130context.ReportDiagnostic( 149context.ReportDiagnostic(constructor.DeclaringSyntaxReferences.CreateDiagnostic(Rule, properties, context.CancellationToken, namedType.Name));
ImportingConstructorShouldBeObsolete.cs (6)
125context.ReportDiagnostic(attributeData.ApplicationSyntaxReference.CreateDiagnostic(Rule, ScenarioProperties.MissingDescription, context.CancellationToken, namedType.Name)); 131context.ReportDiagnostic(attributeData.ApplicationSyntaxReference.CreateDiagnostic(Rule, ScenarioProperties.MissingError, context.CancellationToken, namedType.Name)); 137context.ReportDiagnostic(attributeData.ApplicationSyntaxReference.CreateDiagnostic(Rule, context.CancellationToken, namedType.Name)); 145context.ReportDiagnostic(attributeData.ApplicationSyntaxReference.CreateDiagnostic(Rule, ScenarioProperties.IncorrectDescription, context.CancellationToken, namedType.Name)); 152context.ReportDiagnostic(attributeData.ApplicationSyntaxReference.CreateDiagnostic(Rule, ScenarioProperties.ErrorSetToFalse, context.CancellationToken, namedType.Name)); 162context.ReportDiagnostic(importingConstructorAttributeData.ApplicationSyntaxReference.CreateDiagnostic(Rule, ScenarioProperties.MissingAttribute, context.CancellationToken, namedType.Name));
PartsExportedWithMEFv2MustBeMarkedAsShared.cs (2)
67symbolContext.ReportDiagnostic(symbolContext.Symbol.CreateDiagnostic(Rule, namedType.Name)); 72symbolContext.ReportDiagnostic(exportAttributeApplication.ApplicationSyntaxReference.CreateDiagnostic(Rule, symbolContext.CancellationToken, namedType.Name));
TestExportsShouldNotBeDiscoverable.cs (2)
91context.ReportDiagnostic(context.Symbol.CreateDiagnostic(Rule, namedType.Name)); 96context.ReportDiagnostic(exportAttributeApplication.ApplicationSyntaxReference.CreateDiagnostic(Rule, context.CancellationToken, namedType.Name));
Roslyn.Diagnostics.Analyzers.UnitTests (1)
RelaxTestNamingSuppressorTests.cs (1)
134context.ReportDiagnostic(Diagnostic.Create(Rule, method.Locations[0]));
System.Windows.Forms.Analyzers.CSharp (1)
System\Windows\Forms\CSharp\Analyzers\MissingPropertySerializationConfiguration\MissingPropertySerializationConfigurationAnalyzer.cs (1)
77context.ReportDiagnostic(diagnostic);
System.Windows.Forms.Analyzers.VisualBasic (1)
Analyzers\MissingPropertySerializationConfiguration\MissingPropertySerializationConfigurationDiagnosticAnalyzer.vb (1)
79context.ReportDiagnostic(diagnostic)
Text.Analyzers (5)
EnumsShouldHavePluralNames.cs (2)
102context.ReportDiagnostic(symbol.CreateDiagnostic(Rule_CA1714, symbol.OriginalDefinition.Locations.First(), symbol.Name)); 109context.ReportDiagnostic(symbol.CreateDiagnostic(Rule_CA1717, symbol.OriginalDefinition.Locations.First(), symbol.Name));
IdentifiersShouldBeSpelledCorrectly.cs (3)
335ReportDiagnosticsForSymbol(typeParameter, RemovePrefixIfPresent('T', typeParameter.Name), symbolContext.ReportDiagnostic); 348ReportDiagnosticsForSymbol(typeParameter, RemovePrefixIfPresent('T', typeParameter.Name), symbolContext.ReportDiagnostic); 366ReportDiagnosticsForSymbol(symbol, symbolName, symbolContext.ReportDiagnostic);