144 types derived from DiagnosticAnalyzer
Aspire.Hosting.Analyzers (1)
AppHostAnalyzer.cs (1)
16public partial class AppHostAnalyzer : DiagnosticAnalyzer
Aspire.Hosting.Integration.Analyzers (1)
AspireExportAnalyzer.cs (1)
16public partial class AspireExportAnalyzer : DiagnosticAnalyzer
GenerateDocumentationAndConfigFiles (1)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
18internal abstract class DoNotCatchGeneralUnlessRethrownAnalyzer : DiagnosticAnalyzer
ILLink.RoslynAnalyzer (4)
COMAnalyzer.cs (1)
16public sealed class COMAnalyzer : DiagnosticAnalyzer
DynamicallyAccessedMembersAnalyzer.cs (1)
20public sealed class DynamicallyAccessedMembersAnalyzer : DiagnosticAnalyzer
RequiresAnalyzerBase.cs (1)
22public abstract class RequiresAnalyzerBase : DiagnosticAnalyzer, IGenericInstantiationAnalysis
UnsafeMethodMissingRequiresUnsafeAnalyzer.cs (1)
13public sealed class UnsafeMethodMissingRequiresUnsafeAnalyzer : DiagnosticAnalyzer
Microsoft.Analyzers.Extra (7)
AsyncCallInsideUsingBlockAnalyzer.cs (1)
14public sealed class AsyncCallInsideUsingBlockAnalyzer : DiagnosticAnalyzer
AsyncMethodWithoutCancellation.cs (1)
14public sealed class AsyncMethodWithoutCancellation : DiagnosticAnalyzer
CallAnalysis\CallAnalyzer.cs (1)
14public sealed partial class CallAnalyzer : DiagnosticAnalyzer
CoalesceAnalyzer.cs (1)
16public sealed class CoalesceAnalyzer : DiagnosticAnalyzer
ConditionalAccessAnalyzer.cs (1)
16public sealed class ConditionalAccessAnalyzer : DiagnosticAnalyzer
MakeExeTypesInternalAnalyzer.cs (1)
16public sealed class MakeExeTypesInternalAnalyzer : DiagnosticAnalyzer
UsingToStringInLoggersAnalyzer.cs (1)
15public sealed class UsingToStringInLoggersAnalyzer : DiagnosticAnalyzer
Microsoft.Analyzers.Local (3)
ApiLifecycle\ApiLifecycleAnalyzer.cs (1)
14public sealed class ApiLifecycleAnalyzer : DiagnosticAnalyzer
CallAnalysis\CallAnalyzer.cs (1)
14public sealed partial class CallAnalyzer : DiagnosticAnalyzer
InternalReferencedInPublicDocAnalyzer.cs (1)
19public class InternalReferencedInPublicDocAnalyzer : DiagnosticAnalyzer
Microsoft.AspNetCore.Analyzers (3)
StartupAnalyzer.cs (1)
13public partial class StartupAnalyzer : DiagnosticAnalyzer
StartupAnalyzer.Diagnostics.cs (1)
10public partial class StartupAnalyzer : DiagnosticAnalyzer
StartupAnalyzer.Events.cs (1)
11public partial class StartupAnalyzer : DiagnosticAnalyzer
Microsoft.AspNetCore.App.Analyzers (18)
Authorization\AddAuthorizationBuilderAnalyzer.cs (1)
17public sealed class AddAuthorizationBuilderAnalyzer : DiagnosticAnalyzer
Http\HeaderDictionaryAddAnalyzer.cs (1)
15public sealed class HeaderDictionaryAddAnalyzer : DiagnosticAnalyzer
Http\HeaderDictionaryIndexerAnalyzer.cs (1)
14public partial class HeaderDictionaryIndexerAnalyzer : DiagnosticAnalyzer
Http\RequestDelegateReturnTypeAnalyzer.cs (1)
15public partial class RequestDelegateReturnTypeAnalyzer : DiagnosticAnalyzer
Kestrel\ListenOnIPv6AnyAnalyzer.cs (1)
15public class ListenOnIPv6AnyAnalyzer : DiagnosticAnalyzer
Mvc\MvcAnalyzer.cs (1)
22public partial class MvcAnalyzer : DiagnosticAnalyzer
RenderTreeBuilder\RenderTreeBuilderAnalyzer.cs (1)
16public partial class RenderTreeBuilderAnalyzer : DiagnosticAnalyzer
RouteEmbeddedLanguage\RoutePatternAnalyzer.cs (1)
19public class RoutePatternAnalyzer : DiagnosticAnalyzer
RouteHandlers\AtMostOneFromBodyAttribute.cs (1)
15public partial class RouteHandlerAnalyzer : DiagnosticAnalyzer
RouteHandlers\DetectAmbiguousRoutes.cs (1)
20public partial class RouteHandlerAnalyzer : DiagnosticAnalyzer
RouteHandlers\DetectMismatchedParameterOptionality.cs (1)
11public partial class RouteHandlerAnalyzer : DiagnosticAnalyzer
RouteHandlers\DetectMisplacedLambdaAttribute.cs (1)
12public partial class RouteHandlerAnalyzer : DiagnosticAnalyzer
RouteHandlers\DisallowMvcBindArgumentsOnParameters.cs (1)
14public partial class RouteHandlerAnalyzer : DiagnosticAnalyzer
RouteHandlers\DisallowNonParsableComplexTypesOnParameters.cs (1)
16public partial class RouteHandlerAnalyzer : DiagnosticAnalyzer
RouteHandlers\DisallowReturningActionResultFromMapMethods.cs (1)
14public partial class RouteHandlerAnalyzer : DiagnosticAnalyzer
RouteHandlers\RouteHandlerAnalyzer.cs (1)
19public partial class RouteHandlerAnalyzer : DiagnosticAnalyzer
WebApplicationBuilder\PublicPartialProgramClassAnalyzer.cs (1)
14public sealed class PublicPartialProgramClassAnalyzer : DiagnosticAnalyzer
WebApplicationBuilder\WebApplicationBuilderAnalyzer.cs (1)
19public sealed class WebApplicationBuilderAnalyzer : DiagnosticAnalyzer
Microsoft.AspNetCore.Components.Analyzers (7)
ComponentInternalUsageDiagnosticAnalzyer.cs (1)
17public class ComponentInternalUsageDiagnosticAnalyzer : DiagnosticAnalyzer
ComponentParameterAnalyzer.cs (1)
20public sealed class ComponentParameterAnalyzer : DiagnosticAnalyzer
ComponentParameterUsageAnalyzer.cs (1)
13public class ComponentParameterUsageAnalyzer : DiagnosticAnalyzer
InvokeAsyncOfObjectAnalyzer.cs (1)
17public sealed class InvokeAsyncOfObjectAnalyzer : DiagnosticAnalyzer
PersistentStateAnalyzer.cs (1)
16public sealed class PersistentStateAnalyzer : DiagnosticAnalyzer
SupplyParameterFromFormAnalyzer.cs (1)
16public sealed class SupplyParameterFromFormAnalyzer : DiagnosticAnalyzer
VirtualizeItemComparerAnalyzer.cs (1)
18public sealed class VirtualizeItemComparerAnalyzer : DiagnosticAnalyzer
Microsoft.AspNetCore.Components.SdkAnalyzers (3)
ComponentInternalUsageDiagnosticAnalzyer.cs (1)
17public class ComponentInternalUsageDiagnosticAnalyzer : DiagnosticAnalyzer
ComponentParameterAnalyzer.cs (1)
15public class ComponentParameterAnalyzer : DiagnosticAnalyzer
ComponentParameterUsageAnalyzer.cs (1)
13public class ComponentParameterUsageAnalyzer : DiagnosticAnalyzer
Microsoft.AspNetCore.Mvc.Analyzers (4)
AttributesShouldNotBeAppliedToPageModelAnalyzer.cs (1)
11public class AttributesShouldNotBeAppliedToPageModelAnalyzer : DiagnosticAnalyzer
TagHelpersInCodeBlocksAnalyzer.cs (1)
13public class TagHelpersInCodeBlocksAnalyzer : DiagnosticAnalyzer
TopLevelParameterNameAnalyzer.cs (1)
14public class TopLevelParameterNameAnalyzer : DiagnosticAnalyzer
ViewFeatureAnalyzerBase.cs (1)
10public abstract class ViewFeatureAnalyzerBase : DiagnosticAnalyzer
Microsoft.AspNetCore.Mvc.Api.Analyzers (2)
ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzer.cs (1)
13public class ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzer : DiagnosticAnalyzer
ApiConventionAnalyzer.cs (1)
13public class ApiConventionAnalyzer : DiagnosticAnalyzer
Microsoft.CodeAnalysis (3)
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.CompilationAnalyzer.cs (1)
11internal abstract partial class CompilerDiagnosticAnalyzer : DiagnosticAnalyzer
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.cs (1)
14internal abstract partial class CompilerDiagnosticAnalyzer : DiagnosticAnalyzer
DiagnosticAnalyzer\DiagnosticSuppressor.cs (1)
12public abstract class DiagnosticSuppressor : DiagnosticAnalyzer
Microsoft.CodeAnalysis.Analyzers (19)
FixAnalyzers\FixerWithFixAllAnalyzer.cs (1)
29public sealed class FixerWithFixAllAnalyzer : DiagnosticAnalyzer
ImmutableObjectMethodAnalyzer.cs (1)
22public sealed class ImmutableObjectMethodAnalyzer : DiagnosticAnalyzer
ImplementationIsObsoleteAnalyzer.cs (1)
17public class ImplementationIsObsoleteAnalyzer : DiagnosticAnalyzer
InternalImplementationOnlyAnalyzer.cs (1)
20public class InternalImplementationOnlyAnalyzer : DiagnosticAnalyzer
MetaAnalyzers\ClassIsNotDiagnosticAnalyzer.cs (1)
18public sealed class ClassIsNotDiagnosticAnalyzer : DiagnosticAnalyzer
MetaAnalyzers\CompareSymbolsCorrectlyAnalyzer.cs (1)
23public class CompareSymbolsCorrectlyAnalyzer : DiagnosticAnalyzer
MetaAnalyzers\CompilerExtensionStrictApiAnalyzer.cs (1)
18internal sealed class CompilerExtensionStrictApiAnalyzer : DiagnosticAnalyzer
MetaAnalyzers\CompilerExtensionTargetFrameworkAnalyzer.cs (1)
19internal sealed class CompilerExtensionTargetFrameworkAnalyzer : DiagnosticAnalyzer
MetaAnalyzers\DiagnosticAnalyzerAPIUsageAnalyzer.cs (1)
26public abstract class DiagnosticAnalyzerApiUsageAnalyzer<TTypeSyntax> : DiagnosticAnalyzer
MetaAnalyzers\DiagnosticAnalyzerCorrectnessAnalyzer.cs (1)
11public abstract partial class DiagnosticAnalyzerCorrectnessAnalyzer : DiagnosticAnalyzer
MetaAnalyzers\DiagnosticAnalyzerCorrectnessAnalyzer.DiagnosticAnalyzerSymbolAnalyzer.cs (1)
12public abstract partial class DiagnosticAnalyzerCorrectnessAnalyzer : DiagnosticAnalyzer
MetaAnalyzers\DiagnosticAnalyzerCorrectnessAnalyzer.SyntaxNodeWithinAnalyzerTypeCompilationAnalyzer.cs (1)
12public abstract partial class DiagnosticAnalyzerCorrectnessAnalyzer : DiagnosticAnalyzer
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer.cs (1)
46public sealed partial class DiagnosticDescriptorCreationAnalyzer : DiagnosticAnalyzer
MetaAnalyzers\DoNotUseCompilationGetSemanticModelAnalyzer.cs (1)
20public sealed class DoNotUseCompilationGetSemanticModelAnalyzer : DiagnosticAnalyzer
MetaAnalyzers\DoNotUseFileTypesForAnalyzersOrGenerators.cs (1)
15public sealed class DoNotUseFileTypesForAnalyzersOrGenerators : DiagnosticAnalyzer
MetaAnalyzers\PreferIsKindAnalyzer.cs (1)
20public sealed class PreferIsKindAnalyzer : DiagnosticAnalyzer
src\roslyn\src\RoslynAnalyzers\Microsoft.CodeAnalysis.BannedApiAnalyzers\Core\SymbolIsBannedAnalyzerBase.cs (1)
21public abstract class SymbolIsBannedAnalyzerBase<TSyntaxKind> : DiagnosticAnalyzer
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
18internal abstract class DoNotCatchGeneralUnlessRethrownAnalyzer : DiagnosticAnalyzer
UpgradeMSBuildWorkspaceAnalyzer.cs (1)
18public abstract class UpgradeMSBuildWorkspaceAnalyzer : DiagnosticAnalyzer
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
18internal abstract class DoNotCatchGeneralUnlessRethrownAnalyzer : DiagnosticAnalyzer
Microsoft.CodeAnalysis.CodeStyle (3)
src\roslyn\src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (1)
14internal abstract partial class AbstractBuiltInCodeStyleDiagnosticAnalyzer : DiagnosticAnalyzer, IBuiltInAnalyzer
src\roslyn\src\Analyzers\Core\Analyzers\AbstractCodeQualityDiagnosticAnalyzer.cs (1)
11internal abstract class AbstractCodeQualityDiagnosticAnalyzer : DiagnosticAnalyzer, IBuiltInAnalyzer
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
16: DiagnosticAnalyzer
Microsoft.CodeAnalysis.CSharp.Analyzers (1)
MetaAnalyzers\CSharpSemanticModelGetDeclaredSymbolAlwaysReturnsNullAnalyzer.cs (1)
19public sealed class CSharpSemanticModelGetDeclaredSymbolAlwaysReturnsNullAnalyzer : DiagnosticAnalyzer
Microsoft.CodeAnalysis.Features (4)
Diagnostics\Analyzers\UnboundIdentifiersDiagnosticAnalyzerBase.cs (1)
22internal abstract class UnboundIdentifiersDiagnosticAnalyzerBase<TLanguageKindEnum, TSimpleNameSyntax, TQualifiedNameSyntax, TIncompleteMemberSyntax> : DiagnosticAnalyzer, IBuiltInAnalyzer
src\roslyn\src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (1)
14internal abstract partial class AbstractBuiltInCodeStyleDiagnosticAnalyzer : DiagnosticAnalyzer, IBuiltInAnalyzer
src\roslyn\src\Analyzers\Core\Analyzers\AbstractCodeQualityDiagnosticAnalyzer.cs (1)
11internal abstract class AbstractCodeQualityDiagnosticAnalyzer : DiagnosticAnalyzer, IBuiltInAnalyzer
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
16: DiagnosticAnalyzer
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
18internal abstract class DoNotCatchGeneralUnlessRethrownAnalyzer : DiagnosticAnalyzer
Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers (2)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\BasicOverrideEqualsOnOverloadingOperatorEquals.vb (1)
19Inherits DiagnosticAnalyzer
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\BasicOverrideGetHashCodeOnOverridingEquals.vb (1)
19Inherits DiagnosticAnalyzer
Microsoft.CodeAnalysis.Workspaces (1)
Diagnostics\DocumentDiagnosticAnalyzer.cs (1)
15internal abstract class DocumentDiagnosticAnalyzer : DiagnosticAnalyzer
Microsoft.DotNet.CodeAnalysis (1)
Analyzers\BaseAnalyzer.cs (1)
10public abstract class BaseAnalyzer : DiagnosticAnalyzer
Microsoft.Interop.ComInterfaceGenerator (8)
Analyzers\AddGeneratedComClassAnalyzer.cs (1)
14public class AddGeneratedComClassAnalyzer : DiagnosticAnalyzer
Analyzers\ComClassGeneratorDiagnosticsAnalyzer.cs (1)
16public sealed class ComClassGeneratorDiagnosticsAnalyzer : DiagnosticAnalyzer
Analyzers\ComHostingDoesNotSupportGeneratedComInterfaceAnalyzer.cs (1)
15public class ComHostingDoesNotSupportGeneratedComInterfaceAnalyzer : DiagnosticAnalyzer
Analyzers\ComInterfaceGeneratorDiagnosticsAnalyzer.cs (1)
18public class ComInterfaceGeneratorDiagnosticsAnalyzer : DiagnosticAnalyzer
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (1)
18public class ConvertComImportToGeneratedComInterfaceAnalyzer : DiagnosticAnalyzer
Analyzers\GeneratedComInterfaceAttributeAnalyzer.cs (1)
18public class GeneratedComInterfaceAttributeAnalyzer : DiagnosticAnalyzer
Analyzers\RuntimeComApiUsageWithSourceGeneratedComAnalyzer.cs (1)
19public class RuntimeComApiUsageWithSourceGeneratedComAnalyzer : DiagnosticAnalyzer
Analyzers\VtableIndexStubDiagnosticsAnalyzer.cs (1)
15public class VtableIndexStubDiagnosticsAnalyzer : DiagnosticAnalyzer
Microsoft.Interop.JavaScript.JSImportGenerator (1)
Analyzers\JSImportExportDiagnosticsAnalyzer.cs (1)
17public abstract class JSInteropDiagnosticsAnalyzer : DiagnosticAnalyzer
Microsoft.Interop.LibraryImportGenerator (4)
Analyzers\ConvertToLibraryImportAnalyzer.cs (1)
19public class ConvertToLibraryImportAnalyzer : DiagnosticAnalyzer
Analyzers\CustomMarshallerAttributeAnalyzer.cs (1)
19public class CustomMarshallerAttributeAnalyzer : DiagnosticAnalyzer
Analyzers\LibraryImportDiagnosticsAnalyzer.cs (1)
22public class LibraryImportDiagnosticsAnalyzer : DiagnosticAnalyzer
Analyzers\NativeMarshallingAttributeAnalyzer.cs (1)
20public class NativeMarshallingAttributeAnalyzer : DiagnosticAnalyzer
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
DownlevelLibraryImportDiagnosticsAnalyzer.cs (1)
21public sealed class DownlevelLibraryImportDiagnosticsAnalyzer : DiagnosticAnalyzer
Microsoft.ML.CodeAnalyzer.Tests (1)
Code\RelaxTestNamingTest.cs (1)
104public class WarnForMissingAsyncSuffix : DiagnosticAnalyzer
Microsoft.ML.InternalCodeAnalyzer (9)
BaseTestClassAnalyzer.cs (1)
14public sealed class BaseTestClassAnalyzer : DiagnosticAnalyzer
BestFriendAnalyzer.cs (1)
15public sealed class BestFriendAnalyzer : DiagnosticAnalyzer
BestFriendOnPublicDeclarationsAnalyzer.cs (1)
14public sealed class BestFriendOnPublicDeclarationsAnalyzer : DiagnosticAnalyzer
ContractsCheckAnalyzer.cs (1)
15public sealed class ContractsCheckAnalyzer : DiagnosticAnalyzer
InstanceInitializerAnalyzer.cs (1)
15public sealed class InstanceInitializerAnalyzer : DiagnosticAnalyzer
NameAnalyzer.cs (1)
25public sealed class NameAnalyzer : DiagnosticAnalyzer
ParameterVariableNameAnalyzer.cs (1)
15public sealed class ParameterVariableNameAnalyzer : DiagnosticAnalyzer
SingleVariableDeclarationAnalyzer.cs (1)
15public sealed class SingleVariableDeclarationAnalyzer : DiagnosticAnalyzer
TypeParamNameAnalyzer.cs (1)
14public sealed class TypeParamNameAnalyzer : DiagnosticAnalyzer
PlatformDocAnalyzer (1)
PlatformDocAnalyzer.cs (1)
27public sealed class PlatformDocAnalyzer : DiagnosticAnalyzer
Roslyn.Diagnostics.Analyzers (15)
AbstractDoNotCopyValue.cs (1)
27public abstract class AbstractDoNotCopyValue : DiagnosticAnalyzer
DefaultableTypeShouldHaveDefaultableFieldsAnalyzer.cs (1)
24public class DefaultableTypeShouldHaveDefaultableFieldsAnalyzer : DiagnosticAnalyzer
DoNotCallGetTestAccessor.cs (1)
21public sealed class DoNotCallGetTestAccessor : DiagnosticAnalyzer
DoNotMixAttributesFromDifferentVersionsOfMEF.cs (1)
24public sealed class DoNotMixAttributesFromDifferentVersionsOfMEFAnalyzer : DiagnosticAnalyzer
ExportedPartsShouldHaveImportingConstructor.cs (1)
27public sealed class ExportedPartsShouldHaveImportingConstructor : DiagnosticAnalyzer
ImmutableArrayBoxingAnalyzer.cs (1)
23public class ImmutableArrayBoxingAnalyzer : DiagnosticAnalyzer
ImportingConstructorShouldBeObsolete.cs (1)
29public sealed class ImportingConstructorShouldBeObsolete : DiagnosticAnalyzer
IRemoteJsonServiceParameterAnalyzer.cs (1)
22public class IRemoteJsonServiceParameterAnalyzer : DiagnosticAnalyzer
PartsExportedWithMEFv2MustBeMarkedAsShared.cs (1)
22public sealed class PartsExportedWithMEFv2MustBeMarkedAsSharedAnalyzer : DiagnosticAnalyzer
PooledArrayBuilderAsRefAnalyzer.cs (1)
23public class PooledArrayBuilderAsRefAnalyzer : DiagnosticAnalyzer
SpecializedEnumerableCreationAnalyzer.cs (1)
27public abstract class SpecializedEnumerableCreationAnalyzer : DiagnosticAnalyzer
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
18internal abstract class DoNotCatchGeneralUnlessRethrownAnalyzer : DiagnosticAnalyzer
SymbolDeclaredEventMustBeGeneratedForSourceSymbols.cs (1)
28public abstract class SymbolDeclaredEventAnalyzer<TSyntaxKind> : DiagnosticAnalyzer
TemporaryArrayAsRefAnalyzer.cs (1)
21public class TemporaryArrayAsRefAnalyzer : DiagnosticAnalyzer
TestExportsShouldNotBeDiscoverable.cs (1)
27public sealed class TestExportsShouldNotBeDiscoverable : DiagnosticAnalyzer
Roslyn.Diagnostics.CSharp.Analyzers (4)
CSharpAvoidOptSuffixForNullableEnableCode.cs (1)
26public sealed class CSharpAvoidOptSuffixForNullableEnableCode : DiagnosticAnalyzer
CSharpDoNotCapturePrimaryContructorParameters.cs (1)
17public class DoNotCapturePrimaryConstructorParametersAnalyzer : DiagnosticAnalyzer
CSharpDoNotUseDebugAssertForInterpolatedStrings.cs (1)
18public sealed class CSharpDoNotUseDebugAssertForInterpolatedStrings : DiagnosticAnalyzer
PreferNullLiteral.cs (1)
20public sealed class PreferNullLiteral : DiagnosticAnalyzer
Roslyn.Diagnostics.VisualBasic.Analyzers (1)
BasicInvokeTheCorrectPropertyToEnsureCorrectUseSiteDiagnostics.vb (1)
16Inherits DiagnosticAnalyzer
System.Private.CoreLib.Generators (1)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (1)
25public class IntrinsicsInSystemPrivateCoreLibAnalyzer : DiagnosticAnalyzer
System.Text.RegularExpressions.Generator (1)
UpgradeToGeneratedRegexAnalyzer.cs (1)
23public sealed class UpgradeToGeneratedRegexAnalyzer : DiagnosticAnalyzer
System.Windows.Forms.Analyzers (1)
System\Windows\Forms\Analyzers\AppManifestAnalyzer.cs (1)
14internal partial class AppManifestAnalyzer : DiagnosticAnalyzer
System.Windows.Forms.Analyzers.CSharp (3)
System\Windows\Forms\CSharp\Analyzers\AvoidPassingTaskWithoutCancellationToken\AvoidPassingTaskWithoutCancellationTokenAnalyzer.cs (1)
14public class AvoidPassingTaskWithoutCancellationTokenAnalyzer : DiagnosticAnalyzer
System\Windows\Forms\CSharp\Analyzers\ImplementITypedDataObject\ImplementITypedDataObjectAnalyzer.cs (1)
14public sealed class ImplementITypedDataObjectAnalyzer : DiagnosticAnalyzer
System\Windows\Forms\CSharp\Analyzers\MissingPropertySerializationConfiguration\MissingPropertySerializationConfigurationAnalyzer.cs (1)
13public class MissingPropertySerializationConfigurationAnalyzer : DiagnosticAnalyzer
System.Windows.Forms.Analyzers.VisualBasic (3)
Analyzers\AvoidPassingTaskWithoutCancellationToken\AvoidPassingTaskWithoutCancellationTokenAnalyzer.vb (1)
14Inherits DiagnosticAnalyzer
Analyzers\ImplementITypedDataObject\ImplementITypedDataObjectInAdditionToIDataObjectAnalyzer.vb (1)
16Inherits DiagnosticAnalyzer
Analyzers\MissingPropertySerializationConfiguration\MissingPropertySerializationConfigurationDiagnosticAnalyzer.vb (1)
13Inherits DiagnosticAnalyzer
842 references to DiagnosticAnalyzer
Aspire.Hosting.Analyzers.Tests (2)
AnalyzerTest.cs (2)
16where TAnalyzer : DiagnosticAnalyzer, new() 20where TAnalyzer : DiagnosticAnalyzer, new()
CodeStyleConfigFileGenerator (1)
Program.cs (1)
59foreach (var analyzer in analyzers)
dotnet-format (18)
Analyzers\AnalyzerFormatter.cs (8)
145ImmutableDictionary<ProjectId, ImmutableArray<DiagnosticAnalyzer>> projectAnalyzers, 199ImmutableDictionary<ProjectId, ImmutableArray<DiagnosticAnalyzer>> projectAnalyzers, 285internal static async Task<ImmutableDictionary<ProjectId, ImmutableArray<DiagnosticAnalyzer>>> FilterAnalyzersAsync( 296var projectAnalyzers = ImmutableDictionary.CreateBuilder<ProjectId, ImmutableArray<DiagnosticAnalyzer>>(); 308projectAnalyzers.Add(projectId, ImmutableArray<DiagnosticAnalyzer>.Empty); 312var analyzers = ImmutableArray.CreateBuilder<DiagnosticAnalyzer>(); 317foreach (var analyzer in filteredAnalyzer) 361private static bool DoesAnalyzerSupportLanguage(DiagnosticAnalyzer analyzer, string language)
Analyzers\AnalyzerRunner.cs (2)
14DiagnosticAnalyzer analyzers, 25ImmutableArray<DiagnosticAnalyzer> analyzers,
Analyzers\AnalyzersAndFixers.cs (3)
12public ImmutableArray<DiagnosticAnalyzer> Analyzers { get; } 15public AnalyzersAndFixers(ImmutableArray<DiagnosticAnalyzer> analyzers, ImmutableArray<CodeFixProvider> fixers) 22out ImmutableArray<DiagnosticAnalyzer> analyzers,
Analyzers\CodeStyleInformationProvider.cs (1)
49var analyzers = ImmutableArray.CreateBuilder<DiagnosticAnalyzer>();
Analyzers\Extensions.cs (2)
33this DiagnosticAnalyzer analyzer, 77this DiagnosticAnalyzer analyzer,
Analyzers\Interfaces\IAnalyzerRunner.cs (2)
14DiagnosticAnalyzer analyzers, 24ImmutableArray<DiagnosticAnalyzer> analyzers,
GenerateDocumentationAndConfigFiles (5)
Program.cs (1)
287foreach (var analyzer in analyzers)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
32/// <param name="options">Options passed to a <see cref="DiagnosticAnalyzer"/>.</param>
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\DiagnosticAnalyzerCategory.cs (1)
19/// Note: an <see cref="DiagnosticAnalyzer"/> that uses this will not work properly if
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
26Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnostics,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticAnalyzerExtensions.cs (1)
15public static bool IsCompilerAnalyzer(this DiagnosticAnalyzer analyzer)
Microsoft.Analyzers.Extra.Tests (5)
Resources\RoslynTestUtils.cs (5)
235DiagnosticAnalyzer analyzer, 287DiagnosticAnalyzer analyzer, 405DiagnosticAnalyzer analyzer, 514ImmutableArray<DiagnosticAnalyzer> analyzers, 547private readonly ImmutableArray<DiagnosticAnalyzer> _analyzers;
Microsoft.Analyzers.Local.Tests (5)
Resources\RoslynTestUtils.cs (5)
235DiagnosticAnalyzer analyzer, 288DiagnosticAnalyzer analyzer, 406DiagnosticAnalyzer analyzer, 515ImmutableArray<DiagnosticAnalyzer> analyzers, 548private readonly ImmutableArray<DiagnosticAnalyzer> _analyzers;
Microsoft.CodeAnalysis (521)
CommandLine\CommandLineArguments.cs (4)
190/// Skip execution of <see cref="DiagnosticAnalyzer"/>s. 488out ImmutableArray<DiagnosticAnalyzer> analyzers, 491var analyzerBuilder = ImmutableArray.CreateBuilder<DiagnosticAnalyzer>(); 573bool shouldIncludeAnalyzer(DiagnosticAnalyzer analyzer) => !skipAnalyzers || analyzer is DiagnosticSuppressor;
CommandLine\CommonCompiler.cs (5)
122out ImmutableArray<DiagnosticAnalyzer> analyzers, 1102ImmutableArray<DiagnosticAnalyzer> analyzers, 1772ImmutableArray<DiagnosticAnalyzer> analyzers, 1789ImmutableArray<DiagnosticAnalyzer> analyzers, 1801ImmutableArray<DiagnosticAnalyzer> analyzers,
CommandLine\ReportAnalyzerUtil.cs (2)
106private static IEnumerable<string> GetSupportedIds(DiagnosticAnalyzer analyzer) 140foreach (var analyzer in group.OrderBy(a => a.GetType().FullName, StringComparer.OrdinalIgnoreCase))
Compilation\Compilation.cs (3)
127internal abstract AnalyzerDriver CreateAnalyzerDriver(ImmutableArray<DiagnosticAnalyzer> analyzers, AnalyzerManager analyzerManager, SeverityFilter severityFilter); 202ImmutableArray<DiagnosticAnalyzer> analyzers = default, 227ImmutableArray<DiagnosticAnalyzer> analyzers = default,
Compilation\DeterministicKey.cs (1)
57ImmutableArray<DiagnosticAnalyzer> analyzers = default,
Compilation\DeterministicKeyBuilder.cs (2)
127ImmutableArray<DiagnosticAnalyzer> analyzers, 185foreach (var analyzer in analyzers)
Diagnostic\WellKnownDiagnosticTags.cs (1)
60/// Indicates that the diagnostic is related to an exception thrown by a <see cref="DiagnosticAnalyzer"/>.
DiagnosticAnalyzer\AnalysisResult.cs (20)
23ImmutableArray<DiagnosticAnalyzer> analyzers, 24ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSyntaxDiagnostics, 25ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSemanticDiagnostics, 26ImmutableDictionary<AdditionalText, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localAdditionalFileDiagnostics, 27ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> nonLocalDiagnostics, 28ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo> analyzerTelemetryInfo) 41public ImmutableArray<DiagnosticAnalyzer> Analyzers { get; } 46public ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> SyntaxDiagnostics { get; } 51public ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> SemanticDiagnostics { get; } 56public ImmutableDictionary<AdditionalText, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> AdditionalFileDiagnostics { get; } 61public ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> CompilationDiagnostics { get; } 66public ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo> AnalyzerTelemetryInfo { get; } 71public ImmutableArray<Diagnostic> GetAllDiagnostics(DiagnosticAnalyzer analyzer) 89private ImmutableArray<Diagnostic> GetDiagnostics(IEnumerable<DiagnosticAnalyzer> analyzers) 92var excludedAnalyzersSet = excludedAnalyzers.Any() ? excludedAnalyzers.ToImmutableHashSet() : ImmutableHashSet<DiagnosticAnalyzer>.Empty; 96private ImmutableArray<Diagnostic> GetDiagnostics(ImmutableHashSet<DiagnosticAnalyzer> excludedAnalyzers) 113ImmutableDictionary<T, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localDiagnostics, 114ImmutableHashSet<DiagnosticAnalyzer> excludedAnalyzers, 133ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> nonLocalDiagnostics, 134ImmutableHashSet<DiagnosticAnalyzer> excludedAnalyzers,
DiagnosticAnalyzer\AnalysisResultBuilder.cs (65)
29private readonly Dictionary<DiagnosticAnalyzer, TimeSpan>? _analyzerExecutionTimeOpt; 30private readonly HashSet<DiagnosticAnalyzer> _completedAnalyzersForCompilation; 31private readonly Dictionary<SyntaxTree, HashSet<DiagnosticAnalyzer>> _completedSyntaxAnalyzersByTree; 32private readonly Dictionary<SyntaxTree, HashSet<DiagnosticAnalyzer>> _completedSemanticAnalyzersByTree; 33private readonly Dictionary<AdditionalText, HashSet<DiagnosticAnalyzer>> _completedSyntaxAnalyzersByAdditionalFile; 34private readonly Dictionary<DiagnosticAnalyzer, AnalyzerActionCounts> _analyzerActionCounts; 37private Dictionary<SyntaxTree, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? _localSemanticDiagnosticsOpt = null; 38private Dictionary<SyntaxTree, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? _localSyntaxDiagnosticsOpt = null; 39private Dictionary<AdditionalText, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? _localAdditionalFileDiagnosticsOpt = null; 40private Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>? _nonLocalDiagnosticsOpt = null; 42internal AnalysisResultBuilder(bool logAnalyzerExecutionTime, ImmutableArray<DiagnosticAnalyzer> analyzers, ImmutableArray<AdditionalText> additionalFiles) 45_completedAnalyzersForCompilation = new HashSet<DiagnosticAnalyzer>(); 46_completedSyntaxAnalyzersByTree = new Dictionary<SyntaxTree, HashSet<DiagnosticAnalyzer>>(); 47_completedSemanticAnalyzersByTree = new Dictionary<SyntaxTree, HashSet<DiagnosticAnalyzer>>(); 48_completedSyntaxAnalyzersByAdditionalFile = new Dictionary<AdditionalText, HashSet<DiagnosticAnalyzer>>(); 49_analyzerActionCounts = new Dictionary<DiagnosticAnalyzer, AnalyzerActionCounts>(analyzers.Length); 53private static Dictionary<DiagnosticAnalyzer, TimeSpan> CreateAnalyzerExecutionTimeMap(ImmutableArray<DiagnosticAnalyzer> analyzers) 55var map = new Dictionary<DiagnosticAnalyzer, TimeSpan>(analyzers.Length); 56foreach (var analyzer in analyzers) 95public TimeSpan GetAnalyzerExecutionTime(DiagnosticAnalyzer analyzer) 105private HashSet<DiagnosticAnalyzer>? GetCompletedAnalyzersForFile_NoLock(SourceOrAdditionalFile filterFile, bool syntax) 130private void AddCompletedAnalyzerForFile_NoLock(SourceOrAdditionalFile filterFile, bool syntax, DiagnosticAnalyzer analyzer) 132var completedAnalyzers = new HashSet<DiagnosticAnalyzer> { analyzer }; 160public ImmutableArray<DiagnosticAnalyzer> GetPendingAnalyzers(ImmutableArray<DiagnosticAnalyzer> analyzers, (SourceOrAdditionalFile file, bool syntax)? filterScope) 188public void ApplySuppressionsAndStoreAnalysisResult(AnalysisScope analysisScope, AnalyzerDriver driver, Compilation compilation, Func<DiagnosticAnalyzer, AnalyzerActionCounts> getAnalyzerActionCounts, CancellationToken cancellationToken) 190foreach (var analyzer in analysisScope.Analyzers) 328DiagnosticAnalyzer analyzer, 332ref Dictionary<TKey, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? lazyLocalDiagnostics) 340lazyLocalDiagnostics = lazyLocalDiagnostics ?? new Dictionary<TKey, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>(); 350Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>? allDiagnostics; 353allDiagnostics = new Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>(); 368private void UpdateNonLocalDiagnostics_NoLock(DiagnosticAnalyzer analyzer, ImmutableArray<Diagnostic> diagnostics, bool overwrite) 375_nonLocalDiagnosticsOpt = _nonLocalDiagnosticsOpt ?? new Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>(); 443Dictionary<TKey, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? lazyLocalDiagnostics, 458Dictionary<SyntaxTree, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? localDiagnostics, 464Dictionary<AdditionalText, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? localDiagnostics, 470Dictionary<TKey, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? localDiagnostics, 472ImmutableArray<DiagnosticAnalyzer> analyzers, 476Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>? diagnosticsForTree; 484Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder> diagnostics, 485ImmutableArray<DiagnosticAnalyzer> analyzers, 490foreach (var analyzer in analyzers) 500internal AnalysisResult ToAnalysisResult(ImmutableArray<DiagnosticAnalyzer> analyzers, AnalysisScope analysisScope, CancellationToken cancellationToken) 504ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSyntaxDiagnostics; 505ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSemanticDiagnostics; 506ImmutableDictionary<AdditionalText, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localAdditionalFileDiagnostics; 507ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> nonLocalDiagnostics; 509var analyzersSet = PooledHashSet<DiagnosticAnalyzer>.GetInstance(); 533private static ImmutableDictionary<TKey, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> GetImmutable<TKey>( 534HashSet<DiagnosticAnalyzer> analyzers, // Will not be modified 536Dictionary<TKey, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? localDiagnosticsOpt) 541return ImmutableDictionary<TKey, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>>.Empty; 544var builder = ImmutableDictionary.CreateBuilder<TKey, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>>(); 545var perTreeBuilder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>(); 575private static ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> GetImmutable( 576HashSet<DiagnosticAnalyzer> analyzers, 578Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>? nonLocalDiagnosticsOpt) 582return ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>.Empty; 585var builder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>(); 601private ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo> GetTelemetryInfo( 602ImmutableArray<DiagnosticAnalyzer> analyzers) 604var builder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, AnalyzerTelemetryInfo>(); 608foreach (var analyzer in analyzers)
DiagnosticAnalyzer\AnalysisScope.cs (15)
23private readonly Lazy<ImmutableHashSet<DiagnosticAnalyzer>> _lazyAnalyzersSet; 50public ImmutableArray<DiagnosticAnalyzer> Analyzers { get; } 77/// This flag is used to improve the performance for <see cref="Contains(DiagnosticAnalyzer)"/> check for 96public static AnalysisScope Create(Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, CompilationWithAnalyzers compilationWithAnalyzers) 104public static AnalysisScope CreateForBatchCompile(Compilation compilation, ImmutableArray<AdditionalText> additionalFiles, ImmutableArray<DiagnosticAnalyzer> analyzers) 109private static AnalysisScope Create(Compilation compilation, ImmutableArray<AdditionalText> additionalFiles, ImmutableArray<DiagnosticAnalyzer> analyzers, bool hasAllAnalyzers, bool concurrentAnalysis) 117public static AnalysisScope Create(ImmutableArray<DiagnosticAnalyzer> analyzers, SourceOrAdditionalFile filterFile, TextSpan? filterSpan, bool isSyntacticSingleFileAnalysis, CompilationWithAnalyzers compilationWithAnalyzers) 120public static AnalysisScope Create(ImmutableArray<DiagnosticAnalyzer> analyzers, SourceOrAdditionalFile filterFile, TextSpan? filterSpan, SourceOrAdditionalFile originalFilterFile, TextSpan? originalFilterSpan, bool isSyntacticSingleFileAnalysis, CompilationWithAnalyzers compilationWithAnalyzers) 132ImmutableArray<DiagnosticAnalyzer> analyzers, 154_lazyAnalyzersSet = new Lazy<ImmutableHashSet<DiagnosticAnalyzer>>(CreateAnalyzersSet); 178private ImmutableHashSet<DiagnosticAnalyzer> CreateAnalyzersSet() => Analyzers.ToImmutableHashSet(); 180public bool Contains(DiagnosticAnalyzer analyzer) 191public AnalysisScope WithAnalyzers(ImmutableArray<DiagnosticAnalyzer> analyzers, CompilationWithAnalyzers compilationWithAnalyzers) 197private static bool ComputeHasAllAnalyzers(ImmutableArray<DiagnosticAnalyzer> analyzers, CompilationWithAnalyzers compilationWithAnalyzers) 200foreach (var analyzer in analyzers)
DiagnosticAnalyzer\AnalyzerDriver.cs (124)
35private static readonly Func<DiagnosticAnalyzer, bool> s_IsCompilerAnalyzerFunc = IsCompilerAnalyzer; 41private static readonly ObjectPool<ArrayBuilder<DiagnosticAnalyzer>> s_diagnosticAnalyzerPool = new ObjectPool<ArrayBuilder<DiagnosticAnalyzer>>(() => new ArrayBuilder<DiagnosticAnalyzer>()); 67protected ImmutableArray<DiagnosticAnalyzer> Analyzers { get; } 97private ImmutableHashSet<DiagnosticAnalyzer>? _lazyUnsuppressedAnalyzers; 102protected ImmutableHashSet<DiagnosticAnalyzer> UnsuppressedAnalyzers 111private ConcurrentDictionary<(INamespaceOrTypeSymbol, DiagnosticAnalyzer), IGroupedAnalyzerActions>? _lazyPerSymbolAnalyzerActionsCache; 119private ConcurrentDictionary<(INamespaceOrTypeSymbol, DiagnosticAnalyzer), IGroupedAnalyzerActions> PerSymbolAnalyzerActionsCache 128private ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<ImmutableArray<SymbolAnalyzerAction>>)> _lazySymbolActionsByKind; 129private ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<SemanticModelAnalyzerAction>)> _lazySemanticModelActions; 130private ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<SyntaxTreeAnalyzerAction>)> _lazySyntaxTreeActions; 131private ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<AdditionalFileAnalyzerAction>)> _lazyAdditionalFileActions; 134private ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<CompilationAnalyzerAction>)> _lazyCompilationActions; 135private ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<CompilationAnalyzerAction>)> _lazyCompilationEndActions; 137private ImmutableHashSet<DiagnosticAnalyzer>? _lazyCompilationEndAnalyzers; 138private ImmutableHashSet<DiagnosticAnalyzer> CompilationEndAnalyzers 159private ImmutableSegmentedDictionary<DiagnosticAnalyzer, SemaphoreSlim> _lazyAnalyzerGateMap; 160private ImmutableSegmentedDictionary<DiagnosticAnalyzer, SemaphoreSlim> AnalyzerGateMap 169private ImmutableSegmentedDictionary<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags> _lazyGeneratedCodeAnalysisFlagsMap; 174private ImmutableSegmentedDictionary<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags> GeneratedCodeAnalysisFlagsMap 189private ImmutableHashSet<DiagnosticAnalyzer>? _lazyNonConfigurableAndCustomConfigurableAnalyzers; 194private ImmutableHashSet<DiagnosticAnalyzer> NonConfigurableAndCustomConfigurableAnalyzers 203private ImmutableHashSet<DiagnosticAnalyzer>? _lazySymbolStartAnalyzers; 208private ImmutableHashSet<DiagnosticAnalyzer> SymbolStartAnalyzers 264private ConcurrentDictionary<SyntaxTree, ImmutableHashSet<DiagnosticAnalyzer>>? _lazySuppressedAnalyzersForTreeMap; 269private ConcurrentDictionary<SyntaxTree, ImmutableHashSet<DiagnosticAnalyzer>> SuppressedAnalyzersForTreeMap 374protected AnalyzerDriver(ImmutableArray<DiagnosticAnalyzer> analyzers, AnalyzerManager analyzerManager, SeverityFilter severityFilter, Func<SyntaxTrivia, bool> isComment) 386_lazyAnalyzerGateMap = ImmutableSegmentedDictionary<DiagnosticAnalyzer, SemaphoreSlim>.Empty; 425_lazySuppressedAnalyzersForTreeMap = new ConcurrentDictionary<SyntaxTree, ImmutableHashSet<DiagnosticAnalyzer>>(); 438_lazyPerSymbolAnalyzerActionsCache = new ConcurrentDictionary<(INamespaceOrTypeSymbol, DiagnosticAnalyzer), IGroupedAnalyzerActions>(); 480Action<Diagnostic, DiagnosticAnalyzer, AnalyzerOptions, bool, CancellationToken>? addCategorizedLocalDiagnostic = null; 481Action<Diagnostic, DiagnosticAnalyzer, AnalyzerOptions, CancellationToken>? addCategorizedNonLocalDiagnostic = null; 495var newOnAnalyzerException = (Exception ex, DiagnosticAnalyzer analyzer, Diagnostic diagnostic, CancellationToken cancellationToken) => 529private SemaphoreSlim? GetAnalyzerGate(DiagnosticAnalyzer analyzer) 541private ImmutableHashSet<DiagnosticAnalyzer> ComputeNonConfigurableAndCustomConfigurableAnalyzers(ImmutableHashSet<DiagnosticAnalyzer> unsuppressedAnalyzers, CancellationToken cancellationToken) 543var builder = ImmutableHashSet.CreateBuilder<DiagnosticAnalyzer>(); 544foreach (var analyzer in unsuppressedAnalyzers) 560private ImmutableHashSet<DiagnosticAnalyzer> ComputeSymbolStartAnalyzers(ImmutableHashSet<DiagnosticAnalyzer> unsuppressedAnalyzers) 562var builder = ImmutableHashSet.CreateBuilder<DiagnosticAnalyzer>(); 575ImmutableHashSet<DiagnosticAnalyzer> analyzers, 576ImmutableSegmentedDictionary<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags> generatedCodeAnalysisFlagsMap, 579foreach (var analyzer in analyzers) 593private static bool ComputeShouldTreatAllCodeAsNonGeneratedCode(ImmutableHashSet<DiagnosticAnalyzer> analyzers, ImmutableSegmentedDictionary<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags> generatedCodeAnalysisFlagsMap) 595foreach (var analyzer in analyzers) 609private bool ShouldSkipAnalysisOnGeneratedCode(DiagnosticAnalyzer analyzer) 613DiagnosticAnalyzer analyzer, 614ImmutableSegmentedDictionary<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags> generatedCodeAnalysisFlagsMap, 626private bool ShouldSuppressGeneratedCodeDiagnostic(Diagnostic diagnostic, DiagnosticAnalyzer analyzer, Compilation compilation, CancellationToken cancellationToken) 726private static void OnDriverException(Task faultedTask, AnalyzerExecutor analyzerExecutor, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 740var analyzer = analyzers[0]; 824ImmutableArray<DiagnosticAnalyzer> analyzers, 834Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = 844ImmutableArray<DiagnosticAnalyzer> analyzers, 847Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException, 912foreach (var analyzer in Analyzers) 1189public ImmutableArray<Diagnostic> DequeueLocalDiagnosticsAndApplySuppressions(DiagnosticAnalyzer analyzer, bool syntax, Compilation compilation, CancellationToken cancellationToken) 1195public ImmutableArray<Diagnostic> DequeueNonLocalDiagnosticsAndApplySuppressions(DiagnosticAnalyzer analyzer, Compilation compilation, CancellationToken cancellationToken) 1365private bool IsAnalyzerSuppressedForTree(DiagnosticAnalyzer analyzer, SyntaxTree tree, SyntaxTreeOptionsProvider? options, CancellationToken cancellationToken) 1375private ImmutableHashSet<DiagnosticAnalyzer> ComputeSuppressedAnalyzersForTree(SyntaxTree tree, SyntaxTreeOptionsProvider? options, CancellationToken cancellationToken) 1379return ImmutableHashSet<DiagnosticAnalyzer>.Empty; 1382ImmutableHashSet<DiagnosticAnalyzer>.Builder? suppressedAnalyzersBuilder = null; 1383foreach (var analyzer in UnsuppressedAnalyzers) 1426suppressedAnalyzersBuilder ??= ImmutableHashSet.CreateBuilder<DiagnosticAnalyzer>(); 1431return suppressedAnalyzersBuilder != null ? suppressedAnalyzersBuilder.ToImmutable() : ImmutableHashSet<DiagnosticAnalyzer>.Empty; 1460internal ImmutableDictionary<DiagnosticAnalyzer, TimeSpan> AnalyzerExecutionTimes => AnalyzerExecutor.AnalyzerExecutionTimes; 1461internal TimeSpan ResetAnalyzerExecutionTime(DiagnosticAnalyzer analyzer) => AnalyzerExecutor.ResetAnalyzerExecutionTime(analyzer); 1466internal IReadOnlyCollection<DiagnosticAnalyzer> NonConcurrentAnalyzers => AnalyzerGateMap.Keys; 1468private static ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<ImmutableArray<SymbolAnalyzerAction>>)> MakeSymbolActionsByKind(in AnalyzerActions analyzerActions) 1470var builder = ArrayBuilder<(DiagnosticAnalyzer, ImmutableArray<ImmutableArray<SymbolAnalyzerAction>>)>.GetInstance(); 1499private static ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<TAnalyzerAction>)> MakeActionsByAnalyzer<TAnalyzerAction>(in ImmutableArray<TAnalyzerAction> analyzerActions) 1502var builder = ArrayBuilder<(DiagnosticAnalyzer, ImmutableArray<TAnalyzerAction>)>.GetInstance(); 1512private static ImmutableHashSet<DiagnosticAnalyzer> MakeCompilationEndAnalyzers(ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<CompilationAnalyzerAction>)> compilationEndActionsByAnalyzer) 1514var builder = ImmutableHashSet.CreateBuilder<DiagnosticAnalyzer>(); 1653ImmutableArray<DiagnosticAnalyzer> processedAnalyzers; 1671private async Task OnEventProcessedCoreAsync(CompilationEvent compilationEvent, ImmutableArray<DiagnosticAnalyzer> processedAnalyzers, AnalysisScope analysisScope, CancellationToken cancellationToken) 1678foreach (var analyzer in processedAnalyzers) 1700async Task onSymbolAndMembersProcessedAsync(ISymbol symbol, DiagnosticAnalyzer analyzer) 1718async Task processContainerOnMemberCompletedAsync(INamespaceOrTypeSymbol containerSymbol, ISymbol processedMemberSymbol, DiagnosticAnalyzer analyzer) 1830out ImmutableArray<DiagnosticAnalyzer> subsetProcessedAnalyzers) 1838subsetProcessedAnalyzers = ImmutableArray<DiagnosticAnalyzer>.Empty; 1843ArrayBuilder<DiagnosticAnalyzer> completedAnalyzers = s_diagnosticAnalyzerPool.Allocate(); 1844var processedAnalyzers = PooledHashSet<DiagnosticAnalyzer>.GetInstance(); 1849var analyzer = groupedActions.Key; 1871foreach (var analyzer in analysisScope.Analyzers) 1889subsetProcessedAnalyzers = ImmutableArray<DiagnosticAnalyzer>.Empty; 1959ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<CompilationAnalyzerAction>)> compilationActionsMap, 1989internal static Action<Diagnostic, DiagnosticAnalyzer, AnalyzerOptions, bool, CancellationToken> GetDiagnosticSink(Action<Diagnostic, DiagnosticAnalyzer, bool> addLocalDiagnosticCore, Compilation compilation, SeverityFilter severityFilter, ConcurrentSet<string>? suppressedDiagnosticIds) 2001internal static Action<Diagnostic, DiagnosticAnalyzer, AnalyzerOptions?, CancellationToken> GetDiagnosticSink(Action<Diagnostic, DiagnosticAnalyzer> addDiagnosticCore, Compilation compilation, SeverityFilter severityFilter, ConcurrentSet<string>? suppressedDiagnosticIds) 2043private static async Task<(AnalyzerActions actions, ImmutableHashSet<DiagnosticAnalyzer> unsuppressedAnalyzers)> GetAnalyzerActionsAsync( 2044ImmutableArray<DiagnosticAnalyzer> analyzers, 2052var unsuppressedAnalyzersBuilder = PooledHashSet<DiagnosticAnalyzer>.GetInstance(); 2053foreach (var analyzer in analyzers) 2086var analyzer = analysisScope.Analyzers[0]; 2099var symbolStartAnalyzers = PooledHashSet<DiagnosticAnalyzer>.GetInstance(); 2107foreach (var analyzer in analysisScope.Analyzers) 2137foreach (var analyzer in analysisScope.Analyzers) 2159DiagnosticAnalyzer analyzer, 2187async ValueTask<IGroupedAnalyzerActions> getAllActionsAsync(AnalyzerDriver driver, ISymbol symbol, DiagnosticAnalyzer analyzer, SyntaxTree? filterTree, TextSpan? filterSpan, CancellationToken cancellationToken) 2203async ValueTask<IGroupedAnalyzerActions> getInheritedActionsAsync(AnalyzerDriver driver, ISymbol symbol, DiagnosticAnalyzer analyzer, SyntaxTree? filterTree, TextSpan? filterSpan, CancellationToken cancellationToken) 2227static async ValueTask<AnalyzerActions> getSymbolActionsCoreAsync(AnalyzerDriver driver, ISymbol symbol, DiagnosticAnalyzer analyzer, SyntaxTree? filterTree, TextSpan? filterSpan, CancellationToken cancellationToken) 2244private static async Task<ImmutableSegmentedDictionary<DiagnosticAnalyzer, SemaphoreSlim>> CreateAnalyzerGateMapAsync( 2245ImmutableHashSet<DiagnosticAnalyzer> analyzers, 2252var builder = ImmutableSegmentedDictionary.CreateBuilder<DiagnosticAnalyzer, SemaphoreSlim>(); 2253foreach (var analyzer in analyzers) 2269private static async Task<ImmutableSegmentedDictionary<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags>> CreateGeneratedCodeAnalysisFlagsMapAsync( 2270ImmutableHashSet<DiagnosticAnalyzer> analyzers, 2277var builder = ImmutableSegmentedDictionary.CreateBuilder<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags>(); 2278foreach (var analyzer in analyzers) 2378internal async Task<AnalyzerActionCounts> GetAnalyzerActionCountsAsync(DiagnosticAnalyzer analyzer, CompilationOptions compilationOptions, AnalysisScope analysisScope, CancellationToken cancellationToken) 2398DiagnosticAnalyzer analyzer, 2409internal static bool IsCompilerAnalyzer(DiagnosticAnalyzer analyzer) => analyzer is CompilerDiagnosticAnalyzer; 2436internal AnalyzerDriver(ImmutableArray<DiagnosticAnalyzer> analyzers, Func<SyntaxNode, TLanguageKindEnum> getKind, AnalyzerManager analyzerManager, SeverityFilter severityFilter, Func<SyntaxTrivia, bool> isComment) 2508protected override IGroupedAnalyzerActions CreateGroupedActions(DiagnosticAnalyzer analyzer, in AnalyzerActions analyzerActions) 2639var analyzersForNodes = PooledHashSet<DiagnosticAnalyzer>.GetInstance(); 2644foreach (var analyzer in analyzersForKind) 2684DiagnosticAnalyzer analyzer, 2763var analyzer = this.Analyzers[0];
DiagnosticAnalyzer\AnalyzerDriver.EventProcessedState.cs (3)
25public ImmutableArray<DiagnosticAnalyzer> SubsetProcessedAnalyzers { get; } 33private EventProcessedState(ImmutableArray<DiagnosticAnalyzer> subsetProcessedAnalyzers) 39public static EventProcessedState CreatePartiallyProcessed(ImmutableArray<DiagnosticAnalyzer> subsetProcessedAnalyzers)
DiagnosticAnalyzer\AnalyzerDriver.ExecutableCodeBlockAnalyzerActions.cs (1)
15public DiagnosticAnalyzer Analyzer;
DiagnosticAnalyzer\AnalyzerDriver.GroupedAnalyzerActions.cs (13)
18/// <see cref="AnalyzerActions"/> grouped by <see cref="DiagnosticAnalyzer"/>, and possibly other entities, such as <see cref="OperationKind"/>, <see cref="SymbolKind"/>, etc. 23ImmutableArray<(DiagnosticAnalyzer, GroupedAnalyzerActionsForAnalyzer)>.Empty, 24ImmutableSegmentedDictionary<TLanguageKindEnum, ImmutableArray<DiagnosticAnalyzer>>.Empty, 28ImmutableArray<(DiagnosticAnalyzer, GroupedAnalyzerActionsForAnalyzer)> groupedActionsAndAnalyzers, 29ImmutableSegmentedDictionary<TLanguageKindEnum, ImmutableArray<DiagnosticAnalyzer>> analyzersByKind, 37public ImmutableArray<(DiagnosticAnalyzer analyzer, GroupedAnalyzerActionsForAnalyzer groupedActions)> GroupedActionsByAnalyzer { get; } 39public ImmutableSegmentedDictionary<TLanguageKindEnum, ImmutableArray<DiagnosticAnalyzer>> AnalyzersByKind { get; } 53public static GroupedAnalyzerActions Create(DiagnosticAnalyzer analyzer, in AnalyzerActions analyzerActions) 61var groupedActionsAndAnalyzers = ImmutableArray<(DiagnosticAnalyzer, GroupedAnalyzerActionsForAnalyzer)>.Empty.Add((analyzer, groupedActions)); 66public static GroupedAnalyzerActions Create(ImmutableArray<DiagnosticAnalyzer> analyzers, in AnalyzerActions analyzerActions) 94private static ImmutableSegmentedDictionary<TLanguageKindEnum, ImmutableArray<DiagnosticAnalyzer>> CreateAnalyzersByKind(ImmutableArray<(DiagnosticAnalyzer, GroupedAnalyzerActionsForAnalyzer)> groupedActionsAndAnalyzers) 96var analyzersByKind = PooledDictionary<TLanguageKindEnum, ArrayBuilder<DiagnosticAnalyzer>>.GetInstance();
DiagnosticAnalyzer\AnalyzerDriver.GroupedAnalyzerActionsForAnalyzer.cs (5)
16private readonly DiagnosticAnalyzer _analyzer; 28public GroupedAnalyzerActionsForAnalyzer(DiagnosticAnalyzer analyzer, in AnalyzerActions analyzerActions, bool analyzerActionsNeedFiltering) 40private static void VerifyActions<TAnalyzerAction>(ArrayBuilder<TAnalyzerAction> actions, DiagnosticAnalyzer analyzer) 59DiagnosticAnalyzer analyzer, 153DiagnosticAnalyzer analyzer,
DiagnosticAnalyzer\AnalyzerDriver.IGroupedAnalyzerActions.cs (1)
10protected abstract IGroupedAnalyzerActions CreateGroupedActions(DiagnosticAnalyzer analyzer, in AnalyzerActions analyzerActions);
DiagnosticAnalyzer\AnalyzerExecutor.AnalyzerDiagnosticReporter.cs (8)
31DiagnosticAnalyzer analyzer, 35Action<Diagnostic, DiagnosticAnalyzer, AnalyzerOptions, bool, CancellationToken>? addCategorizedLocalDiagnostic, 36Action<Diagnostic, DiagnosticAnalyzer, AnalyzerOptions, CancellationToken>? addCategorizedNonLocalDiagnostic, 37Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> shouldSuppressGeneratedCodeDiagnostic, 73private DiagnosticAnalyzer _analyzer; 77private Action<Diagnostic, DiagnosticAnalyzer, AnalyzerOptions, bool, CancellationToken>? _addCategorizedLocalDiagnostic; 78private Action<Diagnostic, DiagnosticAnalyzer, AnalyzerOptions, CancellationToken>? _addCategorizedNonLocalDiagnostic; 79private Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> _shouldSuppressGeneratedCodeDiagnostic;
DiagnosticAnalyzer\AnalyzerExecutor.cs (70)
35private readonly Action<Diagnostic, DiagnosticAnalyzer, AnalyzerOptions, bool, CancellationToken>? _addCategorizedLocalDiagnostic; 36private readonly Action<Diagnostic, DiagnosticAnalyzer, AnalyzerOptions, CancellationToken>? _addCategorizedNonLocalDiagnostic; 40private readonly Func<DiagnosticAnalyzer, bool> _isCompilerAnalyzer; 41private readonly Func<DiagnosticAnalyzer, object?> _getAnalyzerGate; 43private readonly Func<DiagnosticAnalyzer, bool> _shouldSkipAnalysisOnGeneratedCode; 44private readonly Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> _shouldSuppressGeneratedCodeDiagnostic; 46private readonly Func<DiagnosticAnalyzer, SyntaxTree, SyntaxTreeOptionsProvider?, CancellationToken, bool> _isAnalyzerSuppressedForTree; 51private readonly ConcurrentDictionary<DiagnosticAnalyzer, StrongBox<long>>? _analyzerExecutionTimeMap; 63private readonly Dictionary<DiagnosticAnalyzer, AnalyzerOptions>? _analyzerToCachedOptions; 72private bool IsAnalyzerSuppressedForTree(DiagnosticAnalyzer analyzer, SyntaxTree tree, CancellationToken cancellationToken) 117Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> onAnalyzerException, 119Func<DiagnosticAnalyzer, bool> isCompilerAnalyzer, 120ImmutableArray<DiagnosticAnalyzer> diagnosticAnalyzers, 121Func<DiagnosticAnalyzer, AnalyzerConfigOptionsProvider>? getAnalyzerConfigOptionsProvider, 123Func<DiagnosticAnalyzer, bool> shouldSkipAnalysisOnGeneratedCode, 124Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> shouldSuppressGeneratedCodeDiagnostic, 126Func<DiagnosticAnalyzer, SyntaxTree, SyntaxTreeOptionsProvider?, CancellationToken, bool> isAnalyzerSuppressedForTree, 127Func<DiagnosticAnalyzer, object?> getAnalyzerGate, 131Action<Diagnostic, DiagnosticAnalyzer, AnalyzerOptions, bool, CancellationToken>? addCategorizedLocalDiagnostic = null, 132Action<Diagnostic, DiagnosticAnalyzer, AnalyzerOptions, CancellationToken>? addCategorizedNonLocalDiagnostic = null, 139var analyzerExecutionTimeMap = logExecutionTime ? new ConcurrentDictionary<DiagnosticAnalyzer, StrongBox<long>>() : null; 151Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> onAnalyzerException, 153Func<DiagnosticAnalyzer, bool> isCompilerAnalyzer, 154ImmutableArray<DiagnosticAnalyzer> diagnosticAnalyzers, 155Func<DiagnosticAnalyzer, AnalyzerConfigOptionsProvider>? getAnalyzerConfigOptionsProvider, 157Func<DiagnosticAnalyzer, bool> shouldSkipAnalysisOnGeneratedCode, 158Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> shouldSuppressGeneratedCodeDiagnostic, 160Func<DiagnosticAnalyzer, SyntaxTree, SyntaxTreeOptionsProvider?, CancellationToken, bool> isAnalyzerSuppressedForTree, 161Func<DiagnosticAnalyzer, object?> getAnalyzerGate, 164ConcurrentDictionary<DiagnosticAnalyzer, StrongBox<long>>? analyzerExecutionTimeMap, 165Action<Diagnostic, DiagnosticAnalyzer, AnalyzerOptions, bool, CancellationToken>? addCategorizedLocalDiagnostic, 166Action<Diagnostic, DiagnosticAnalyzer, AnalyzerOptions, CancellationToken>? addCategorizedNonLocalDiagnostic, 194var map = new Dictionary<DiagnosticAnalyzer, AnalyzerOptions>( 203foreach (var analyzer in diagnosticAnalyzers) 227internal Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> OnAnalyzerException { get; } 229internal ImmutableDictionary<DiagnosticAnalyzer, TimeSpan> AnalyzerExecutionTimes 239/// Executes the <see cref="DiagnosticAnalyzer.Initialize(AnalysisContext)"/> for the given analyzer. 292DiagnosticAnalyzer analyzer, 305private AnalyzerOptions GetAnalyzerSpecificOptions(DiagnosticAnalyzer analyzer) 399DiagnosticAnalyzer analyzer, 442DiagnosticAnalyzer analyzer, 512DiagnosticAnalyzer analyzer, 548DiagnosticAnalyzer analyzer, 565DiagnosticAnalyzer analyzer, 626DiagnosticAnalyzer analyzer, 677DiagnosticAnalyzer analyzer, 730DiagnosticAnalyzer analyzer, 816DiagnosticAnalyzer analyzer, 823public readonly DiagnosticAnalyzer Analyzer = analyzer; 838DiagnosticAnalyzer analyzer, 942DiagnosticAnalyzer analyzer, 1104DiagnosticAnalyzer analyzer, 1207DiagnosticAnalyzer analyzer, 1299internal void ExecuteAndCatchIfThrows<TArg>(DiagnosticAnalyzer analyzer, Action<TArg> analyze, TArg argument, AnalysisContextInfo? contextInfo, CancellationToken cancellationToken) 1333private void ExecuteAndCatchIfThrows_NoLock<TArg>(DiagnosticAnalyzer analyzer, Action<TArg> analyze, TArg argument, AnalysisContextInfo? info, CancellationToken cancellationToken) 1346private bool HandleAnalyzerException(DiagnosticAnalyzer analyzer, Exception ex, in AnalysisContextInfo? info) 1360DiagnosticAnalyzer analyzer, 1362Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> onAnalyzerException, 1400internal static Diagnostic CreateAnalyzerExceptionDiagnostic(DiagnosticAnalyzer analyzer, Exception e, AnalysisContextInfo? info = null) 1422private static string CreateDisablingMessage(DiagnosticAnalyzer analyzer, string analyzerName) 1514private bool IsSupportedDiagnostic(DiagnosticAnalyzer analyzer, Diagnostic diagnostic, CancellationToken cancellationToken) 1528DiagnosticAnalyzer analyzer, 1569DiagnosticAnalyzer analyzer, 1593DiagnosticAnalyzer analyzer, 1606DiagnosticAnalyzer analyzer, 1618DiagnosticAnalyzer analyzer, 1628private bool ShouldExecuteNode(SyntaxNode node, DiagnosticAnalyzer analyzer, CancellationToken cancellationToken) 1640private bool ShouldExecuteOperation(IOperation operation, DiagnosticAnalyzer analyzer, CancellationToken cancellationToken) 1652internal TimeSpan ResetAnalyzerExecutionTime(DiagnosticAnalyzer analyzer) 1675private bool IsAnalyzerSuppressedForSymbol(DiagnosticAnalyzer analyzer, ISymbol symbol, CancellationToken cancellationToken)
DiagnosticAnalyzer\AnalyzerFileReference.cs (6)
39private readonly Extensions<DiagnosticAnalyzer> _diagnosticAnalyzers; 112public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzersForAllLanguages() 119public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzers(string language) 188/// Adds the <see cref="ImmutableArray{T}"/> of <see cref="DiagnosticAnalyzer"/> defined in this assembly reference of given <paramref name="language"/>. 190internal void AddAnalyzers(ImmutableArray<DiagnosticAnalyzer>.Builder builder, string language, Func<DiagnosticAnalyzer, bool>? shouldInclude = null)
DiagnosticAnalyzer\AnalyzerImageReference.cs (4)
19private readonly ImmutableArray<DiagnosticAnalyzer> _analyzers; 24public AnalyzerImageReference(ImmutableArray<DiagnosticAnalyzer> analyzers, string? fullPath = null, string? display = null) 37public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzersForAllLanguages() 42public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzers(string language)
DiagnosticAnalyzer\AnalyzerManager.AnalyzerExecutionContext.cs (9)
27private readonly DiagnosticAnalyzer _analyzer; 66public AnalyzerExecutionContext(DiagnosticAnalyzer analyzer) 249public ImmutableArray<DiagnosticDescriptor> GetOrComputeDiagnosticDescriptors(DiagnosticAnalyzer analyzer, AnalyzerExecutor analyzerExecutor, CancellationToken cancellationToken) 257Func<DiagnosticAnalyzer, AnalyzerExecutor, CancellationToken, ImmutableArray<TDescriptor>> computeDescriptorsNoLock, 258DiagnosticAnalyzer analyzer, 285/// Compute <see cref="DiagnosticAnalyzer.SupportedDiagnostics"/> and exception handler for the given <paramref name="analyzer"/>. 288DiagnosticAnalyzer analyzer, 307throw new ArgumentException(string.Format(CodeAnalysisResources.SupportedDiagnosticsHasNullDescriptor, analyzer.ToString()), nameof(DiagnosticAnalyzer.SupportedDiagnostics)); 366DiagnosticAnalyzer analyzer,
DiagnosticAnalyzer\AnalyzerManager.cs (31)
23/// 1) <see cref="DiagnosticAnalyzer.Initialize(AnalysisContext)"/> is invoked only once per-analyzer. 24/// 2) <see cref="DiagnosticAnalyzer.SupportedDiagnostics"/> is invoked only once per-analyzer. 31private readonly Dictionary<DiagnosticAnalyzer, AnalyzerExecutionContext> _analyzerExecutionContextMap; 33public AnalyzerManager(ImmutableArray<DiagnosticAnalyzer> analyzers) 38public AnalyzerManager(DiagnosticAnalyzer analyzer) 43private Dictionary<DiagnosticAnalyzer, AnalyzerExecutionContext> CreateAnalyzerExecutionContextMap(IEnumerable<DiagnosticAnalyzer> analyzers) 45var analyzerExecutionContextMap = new Dictionary<DiagnosticAnalyzer, AnalyzerExecutionContext>(); 46foreach (var analyzer in analyzers) 54private AnalyzerExecutionContext GetAnalyzerExecutionContext(DiagnosticAnalyzer analyzer) => _analyzerExecutionContextMap[analyzer]; 97DiagnosticAnalyzer analyzer, 133DiagnosticAnalyzer analyzer, 165/// The returned actions include the actions registered during <see cref="DiagnosticAnalyzer.Initialize(AnalysisContext)"/> method as well as 169public async ValueTask<AnalyzerActions> GetAnalyzerActionsAsync(DiagnosticAnalyzer analyzer, AnalyzerExecutor analyzerExecutor, CancellationToken cancellationToken) 191DiagnosticAnalyzer analyzer, 234public async Task<bool> IsConcurrentAnalyzerAsync(DiagnosticAnalyzer analyzer, AnalyzerExecutor analyzerExecutor, CancellationToken cancellationToken) 244public async Task<GeneratedCodeAnalysisFlags> GetGeneratedCodeAnalysisFlagsAsync(DiagnosticAnalyzer analyzer, AnalyzerExecutor analyzerExecutor, CancellationToken cancellationToken) 251/// Return <see cref="DiagnosticAnalyzer.SupportedDiagnostics"/> of given <paramref name="analyzer"/>. 254DiagnosticAnalyzer analyzer, 274internal bool IsSupportedDiagnostic(DiagnosticAnalyzer analyzer, Diagnostic diagnostic, Func<DiagnosticAnalyzer, bool> isCompilerAnalyzer, AnalyzerExecutor analyzerExecutor, CancellationToken cancellationToken) 300DiagnosticAnalyzer analyzer, 302Func<DiagnosticAnalyzer, bool> isCompilerAnalyzer, 308Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnosticDescriptors = 342DiagnosticAnalyzer analyzer, 344Func<DiagnosticAnalyzer, bool> isCompilerAnalyzer, 347Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnosticDescriptors, 468DiagnosticAnalyzer analyzer, 474public bool TryStartExecuteSymbolEndActions(ImmutableArray<SymbolEndAnalyzerAction> symbolEndActions, DiagnosticAnalyzer analyzer, SymbolDeclaredCompilationEvent symbolDeclaredEvent) 481DiagnosticAnalyzer analyzer, 488public void MarkSymbolEndAnalysisComplete(ISymbol symbol, DiagnosticAnalyzer analyzer)
DiagnosticAnalyzer\AnalyzerOptions.cs (3)
13/// Options passed to <see cref="DiagnosticAnalyzer"/>. 30/// Creates analyzer options to be passed to <see cref="DiagnosticAnalyzer"/>. 46/// Creates analyzer options to be passed to <see cref="DiagnosticAnalyzer"/>.
DiagnosticAnalyzer\AnalyzerReference.cs (2)
56public abstract ImmutableArray<DiagnosticAnalyzer> GetAnalyzersForAllLanguages(); 62public abstract ImmutableArray<DiagnosticAnalyzer> GetAnalyzers(string language);
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (52)
28private readonly ImmutableArray<DiagnosticAnalyzer> _analyzers; 54public ImmutableArray<DiagnosticAnalyzer> Analyzers => _analyzers; 69/// <inheritdoc cref="CompilationWithAnalyzers(Compilation, ImmutableArray{DiagnosticAnalyzer}, AnalyzerOptions?)"/> 72public CompilationWithAnalyzers(Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, AnalyzerOptions? options, CancellationToken cancellationToken) 83public CompilationWithAnalyzers(Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, AnalyzerOptions? options) 94public CompilationWithAnalyzers(Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, CompilationWithAnalyzersOptions analysisOptions) 113private static void VerifyArguments(Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, CompilationWithAnalyzersOptions analysisOptions) 128private static void VerifyAnalyzersArgumentForStaticApis(ImmutableArray<DiagnosticAnalyzer> analyzers) 147private void VerifyAnalyzerArgument(DiagnosticAnalyzer analyzer) 157private static void VerifyAnalyzerArgumentForStaticApis(DiagnosticAnalyzer analyzer) 165private void VerifyExistingAnalyzersArgument(ImmutableArray<DiagnosticAnalyzer> analyzers) 248public async Task<ImmutableArray<Diagnostic>> GetAnalyzerDiagnosticsAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 268public async Task<AnalysisResult> GetAnalysisResultAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 297async Task<ImmutableArray<Diagnostic>> getAllDiagnosticsWithoutStateTrackingAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 330public async Task<ImmutableArray<Diagnostic>> GetAnalyzerCompilationDiagnosticsAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 337private async Task<ImmutableArray<Diagnostic>> GetAnalyzerCompilationDiagnosticsCoreAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 344private async Task<AnalysisResult> GetAnalysisResultCoreAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 351private async Task<ImmutableArray<Diagnostic>> GetAnalyzerDiagnosticsCoreAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 422public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsAsync(SyntaxTree tree, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 440public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsAsync(SyntaxTree tree, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 483public Task<AnalysisResult> GetAnalysisResultAsync(SyntaxTree tree, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 500public Task<AnalysisResult> GetAnalysisResultAsync(SyntaxTree tree, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 530public async Task<AnalysisResult> GetAnalysisResultAsync(AdditionalText file, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 564public async Task<AnalysisResult> GetAnalysisResultAsync(AdditionalText file, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 572private async Task<AnalysisResult> GetAnalysisResultCoreAsync(SourceOrAdditionalFile file, ImmutableArray<DiagnosticAnalyzer> analyzers, TextSpan? filterSpan, CancellationToken cancellationToken) 579private async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsCoreAsync(SyntaxTree tree, ImmutableArray<DiagnosticAnalyzer> analyzers, TextSpan? filterSpan, CancellationToken cancellationToken) 608public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSemanticDiagnosticsAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 638public Task<AnalysisResult> GetAnalysisResultAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 646private async Task<AnalysisResult> GetAnalysisResultCoreAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 653private async Task<ImmutableArray<Diagnostic>> GetAnalyzerSemanticDiagnosticsCoreAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 732Func<DiagnosticAnalyzer, AnalyzerActionCounts> getAnalyzerActionCounts = analyzer => analyzerActionCounts[analyzer]; 827static async Task<(ImmutableDictionary<DiagnosticAnalyzer, AnalyzerActionCounts> analyzerActionCounts, bool hasAnyActionsRequiringCompilationEvents)> getAnalyzerActionCountsAsync( 836var builder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, AnalyzerActionCounts>(); 838foreach (var analyzer in analysisScope.Analyzers) 850static (ImmutableArray<DiagnosticAnalyzer> symbolStartAnalyzers, ImmutableArray<DiagnosticAnalyzer> otherAnalyzers) getSymbolStartAnalyzers( 851ImmutableArray<DiagnosticAnalyzer> analyzers, 852ImmutableDictionary<DiagnosticAnalyzer, AnalyzerActionCounts> analyzerActionCounts) 854var symbolStartAnalyzersBuilder = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(); 855var otherAnalyzersBuilder = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(); 857foreach (var analyzer in analyzers) 876ImmutableArray<DiagnosticAnalyzer> symbolStartAnalyzers, 1148/// Given a set of compiler or <see cref="DiagnosticAnalyzer"/> generated <paramref name="diagnostics"/>, returns the effective diagnostics after applying the below filters: 1158/// Given a set of compiler or <see cref="DiagnosticAnalyzer"/> generated <paramref name="diagnostics"/>, returns the effective diagnostics after applying the below filters: 1216DiagnosticAnalyzer analyzer, 1218Action<Exception, DiagnosticAnalyzer, Diagnostic>? onAnalyzerException = null) 1229Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> wrappedOnAnalyzerException = 1232Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnosticDescriptors = analyzer => 1266public static void ClearAnalyzerState(ImmutableArray<DiagnosticAnalyzer> analyzers) 1273public async Task<AnalyzerTelemetryInfo> GetAnalyzerTelemetryInfoAsync(DiagnosticAnalyzer analyzer, CancellationToken cancellationToken) 1293private async Task<AnalyzerActionCounts> GetAnalyzerActionCountsAsync(DiagnosticAnalyzer analyzer, CancellationToken cancellationToken) 1304private TimeSpan GetAnalyzerExecutionTime(DiagnosticAnalyzer analyzer)
DiagnosticAnalyzer\CompilationWithAnalyzersOptions.cs (10)
15private readonly Action<Exception, DiagnosticAnalyzer, Diagnostic>? _onAnalyzerException; 22/// Options passed to <see cref="DiagnosticAnalyzer"/>s. 29public Action<Exception, DiagnosticAnalyzer, Diagnostic>? OnAnalyzerException => _onAnalyzerException; 56internal readonly Func<DiagnosticAnalyzer, AnalyzerConfigOptionsProvider>? GetAnalyzerConfigOptionsProvider; 67Action<Exception, DiagnosticAnalyzer, Diagnostic>? onAnalyzerException, 84Action<Exception, DiagnosticAnalyzer, Diagnostic>? onAnalyzerException, 103Action<Exception, DiagnosticAnalyzer, Diagnostic>? onAnalyzerException, 112/// <inheritdoc cref="CompilationWithAnalyzersOptions.CompilationWithAnalyzersOptions(AnalyzerOptions?, Action{Exception, DiagnosticAnalyzer, Diagnostic}?, bool, bool, bool, Func{Exception, bool}?)"/> 119Action<Exception, DiagnosticAnalyzer, Diagnostic>? onAnalyzerException, 124Func<DiagnosticAnalyzer, AnalyzerConfigOptionsProvider>? getAnalyzerConfigOptionsProvider)
DiagnosticAnalyzer\DiagnosticAnalyzerAction.cs (16)
13internal DiagnosticAnalyzer Analyzer { get; } 15internal AnalyzerAction(DiagnosticAnalyzer analyzer) 26public SymbolAnalyzerAction(Action<SymbolAnalysisContext> action, ImmutableArray<SymbolKind> kinds, DiagnosticAnalyzer analyzer) 39public SymbolStartAnalyzerAction(Action<SymbolStartAnalysisContext> action, SymbolKind kind, DiagnosticAnalyzer analyzer) 51public SymbolEndAnalyzerAction(Action<SymbolAnalysisContext> action, DiagnosticAnalyzer analyzer) 63public SyntaxNodeAnalyzerAction(Action<SyntaxNodeAnalysisContext> action, ImmutableArray<TLanguageKindEnum> kinds, DiagnosticAnalyzer analyzer) 75public OperationBlockStartAnalyzerAction(Action<OperationBlockStartAnalysisContext> action, DiagnosticAnalyzer analyzer) 86public OperationBlockAnalyzerAction(Action<OperationBlockAnalysisContext> action, DiagnosticAnalyzer analyzer) 98public OperationAnalyzerAction(Action<OperationAnalysisContext> action, ImmutableArray<OperationKind> kinds, DiagnosticAnalyzer analyzer) 110public CompilationStartAnalyzerAction(Action<CompilationStartAnalysisContext> action, DiagnosticAnalyzer analyzer) 121public CompilationAnalyzerAction(Action<CompilationAnalysisContext> action, DiagnosticAnalyzer analyzer) 132public SemanticModelAnalyzerAction(Action<SemanticModelAnalysisContext> action, DiagnosticAnalyzer analyzer) 143public SyntaxTreeAnalyzerAction(Action<SyntaxTreeAnalysisContext> action, DiagnosticAnalyzer analyzer) 154public AdditionalFileAnalyzerAction(Action<AdditionalFileAnalysisContext> action, DiagnosticAnalyzer analyzer) 165public CodeBlockStartAnalyzerAction(Action<CodeBlockStartAnalysisContext<TLanguageKindEnum>> action, DiagnosticAnalyzer analyzer) 176public CodeBlockAnalyzerAction(Action<CodeBlockAnalysisContext> action, DiagnosticAnalyzer analyzer)
DiagnosticAnalyzer\DiagnosticAnalyzerExtensions.cs (4)
14/// <inheritdoc cref="WithAnalyzers(Compilation, ImmutableArray{DiagnosticAnalyzer}, AnalyzerOptions?)"/> 17public static CompilationWithAnalyzers WithAnalyzers(this Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, AnalyzerOptions? options, CancellationToken cancellationToken) 29public static CompilationWithAnalyzers WithAnalyzers(this Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, AnalyzerOptions? options = null) 41public static CompilationWithAnalyzers WithAnalyzers(this Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, CompilationWithAnalyzersOptions analysisOptions)
DiagnosticAnalyzer\DiagnosticQueue.cs (28)
24public abstract void EnqueueLocal(Diagnostic diagnostic, DiagnosticAnalyzer analyzer, bool isSyntaxDiagnostic); 25public abstract void EnqueueNonLocal(Diagnostic diagnostic, DiagnosticAnalyzer analyzer); 26public abstract ImmutableArray<Diagnostic> DequeueLocalSyntaxDiagnostics(DiagnosticAnalyzer analyzer); 27public abstract ImmutableArray<Diagnostic> DequeueLocalSemanticDiagnostics(DiagnosticAnalyzer analyzer); 28public abstract ImmutableArray<Diagnostic> DequeueNonLocalDiagnostics(DiagnosticAnalyzer analyzer); 58public override void EnqueueLocal(Diagnostic diagnostic, DiagnosticAnalyzer analyzer, bool isSyntaxDiagnostic) 63public override void EnqueueNonLocal(Diagnostic diagnostic, DiagnosticAnalyzer analyzer) 68public override ImmutableArray<Diagnostic> DequeueLocalSemanticDiagnostics(DiagnosticAnalyzer analyzer) 73public override ImmutableArray<Diagnostic> DequeueLocalSyntaxDiagnostics(DiagnosticAnalyzer analyzer) 78public override ImmutableArray<Diagnostic> DequeueNonLocalDiagnostics(DiagnosticAnalyzer analyzer) 100private Dictionary<DiagnosticAnalyzer, SimpleDiagnosticQueue>? _lazyLocalSemanticDiagnostics; 101private Dictionary<DiagnosticAnalyzer, SimpleDiagnosticQueue>? _lazyLocalSyntaxDiagnostics; 102private Dictionary<DiagnosticAnalyzer, SimpleDiagnosticQueue>? _lazyNonLocalDiagnostics; 109public override void EnqueueLocal(Diagnostic diagnostic, DiagnosticAnalyzer analyzer, bool isSyntaxDiagnostic) 122public override void EnqueueNonLocal(Diagnostic diagnostic, DiagnosticAnalyzer analyzer) 128[NotNull] ref Dictionary<DiagnosticAnalyzer, SimpleDiagnosticQueue>? lazyDiagnosticsMap, 130DiagnosticAnalyzer analyzer) 134lazyDiagnosticsMap ??= new Dictionary<DiagnosticAnalyzer, SimpleDiagnosticQueue>(); 139private static void EnqueueCore_NoLock(Dictionary<DiagnosticAnalyzer, SimpleDiagnosticQueue> diagnosticsMap, Diagnostic diagnostic, DiagnosticAnalyzer analyzer) 171private static bool TryDequeue_NoLock(Dictionary<DiagnosticAnalyzer, SimpleDiagnosticQueue>? lazyDiagnosticsMap, [NotNullWhen(returnValue: true)] out Diagnostic? d) 185public override ImmutableArray<Diagnostic> DequeueLocalSyntaxDiagnostics(DiagnosticAnalyzer analyzer) 190public override ImmutableArray<Diagnostic> DequeueLocalSemanticDiagnostics(DiagnosticAnalyzer analyzer) 195public override ImmutableArray<Diagnostic> DequeueNonLocalDiagnostics(DiagnosticAnalyzer analyzer) 200private ImmutableArray<Diagnostic> DequeueDiagnosticsCore(DiagnosticAnalyzer analyzer, Dictionary<DiagnosticAnalyzer, SimpleDiagnosticQueue>? lazyDiagnosticsMap) 217DiagnosticAnalyzer analyzer, 218Dictionary<DiagnosticAnalyzer, SimpleDiagnosticQueue>? diagnosticsMap,
DiagnosticAnalyzer\DiagnosticStartAnalysisScope.cs (9)
367internal sealed class HostSessionStartAnalysisScope(DiagnosticAnalyzer analyzer) 436internal sealed class HostSymbolStartAnalysisScope(DiagnosticAnalyzer analyzer) 444internal sealed class HostCodeBlockStartAnalysisScope<TLanguageKindEnum>(DiagnosticAnalyzer analyzer) where TLanguageKindEnum : struct 449private DiagnosticAnalyzer Analyzer { get; } = analyzer; 472internal sealed class HostOperationBlockStartAnalysisScope(DiagnosticAnalyzer analyzer) 477private DiagnosticAnalyzer Analyzer { get; } = analyzer; 494internal abstract class HostAnalysisScope(DiagnosticAnalyzer analyzer) 498internal DiagnosticAnalyzer Analyzer { get; } = analyzer; 867DiagnosticAnalyzer analyzer,
DiagnosticAnalyzer\UnresolvedAnalyzerReference.cs (4)
54public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzersForAllLanguages() 56return ImmutableArray<DiagnosticAnalyzer>.Empty; 59public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzers(string language) 61return ImmutableArray<DiagnosticAnalyzer>.Empty;
Microsoft.CodeAnalysis.Analyzers (7)
MetaAnalyzers\ConfigureGeneratedCodeAnalysisAnalyzer.cs (1)
61if (method.Name != nameof(DiagnosticAnalyzer.Initialize))
MetaAnalyzers\EnableConcurrentExecutionAnalyzer.cs (1)
61if (method.Name != nameof(DiagnosticAnalyzer.Initialize))
MetaAnalyzers\Helpers\DiagnosticWellKnownNames.cs (1)
24internal const string SupportedDiagnosticsName = nameof(DiagnosticAnalyzer.SupportedDiagnostics);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
32/// <param name="options">Options passed to a <see cref="DiagnosticAnalyzer"/>.</param>
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\DiagnosticAnalyzerCategory.cs (1)
19/// Note: an <see cref="DiagnosticAnalyzer"/> that uses this will not work properly if
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
26Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnostics,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticAnalyzerExtensions.cs (1)
15public static bool IsCompilerAnalyzer(this DiagnosticAnalyzer analyzer)
Microsoft.CodeAnalysis.AnalyzerUtilities (4)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
32/// <param name="options">Options passed to a <see cref="DiagnosticAnalyzer"/>.</param>
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\DiagnosticAnalyzerCategory.cs (1)
19/// Note: an <see cref="DiagnosticAnalyzer"/> that uses this will not work properly if
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
26Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnostics,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticAnalyzerExtensions.cs (1)
15public static bool IsCompilerAnalyzer(this DiagnosticAnalyzer analyzer)
Microsoft.CodeAnalysis.CodeStyle (8)
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (5)
88Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnostics, 394Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnostics, 398using var _1 = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(out var analyzersBuilder); 404foreach (var analyzer in compilationWithAnalyzers.Analyzers) 483static void AddAllDiagnostics(ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> diagnostics, ArrayBuilder<Diagnostic> reportedDiagnostics)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\DiagnosticAnalyzerCategory.cs (1)
19/// Note: an <see cref="DiagnosticAnalyzer"/> that uses this will not work properly if
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
26Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnostics,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticAnalyzerExtensions.cs (1)
15public static bool IsCompilerAnalyzer(this DiagnosticAnalyzer analyzer)
Microsoft.CodeAnalysis.CSharp (2)
CommandLine\CSharpCompiler.cs (1)
338out ImmutableArray<DiagnosticAnalyzer> analyzers,
Compilation\CSharpCompilation.cs (1)
4965internal override AnalyzerDriver CreateAnalyzerDriver(ImmutableArray<DiagnosticAnalyzer> analyzers, AnalyzerManager analyzerManager, SeverityFilter severityFilter)
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper`1.cs (1)
26/// requirements with <see cref="DiagnosticAnalyzer"/> and "CodeRefactoringProvider".
Microsoft.CodeAnalysis.CSharp.Features (1)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper`1.cs (1)
26/// requirements with <see cref="DiagnosticAnalyzer"/> and "CodeRefactoringProvider".
Microsoft.CodeAnalysis.Features (143)
Diagnostics\DiagnosticAnalyzerExtensions.cs (7)
17public static bool IsWorkspaceDiagnosticAnalyzer(this DiagnosticAnalyzer analyzer) 20public static bool IsBuiltInAnalyzer(this DiagnosticAnalyzer analyzer) 30public static string GetAnalyzerAssemblyName(this DiagnosticAnalyzer analyzer) 33public static void AppendAnalyzerMap(this Dictionary<string, DiagnosticAnalyzer> analyzerMap, ImmutableArray<DiagnosticAnalyzer> analyzers) 35foreach (var analyzer in analyzers) 42public static ImmutableArray<AnalyzerPerformanceInfo> ToAnalyzerPerformanceInfo(this IDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo> analysisResult, DiagnosticAnalyzerInfoCache analyzerInfo)
Diagnostics\DiagnosticAnalyzerTelemetry.cs (1)
51public void UpdateAnalyzerActionsTelemetry(DiagnosticAnalyzer analyzer, AnalyzerTelemetryInfo analyzerTelemetryInfo, bool isTelemetryCollectionAllowed)
Diagnostics\Options\SolutionCrawlerOptionsStorage.cs (1)
61public static bool IsFullSolutionAnalysisEnabled(this DiagnosticAnalyzer analyzer, IGlobalOptionService globalOptions, string language)
Diagnostics\Service\ChecksumAndAnalyzersEqualityComparer.cs (5)
14: IEqualityComparer<ImmutableArray<DiagnosticAnalyzer>> 18public bool Equals(ImmutableArray<DiagnosticAnalyzer> x, ImmutableArray<DiagnosticAnalyzer> y) 24public int GetHashCode(ImmutableArray<DiagnosticAnalyzer> obj) 29foreach (var analyzer in obj)
Diagnostics\Service\DiagnosticAnalyzerComparer.cs (5)
14private sealed class DiagnosticAnalyzerComparer : IEqualityComparer<DiagnosticAnalyzer> 18public bool Equals(DiagnosticAnalyzer? x, DiagnosticAnalyzer? y) 27public int GetHashCode(DiagnosticAnalyzer obj) => GetAnalyzerIdAndLastWriteTime(obj).GetHashCode(); 29private static (string analyzerId, DateTime lastWriteTime) GetAnalyzerIdAndLastWriteTime(DiagnosticAnalyzer analyzer)
Diagnostics\Service\DiagnosticAnalyzerService.cs (6)
124public ImmutableArray<DiagnosticAnalyzer> GetAnalyzers(Project project) 127public Task<DiagnosticAnalysisResultMap<DiagnosticAnalyzer, DiagnosticAnalysisResult>> AnalyzeProjectInProcessAsync( 131public async Task<ImmutableArray<DiagnosticAnalyzer>> GetDeprioritizedAnalyzersAsync(Project project) 133using var _ = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(out var builder); 135foreach (var analyzer in service.GetProjectAnalyzers_OnlyCallInProcess(project)) 150foreach (var analyzer in service.GetProjectAnalyzers_OnlyCallInProcess(project))
Diagnostics\Service\DiagnosticAnalyzerService.HostAnalyzerInfo.cs (27)
23private readonly ImmutableHashSet<DiagnosticAnalyzer> _hostAnalyzers; 24private readonly ImmutableHashSet<DiagnosticAnalyzer> _allAnalyzers; 25public readonly ImmutableArray<DiagnosticAnalyzer> OrderedAllAnalyzers; 28ImmutableHashSet<DiagnosticAnalyzer> hostAnalyzers, 29ImmutableHashSet<DiagnosticAnalyzer> allAnalyzers) 40public bool IsHostAnalyzer(DiagnosticAnalyzer analyzer) 43public HostAnalyzerInfo WithExcludedAnalyzers(ImmutableHashSet<DiagnosticAnalyzer> excludedAnalyzers) 53private int PriorityComparison(DiagnosticAnalyzer state1, DiagnosticAnalyzer state2) 56private static int GetPriority(DiagnosticAnalyzer state) 72private static readonly ConditionalWeakTable<Project, StrongBox<ImmutableArray<DiagnosticAnalyzer>>> s_projectToAnalyzers = new(); 75/// Return <see cref="DiagnosticAnalyzer"/>s for the given <see cref="Project"/>. 77private ImmutableArray<DiagnosticAnalyzer> GetProjectAnalyzers_OnlyCallInProcess(Project project) 95ImmutableArray<DiagnosticAnalyzer> ComputeProjectAnalyzers() 126static (ImmutableArray<ImmutableArray<DiagnosticAnalyzer>> HostAnalyzerCollection, ImmutableArray<ImmutableArray<DiagnosticAnalyzer>> ProjectAnalyzerCollection) GetAnalyzerCollections( 127ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> analyzersPerReference, 135using var _1 = ArrayBuilder<ImmutableArray<DiagnosticAnalyzer>>.GetInstance(out var hostAnalyzerCollection); 136using var _2 = ArrayBuilder<ImmutableArray<DiagnosticAnalyzer>>.GetInstance(out var projectAnalyzerCollection); 154private static (ImmutableHashSet<DiagnosticAnalyzer> hostAnalyzers, ImmutableHashSet<DiagnosticAnalyzer> allAnalyzers) PartitionAnalyzers( 155ImmutableArray<ImmutableArray<DiagnosticAnalyzer>> projectAnalyzerCollection, 156ImmutableArray<ImmutableArray<DiagnosticAnalyzer>> hostAnalyzerCollection, 159using var _1 = PooledHashSet<DiagnosticAnalyzer>.GetInstance(out var hostAnalyzers); 160using var _2 = PooledHashSet<DiagnosticAnalyzer>.GetInstance(out var allAnalyzers); 172foreach (var analyzer in analyzers) 181foreach (var analyzer in analyzers)
Diagnostics\Service\DiagnosticAnalyzerService.IncrementalMemberEditAnalyzer.cs (17)
54public async Task<ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>>> ComputeDiagnosticsInProcessAsync( 56ImmutableArray<DiagnosticAnalyzer> analyzers, 84using var _1 = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(out var spanBasedAnalyzers); 85using var _2 = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(out var documentBasedAnalyzers); 86(DiagnosticAnalyzer analyzer, bool spanBased)? compilerAnalyzerData = null; 87foreach (var analyzer in analyzers) 119using var _ = PooledDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>>.GetInstance(out var builder); 133(DiagnosticAnalyzer analyzer, bool spanBased)? compilerAnalyzerData, 135Dictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>> builder) 143using var _ = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(1, analyzer, out var analyzers); 148ArrayBuilder<DiagnosticAnalyzer> analyzers, 150Dictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>> builder) 160ArrayBuilder<DiagnosticAnalyzer> analyzers, 162Dictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>> builder) 173ArrayBuilder<DiagnosticAnalyzer> analyzers, 175Dictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>> builder) 182foreach (var analyzer in analyzers)
Diagnostics\Service\DiagnosticAnalyzerService.ProjectStates.cs (2)
25public readonly ImmutableHashSet<DiagnosticAnalyzer> Analyzers; 31ImmutableHashSet<DiagnosticAnalyzer> analyzers,
Diagnostics\Service\DiagnosticAnalyzerService_CompilationWithAnalyzersPair.cs (6)
21/// Note: the CompilationWithAnalyzersPair instance is dependent on the set of <see cref="DiagnosticAnalyzer"/>s 28/// <see cref="Project"/> checksum the set of <see cref="DiagnosticAnalyzer"/>s being requested. 37ImmutableArray<DiagnosticAnalyzer>, 47ImmutableArray<DiagnosticAnalyzer> analyzers, 79ImmutableArray<DiagnosticAnalyzer> analyzers, 123(AnalyzerOptions sharedOptions, Func<DiagnosticAnalyzer, AnalyzerConfigOptionsProvider>? analyzerSpecificOptionsFactory) GetOptions()
Diagnostics\Service\DiagnosticAnalyzerService_ComputeDiagnosticAnalysisResults.cs (10)
22/// Return all diagnostics that belong to given project for the given <see cref="DiagnosticAnalyzer"/> either 25private async Task<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>> ComputeDiagnosticAnalysisResultsInProcessAsync( 53async Task<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>> RemoveCompilerSemanticErrorsIfProjectNotLoadedAsync( 54ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> result) 63var compilerAnalyzer = project.Solution.SolutionState.Analyzers.GetCompilerDiagnosticAnalyzer(project.Language); 88async Task<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>> ComputeDiagnosticsForAnalyzersAsync( 93var result = ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>.Empty; 117async Task<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>> MergeProjectDiagnosticAnalyzerDiagnosticsAsync( 119ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> result) 163void UpdateAnalyzerTelemetryData(ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo> telemetry)
Diagnostics\Service\DiagnosticAnalyzerService_CoreAnalyze.cs (4)
27private async Task<DiagnosticAnalysisResultMap<DiagnosticAnalyzer, DiagnosticAnalysisResult>> AnalyzeInProcessAsync( 39async Task<DiagnosticAnalysisResultMap<DiagnosticAnalyzer, DiagnosticAnalysisResult>> AnalyzeAsync() 57var builderMap = ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResultBuilder>.Empty; 67var telemetry = ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo>.Empty;
Diagnostics\Service\DiagnosticAnalyzerService_DeprioritizationCandidates.cs (4)
26private static readonly ConditionalWeakTable<DiagnosticAnalyzer, ImmutableHashSet<string>?> s_analyzerToDeprioritizedDiagnosticIds = new(); 29Project project, DiagnosticAnalyzer analyzer, CancellationToken cancellationToken) 50foreach (var analyzer in analyzers) 86async ValueTask<ImmutableHashSet<string>?> ComputeDeprioritizedDiagnosticIdsAsync(DiagnosticAnalyzer analyzer)
Diagnostics\Service\DiagnosticAnalyzerService_ForceCodeAnalysisDiagnostics.cs (1)
53bool ShouldIncludeAnalyzer(DiagnosticAnalyzer analyzer)
Diagnostics\Service\DiagnosticAnalyzerService_GetDiagnosticsForSpan.cs (22)
25private static async Task<ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>>> ComputeDocumentDiagnosticsCoreInProcessAsync( 29using var _ = PooledDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>>.GetInstance(out var builder); 30foreach (var analyzer in executor.AnalysisScope.Analyzers) 78ImmutableArray<DiagnosticAnalyzer> syntaxAnalyzers, 79ImmutableArray<DiagnosticAnalyzer> semanticSpanAnalyzers, 80ImmutableArray<DiagnosticAnalyzer> semanticDocumentAnalyzers)> GetAllAnalyzersAsync() 84using var _1 = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(out var syntaxAnalyzers); 91using var _2 = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(out var semanticSpanBasedAnalyzers); 92using var _3 = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(out var semanticDocumentBasedAnalyzers); 96foreach (var analyzer in analyzers) 156async ValueTask<bool> ShouldIncludeAnalyzerAsync(DiagnosticAnalyzer analyzer) 186async Task<bool> MatchesPriorityAsync(DiagnosticAnalyzer analyzer) 220async Task<ImmutableArray<DiagnosticAnalyzer>> FilterAnalyzersAsync( 221ImmutableArray<DiagnosticAnalyzer> analyzers, 225using var _1 = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(analyzers.Length, out var filteredAnalyzers); 227foreach (var analyzer in analyzers) 242DiagnosticAnalyzer analyzer, AnalysisKind kind, TextSpan? span) 280ImmutableArray<DiagnosticAnalyzer> allAnalyzers, 281ImmutableArray<DiagnosticAnalyzer> syntaxAnalyzers, 282ImmutableArray<DiagnosticAnalyzer> semanticSpanAnalyzers, 283ImmutableArray<DiagnosticAnalyzer> semanticDocumentAnalyzers, 308ImmutableArray<DiagnosticAnalyzer> analyzers,
Diagnostics\Service\DiagnosticAnalyzerService_ProduceProjectDiagnostics.cs (8)
22private ImmutableArray<DiagnosticAnalyzer> GetDiagnosticAnalyzersInProcess( 30bool ShouldIncludeAnalyzer(DiagnosticAnalyzer analyzer) 71ImmutableArray<DiagnosticAnalyzer> analyzers, 103ImmutableArray<DiagnosticAnalyzer> analyzers, 119ImmutableArray<DiagnosticAnalyzer> analyzers, 130foreach (var analyzer in analyzers) 166async Task<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>> GetOrComputeDiagnosticAnalysisResultsAsync( 167ImmutableArray<DiagnosticAnalyzer> analyzers)
Diagnostics\Service\DiagnosticAnalyzerService_RemoteOrLocalDispatcher.cs (1)
91foreach (var analyzer in analyzers)
Diagnostics\Service\DocumentAnalysisExecutor.cs (6)
36private readonly ImmutableArray<DiagnosticAnalyzer> _compilationBasedAnalyzersInAnalysisScope; 38private ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>? _lazySyntaxDiagnostics; 39private ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>? _lazySemanticDiagnostics; 60using var _ = PooledHashSet<DiagnosticAnalyzer>.GetInstance(out var compilationBasedProjectAnalyzers); 77DiagnosticAnalyzer analyzer, CancellationToken cancellationToken) 165async ValueTask<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>> GetAnalysisResultInProcessAsync(
Diagnostics\Service\DocumentAnalysisExecutor_Helpers.cs (2)
28internal static Diagnostic CreateAnalyzerExceptionDiagnostic(DiagnosticAnalyzer analyzer, Exception e) 51public static bool IsAnalyzerEnabledForProject(DiagnosticAnalyzer analyzer, Project project, IGlobalOptionService globalOptions)
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (5)
88Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnostics, 394Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnostics, 398using var _1 = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(out var analyzersBuilder); 404foreach (var analyzer in compilationWithAnalyzers.Analyzers) 483static void AddAllDiagnostics(ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> diagnostics, ArrayBuilder<Diagnostic> reportedDiagnostics)
SyncNamespaces\AbstractSyncNamespacesService.cs (3)
41var diagnosticAnalyzers = ImmutableArray.Create<DiagnosticAnalyzer>(DiagnosticAnalyzer); 60ImmutableArray<DiagnosticAnalyzer> diagnosticAnalyzers, 77ImmutableArray<DiagnosticAnalyzer> diagnosticAnalyzers,
Microsoft.CodeAnalysis.ResxSourceGenerator (4)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
32/// <param name="options">Options passed to a <see cref="DiagnosticAnalyzer"/>.</param>
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\DiagnosticAnalyzerCategory.cs (1)
19/// Note: an <see cref="DiagnosticAnalyzer"/> that uses this will not work properly if
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
26Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnostics,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticAnalyzerExtensions.cs (1)
15public static bool IsCompilerAnalyzer(this DiagnosticAnalyzer analyzer)
Microsoft.CodeAnalysis.VisualBasic (2)
CommandLine\VisualBasicCompiler.vb (1)
262ByRef analyzers As ImmutableArray(Of DiagnosticAnalyzer),
Compilation\VisualBasicCompilation.vb (1)
2323Friend Overrides Function CreateAnalyzerDriver(analyzers As ImmutableArray(Of DiagnosticAnalyzer), analyzerManager As AnalyzerManager, severityFilter As SeverityFilter) As AnalyzerDriver
Microsoft.CodeAnalysis.Workspaces (87)
Diagnostics\DiagnosticAnalyzerExtensions.cs (5)
9public static DiagnosticAnalyzerCategory GetDiagnosticAnalyzerCategory(this DiagnosticAnalyzer analyzer) 23public static bool SupportAnalysisKind(this DiagnosticAnalyzer analyzer, AnalysisKind kind) 31public static bool SupportsSyntaxDiagnosticAnalysis(this DiagnosticAnalyzer analyzer) 37public static bool SupportsSemanticDiagnosticAnalysis(this DiagnosticAnalyzer analyzer) 43public static bool SupportsSpanBasedSemanticDiagnosticAnalysis(this DiagnosticAnalyzer analyzer)
Diagnostics\DiagnosticAnalyzerInfoCache.cs (16)
20/// <see cref="DiagnosticAnalyzer"/> instance, <see cref="DiagnosticDescriptor"/>s. 26/// Supported descriptors of each <see cref="DiagnosticAnalyzer"/>. 29/// Holds on <see cref="DiagnosticAnalyzer"/> instances weakly so that we don't keep analyzers coming from package references alive. 32/// The purpose of this map is to avoid multiple calls to <see cref="DiagnosticAnalyzer.SupportedDiagnostics"/> that might return different values 35private readonly ConditionalWeakTable<DiagnosticAnalyzer, DiagnosticDescriptorsInfo> _descriptorsInfo = new(); 68/// Returns <see cref="DiagnosticAnalyzer.SupportedDiagnostics"/> of given <paramref name="analyzer"/>. 70public ImmutableArray<DiagnosticDescriptor> GetDiagnosticDescriptors(DiagnosticAnalyzer analyzer) 80/// Returns <see cref="DiagnosticAnalyzer.SupportedDiagnostics"/> of given <paramref name="analyzer"/> 83public ImmutableArray<DiagnosticDescriptor> GetNonCompilationEndDiagnosticDescriptors(DiagnosticAnalyzer analyzer) 92/// Returns <see cref="DiagnosticAnalyzer.SupportedDiagnostics"/> of given <paramref name="analyzer"/> 95public ImmutableArray<DiagnosticDescriptor> GetCompilationEndDiagnosticDescriptors(DiagnosticAnalyzer analyzer) 107public bool IsCompilationEndAnalyzer(DiagnosticAnalyzer analyzer) 113public bool IsTelemetryCollectionAllowed(DiagnosticAnalyzer analyzer) 119private DiagnosticDescriptorsInfo GetOrCreateDescriptorsInfo(DiagnosticAnalyzer analyzer) 122private DiagnosticDescriptorsInfo CalculateDescriptorsInfo(DiagnosticAnalyzer analyzer) 163private static bool IsTelemetryCollectionAllowed(DiagnosticAnalyzer analyzer, ImmutableArray<DiagnosticDescriptor> descriptors)
Diagnostics\DiagnosticIdFilter.cs (1)
34/// Checks the IDs from a single analyzer's <see cref="DiagnosticAnalyzer.SupportedDiagnostics"/> to see if it is
Diagnostics\DocumentAnalysisScope.cs (3)
24ImmutableArray<DiagnosticAnalyzer> analyzers, 40public ImmutableArray<DiagnosticAnalyzer> Analyzers { get; } 60public DocumentAnalysisScope WithAnalyzers(ImmutableArray<DiagnosticAnalyzer> analyzers)
Diagnostics\DocumentDiagnosticAnalyzer.cs (1)
38/// <see cref="DiagnosticAnalyzer"/> always comes before those 2 different types. Priority is ascending order and
Diagnostics\Extensions.cs (8)
73public static string GetAnalyzerId(this DiagnosticAnalyzer analyzer) 105public static async Task<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResultBuilder>> ToResultBuilderMapAsync( 110ImmutableArray<DiagnosticAnalyzer> analyzers, 128var builder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, DiagnosticAnalysisResultBuilder>(); 129foreach (var analyzer in analyzers) 156ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>? diagnosticsByAnalyzerMap; 246DiagnosticAnalyzer analyzer, 247ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> diagnosticsByAnalyzer,
Diagnostics\FileContentLoadAnalyzer.cs (1)
13/// <see cref="DiagnosticAnalyzer"/>.
Diagnostics\GeneratorDiagnosticsPlaceholderAnalyzer.cs (1)
13/// A placeholder singleton analyzer. Its only purpose is to represent generator-produced diagnostics in maps that are keyed by <see cref="DiagnosticAnalyzer"/>.
Diagnostics\HostDiagnosticAnalyzers.cs (31)
26/// Key is the language the <see cref="DiagnosticAnalyzer"/> supports and key for the second map is analyzer reference identity and 27/// <see cref="DiagnosticAnalyzer"/> for that assembly reference. 31private readonly ConcurrentDictionary<string, ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>>> _hostDiagnosticAnalyzersPerLanguageMap; 36/// Value is set of <see cref="DiagnosticAnalyzer"/> that belong to the <see cref="AnalyzerReference"/>. 40private readonly Lazy<ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>>> _lazyHostDiagnosticAnalyzersPerReferenceMap; 45private ImmutableDictionary<string, DiagnosticAnalyzer> _compilerDiagnosticAnalyzerMap; 61_hostDiagnosticAnalyzersPerLanguageMap = new ConcurrentDictionary<string, ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>>>(concurrencyLevel: 2, capacity: 2); 62_lazyHostDiagnosticAnalyzersPerReferenceMap = new Lazy<ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>>>(() => CreateDiagnosticAnalyzersPerReferenceMap(_hostAnalyzerReferencesMap), isThreadSafe: true); 64_compilerDiagnosticAnalyzerMap = ImmutableDictionary<string, DiagnosticAnalyzer>.Empty; 73/// Get <see cref="AnalyzerReference"/> identity and <see cref="DiagnosticAnalyzer"/>s map for given <paramref name="language"/> 75public ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> GetOrCreateHostDiagnosticAnalyzersPerReference(string language) 156/// Create <see cref="AnalyzerReference"/> identity and <see cref="DiagnosticAnalyzer"/>s map for given <paramref name="project"/> that 159public ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> CreateDiagnosticAnalyzersPerReference(Project project) 168/// Create <see cref="AnalyzerReference"/> identity and <see cref="DiagnosticAnalyzer"/>s map for given <paramref name="project"/> that 171public ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> CreateProjectDiagnosticAnalyzersPerReference(ProjectState project) 174public ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> CreateProjectDiagnosticAnalyzersPerReference(IReadOnlyList<AnalyzerReference> projectAnalyzerReferences, string language) 178/// Return compiler <see cref="DiagnosticAnalyzer"/> for the given language. 180public DiagnosticAnalyzer? GetCompilerDiagnosticAnalyzer(string language) 183if (_compilerDiagnosticAnalyzerMap.TryGetValue(language, out var compilerAnalyzer)) 196ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> analyzersMap) 202foreach (var analyzer in analyzers) 215private ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> CreateHostDiagnosticAnalyzersAndBuildMap(string language) 219var builder = ImmutableDictionary.CreateBuilder<object, ImmutableArray<DiagnosticAnalyzer>>(); 237private void UpdateCompilerAnalyzerMapIfNeeded(string language, ImmutableArray<DiagnosticAnalyzer> analyzers) 244foreach (var analyzer in analyzers) 254private static ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> CreateDiagnosticAnalyzersPerReferenceMap( 257var builder = ImmutableDictionary.CreateBuilder<object, ImmutableArray<DiagnosticAnalyzer>>(); 314private static ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> MergeDiagnosticAnalyzerMap( 315ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> map1, 316ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> map2) 319var seen = new HashSet<DiagnosticAnalyzer>(map1.Values.SelectMany(v => v));
Diagnostics\SkippedHostAnalyzersInfo.cs (10)
23ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<string>>.Empty); 29public ImmutableHashSet<DiagnosticAnalyzer> SkippedAnalyzers { get; } 37public ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<string>> FilteredDiagnosticIdsForAnalyzers { get; } 40ImmutableHashSet<DiagnosticAnalyzer> skippedHostAnalyzers, 41ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<string>> filteredDiagnosticIdsForAnalyzers) 61foreach (var analyzer in analyzers) 83var fullySkippedHostAnalyzersBuilder = ImmutableHashSet.CreateBuilder<DiagnosticAnalyzer>(); 84var partiallySkippedHostAnalyzersBuilder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, ImmutableArray<string>>(); 88foreach (var hostAnalyzer in analyzers) 120DiagnosticAnalyzer hostAnalyzer,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\DiagnosticAnalyzerCategory.cs (1)
19/// Note: an <see cref="DiagnosticAnalyzer"/> that uses this will not work properly if
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
26Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnostics,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticAnalyzerExtensions.cs (1)
15public static bool IsCompilerAnalyzer(this DiagnosticAnalyzer analyzer)
Workspace\IsolatedAnalyzerFileReference.cs (7)
28/// then ensures that as long as it is alive (or any <see cref="DiagnosticAnalyzer"/> or <see cref="ISourceGenerator"/> 38/// Conditional weak tables that ensure that as long as a particular <see cref="DiagnosticAnalyzer"/> or <see 42private static readonly ConditionalWeakTable<DiagnosticAnalyzer, IsolatedAnalyzerReferenceSet> s_analyzerToPinnedReferenceSet = []; 62public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzers(string language) 65public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzersForAllLanguages() 78private ImmutableArray<DiagnosticAnalyzer> PinAnalyzers<TArg>(Func<AnalyzerReference, TArg, ImmutableArray<DiagnosticAnalyzer>> getItems, TArg arg)
Microsoft.Gen.BuildMetadata.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
393DiagnosticAnalyzer analyzer, 435DiagnosticAnalyzer analyzer,
Microsoft.Gen.ComplianceReports.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
393DiagnosticAnalyzer analyzer, 435DiagnosticAnalyzer analyzer,
Microsoft.Gen.ContextualOptions.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
393DiagnosticAnalyzer analyzer, 435DiagnosticAnalyzer analyzer,
Microsoft.Gen.Logging.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
393DiagnosticAnalyzer analyzer, 435DiagnosticAnalyzer analyzer,
Microsoft.Gen.MetadataExtractor.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
393DiagnosticAnalyzer analyzer, 435DiagnosticAnalyzer analyzer,
Microsoft.Gen.Metrics.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
393DiagnosticAnalyzer analyzer, 435DiagnosticAnalyzer analyzer,
Microsoft.Gen.MetricsReports.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
393DiagnosticAnalyzer analyzer, 435DiagnosticAnalyzer analyzer,
Microsoft.ML.CodeAnalyzer.Tests (3)
Code\RelaxTestNamingTest.cs (2)
139protected override IEnumerable<DiagnosticAnalyzer> GetDiagnosticAnalyzers() 141foreach (var analyzer in base.GetDiagnosticAnalyzers())
Helpers\CSharpCodeFixVerifier`2.cs (1)
17where TAnalyzer : DiagnosticAnalyzer, new()
Roslyn.Diagnostics.Analyzers (4)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
32/// <param name="options">Options passed to a <see cref="DiagnosticAnalyzer"/>.</param>
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\DiagnosticAnalyzerCategory.cs (1)
19/// Note: an <see cref="DiagnosticAnalyzer"/> that uses this will not work properly if
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
26Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnostics,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticAnalyzerExtensions.cs (1)
15public static bool IsCompilerAnalyzer(this DiagnosticAnalyzer analyzer)
VBCSCompiler (5)
src\roslyn\src\Compilers\Server\VBCSCompiler\CompilationCacheUtilities.cs (1)
32ImmutableArray<DiagnosticAnalyzer> analyzers,
src\roslyn\src\Compilers\Server\VBCSCompiler\CSharpCompilerServer.cs (2)
41ImmutableArray<DiagnosticAnalyzer> analyzers, 54ImmutableArray<DiagnosticAnalyzer> analyzers,
src\roslyn\src\Compilers\Server\VBCSCompiler\VisualBasicCompilerServer.cs (2)
41ImmutableArray<DiagnosticAnalyzer> analyzers, 54ImmutableArray<DiagnosticAnalyzer> analyzers,