341 types derived from DiagnosticAnalyzer
Aspire.Hosting.Analyzers (1)
AppHostAnalyzer.cs (1)
16public partial class AppHostAnalyzer : DiagnosticAnalyzer
ILLink.RoslynAnalyzer (3)
COMAnalyzer.cs (1)
16 public sealed class COMAnalyzer : DiagnosticAnalyzer
DynamicallyAccessedMembersAnalyzer.cs (1)
19 public sealed class DynamicallyAccessedMembersAnalyzer : DiagnosticAnalyzer
RequiresAnalyzerBase.cs (1)
21 public abstract class RequiresAnalyzerBase : 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)
16public 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.App.Analyzers.Test (1)
Infrastructure\WellKnownTypesTests.cs (1)
86private class TestAnalyzer : DiagnosticAnalyzer
Microsoft.AspNetCore.Components.Analyzers (3)
ComponentInternalUsageDiagnosticAnalzyer.cs (1)
17public class ComponentInternalUsageDiagnosticAnalyzer : DiagnosticAnalyzer
ComponentParameterAnalyzer.cs (1)
20public sealed class ComponentParameterAnalyzer : DiagnosticAnalyzer
ComponentParameterUsageAnalyzer.cs (1)
13public class ComponentParameterUsageAnalyzer : 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.CodeStyle (3)
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (1)
14internal abstract partial class AbstractBuiltInCodeStyleDiagnosticAnalyzer : DiagnosticAnalyzer, IBuiltInAnalyzer
src\Analyzers\Core\Analyzers\AbstractCodeQualityDiagnosticAnalyzer.cs (1)
12internal abstract class AbstractCodeQualityDiagnosticAnalyzer : DiagnosticAnalyzer, IBuiltInAnalyzer
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
16: DiagnosticAnalyzer
Microsoft.CodeAnalysis.Compiler.Test.Resources (1)
Analyzers\DoNothingAnalyzer.cs (1)
12public sealed class DoNothingAnalyzer : DiagnosticAnalyzer
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (1)
src\Analyzers\CSharp\Tests\ConvertToRecord\ConvertToRecordCodeFixTests.cs (1)
160private class TestAnalyzer : DiagnosticAnalyzer
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (2)
CommandLineTests.cs (2)
14870private sealed class FieldAnalyzer : DiagnosticAnalyzer 15762internal abstract class CompilationStartedAnalyzer : DiagnosticAnalyzer
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (6)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (4)
212private class CompilationAnalyzerWithSyntaxTreeAnalyzer : DiagnosticAnalyzer 286private class CodeBlockAnalyzerFactory : DiagnosticAnalyzer 344private class InvalidSpanAnalyzer : DiagnosticAnalyzer 852private abstract class AbstractNuGetOrVsixAnalyzer : DiagnosticAnalyzer
Diagnostics\FixAllProvider\BatchFixerTests.cs (1)
32private class QualifyWithThisAnalyzer : DiagnosticAnalyzer
Diagnostics\MockDiagnosticAnalyzerTests.cs (1)
20private class MockDiagnosticAnalyzer : DiagnosticAnalyzer
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (37)
Diagnostics\DiagnosticAnalyzerTests.cs (14)
35private class ComplainAboutX : DiagnosticAnalyzer 232private class SyntaxAndSymbolAnalyzer : DiagnosticAnalyzer 469internal class FullyDisabledAnalyzer : DiagnosticAnalyzer 485internal class PartiallyDisabledAnalyzer : DiagnosticAnalyzer 500internal class ImplicitlyDeclaredSymbolAnalyzer : DiagnosticAnalyzer 649public class FieldDeclarationAnalyzer : DiagnosticAnalyzer 745public class CodeBlockOrSyntaxNodeAnalyzer : DiagnosticAnalyzer 827public class MethodSymbolAnalyzer : DiagnosticAnalyzer 870public class AnalyzerReportingUnsupportedDiagnostic : DiagnosticAnalyzer 1633internal class OwningSymbolTestAnalyzer : DiagnosticAnalyzer 2277public class GeneratedCodeSyntaxAndOperationAnalyzer : DiagnosticAnalyzer 3827public class ActionsRegisteredAtDifferentScopesAnalyzer : DiagnosticAnalyzer 4068public class RecordDeclarationAnalyzer : DiagnosticAnalyzer 4106public class PrimaryConstructorBaseTypeAnalyzer : DiagnosticAnalyzer
Diagnostics\GetDiagnosticsTests.cs (2)
929private sealed class BlockStartAnalyzer : DiagnosticAnalyzer 1710private class EnumTypeFieldSymbolAnalyzer : DiagnosticAnalyzer
Semantics\OutVarTests.cs (1)
18794private class ConstructorInitializers_08_SyntaxAnalyzer : DiagnosticAnalyzer
Semantics\PrimaryConstructorTests.cs (13)
3714private class AnalyzerActions_01_Class_Analyzer : DiagnosticAnalyzer 4062private class AnalyzerActions_02_Class_Analyzer : DiagnosticAnalyzer 4144private class AnalyzerActions_03_Class_Analyzer : DiagnosticAnalyzer 4286private class AnalyzerActions_04_Class_Analyzer : DiagnosticAnalyzer 4489private class AnalyzerActions_05_Class_Analyzer : DiagnosticAnalyzer 4803private class AnalyzerActions_07_Class_Analyzer : DiagnosticAnalyzer 5124private class AnalyzerActions_09_Class_Analyzer : DiagnosticAnalyzer 5232private class AnalyzerActions_01_Struct_Analyzer : DiagnosticAnalyzer 5465private class AnalyzerActions_02_Struct_Analyzer : DiagnosticAnalyzer 5548private class AnalyzerActions_03_Struct_Analyzer : DiagnosticAnalyzer 5667private class AnalyzerActions_04_Struct_Analyzer : DiagnosticAnalyzer 5767private class AnalyzerActions_05_Struct_Analyzer : DiagnosticAnalyzer 5824private class AnalyzerActions_07_Struct_Analyzer : DiagnosticAnalyzer
Semantics\RecordTests.cs (7)
26154private class AnalyzerActions_01_Analyzer : DiagnosticAnalyzer 26499private class AnalyzerActions_02_Analyzer : DiagnosticAnalyzer 26589private class AnalyzerActions_03_Analyzer : DiagnosticAnalyzer 26749private class AnalyzerActions_04_Analyzer : DiagnosticAnalyzer 26952private class AnalyzerActions_05_Analyzer : DiagnosticAnalyzer 27266private class AnalyzerActions_07_Analyzer : DiagnosticAnalyzer 27589private class AnalyzerActions_09_Analyzer : DiagnosticAnalyzer
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (17)
ConvertToRecord\ConvertToRecordCodeRefactoringTests.cs (1)
4750private class TestAnalyzer : DiagnosticAnalyzer
Diagnostics\Configuration\ConfigureSeverity\AllAnalyzersSeverityConfigurationTests.cs (1)
23private sealed class CustomDiagnosticAnalyzer : DiagnosticAnalyzer
Diagnostics\Configuration\ConfigureSeverity\CategoryBasedSeverityConfigurationTests.cs (1)
23private sealed class CustomDiagnosticAnalyzer : DiagnosticAnalyzer
Diagnostics\Configuration\ConfigureSeverity\DotNetDiagnosticSeverityBasedSeverityConfigurationTests.cs (1)
23private sealed class CustomDiagnosticAnalyzer : DiagnosticAnalyzer
Diagnostics\Suppression\RemoveSuppressionTests.cs (1)
26protected class UserDiagnosticAnalyzer : DiagnosticAnalyzer
Diagnostics\Suppression\RemoveUnnecessaryPragmaSuppressionsTests.cs (3)
54protected sealed class UserDiagnosticAnalyzer : DiagnosticAnalyzer 111protected sealed class CompilationEndDiagnosticAnalyzer : DiagnosticAnalyzer 1294private sealed class NonLocalDiagnosticsAnalyzer : DiagnosticAnalyzer
Diagnostics\Suppression\SuppressionTest_FixMultipleTests.cs (1)
36private class UserDiagnosticAnalyzer : DiagnosticAnalyzer
Diagnostics\Suppression\SuppressionTests.cs (7)
690private class UserDiagnosticAnalyzer : DiagnosticAnalyzer 800private class UserDiagnosticAnalyzer : DiagnosticAnalyzer 863private class UserDiagnosticAnalyzer : DiagnosticAnalyzer 913private class UserDiagnosticAnalyzer : DiagnosticAnalyzer 1054private class UserDiagnosticAnalyzer : DiagnosticAnalyzer 2054private class UserDiagnosticAnalyzer : DiagnosticAnalyzer 2449private class UserDiagnosticAnalyzer : DiagnosticAnalyzer
src\Analyzers\CSharp\Tests\ConvertToRecord\ConvertToRecordCodeFixTests.cs (1)
160private class TestAnalyzer : DiagnosticAnalyzer
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (22)
Semantics\ColorColorTests.cs (1)
1766class ColorColorSymbolInfoInArrowExpressionClauseSyntaxAnalyzer : DiagnosticAnalyzer
Semantics\RecordStructTests.cs (7)
5931private class AnalyzerActions_01_Analyzer : DiagnosticAnalyzer 6165private class AnalyzerActions_02_Analyzer : DiagnosticAnalyzer 6256private class AnalyzerActions_03_Analyzer : DiagnosticAnalyzer 6393private class AnalyzerActions_04_Analyzer : DiagnosticAnalyzer 6493private class AnalyzerActions_05_Analyzer : DiagnosticAnalyzer 6550private class AnalyzerActions_07_Analyzer : DiagnosticAnalyzer 6797private class AnalyzerActions_09_Analyzer : DiagnosticAnalyzer
Semantics\TopLevelStatementsTests.cs (13)
6416private class AnalyzerActions_01_Analyzer : DiagnosticAnalyzer 6517private class AnalyzerActions_02_Analyzer : DiagnosticAnalyzer 6586private class AnalyzerActions_03_Analyzer : DiagnosticAnalyzer 6699private class AnalyzerActions_04_Analyzer : DiagnosticAnalyzer 6782private class AnalyzerActions_05_Analyzer : DiagnosticAnalyzer 6840private class AnalyzerActions_06_Analyzer : DiagnosticAnalyzer 6898private class AnalyzerActions_07_Analyzer : DiagnosticAnalyzer 6966private class AnalyzerActions_08_Analyzer : DiagnosticAnalyzer 7045private class AnalyzerActions_09_Analyzer : DiagnosticAnalyzer 7160private class AnalyzerActions_10_Analyzer : DiagnosticAnalyzer 7254private class AnalyzerActions_11_Analyzer : DiagnosticAnalyzer 7327private class AnalyzerActions_12_Analyzer : DiagnosticAnalyzer 7394private class AnalyzerActions_13_Analyzer : DiagnosticAnalyzer
SourceGeneration\GeneratorDriverTests.cs (1)
173private class Analyzer_Is_Run_Analyzer : DiagnosticAnalyzer
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (3)
Symbols\Source\NullablePublicAPITests.cs (3)
1153private class NullabilityPrinter : DiagnosticAnalyzer 1774private class CSharp73ProvidesNullableSemanticInfo_Analyzer : DiagnosticAnalyzer 4830private class AutoPropInitializer_02_Analyzer : DiagnosticAnalyzer
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (6)
CodeFixes\CodeFixServiceTests.cs (3)
531public class MockDiagnosticAnalyzer : DiagnosticAnalyzer 908internal sealed class AdditionalFileAnalyzer : DiagnosticAnalyzer 1162public sealed class DeprioritizedAnalyzer : DiagnosticAnalyzer
Diagnostics\DiagnosticAnalyzerServiceTests.cs (3)
913private class Analyzer : DiagnosticAnalyzer 929private class DisabledByDefaultAnalyzer : DiagnosticAnalyzer 1031private class NamedTypeAnalyzer : DiagnosticAnalyzer
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (19)
CodeFixes\CodeFixServiceTests.vb (1)
190Inherits DiagnosticAnalyzer
Diagnostics\AdditionalFileDiagnosticsTests.vb (1)
66Inherits DiagnosticAnalyzer
Diagnostics\DiagnosticServiceTests.vb (17)
1246Inherits DiagnosticAnalyzer 1365Inherits DiagnosticAnalyzer 1441Inherits DiagnosticAnalyzer 1533Inherits DiagnosticAnalyzer 1553Inherits DiagnosticAnalyzer 1586Inherits DiagnosticAnalyzer 1610Inherits DiagnosticAnalyzer 1629Inherits DiagnosticAnalyzer 1653Inherits DiagnosticAnalyzer 1681Inherits DiagnosticAnalyzer 1707Inherits DiagnosticAnalyzer 1733Inherits DiagnosticAnalyzer 1756Inherits DiagnosticAnalyzer 1795Inherits DiagnosticAnalyzer 1869Inherits DiagnosticAnalyzer 2377Inherits DiagnosticAnalyzer 2494Inherits DiagnosticAnalyzer
Microsoft.CodeAnalysis.Features (4)
Diagnostics\Analyzers\UnboundIdentifiersDiagnosticAnalyzerBase.cs (1)
23internal abstract class UnboundIdentifiersDiagnosticAnalyzerBase<TLanguageKindEnum, TSimpleNameSyntax, TQualifiedNameSyntax, TIncompleteMemberSyntax> : DiagnosticAnalyzer, IBuiltInAnalyzer
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (1)
14internal abstract partial class AbstractBuiltInCodeStyleDiagnosticAnalyzer : DiagnosticAnalyzer, IBuiltInAnalyzer
src\Analyzers\Core\Analyzers\AbstractCodeQualityDiagnosticAnalyzer.cs (1)
12internal abstract class AbstractCodeQualityDiagnosticAnalyzer : DiagnosticAnalyzer, IBuiltInAnalyzer
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
16: DiagnosticAnalyzer
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (7)
Diagnostics\AdditionalFileDiagnosticsTests.cs (1)
123private class MockAdditionalFileDiagnosticAnalyzer : DiagnosticAnalyzer
Diagnostics\BuildOnlyDiagnosticIdsHandlerTests.cs (2)
89private sealed class BuildOnlyAnalyzer : DiagnosticAnalyzer 101private sealed class LiveAnalyzer : DiagnosticAnalyzer
Diagnostics\NonLocalDiagnosticTests.cs (1)
76private sealed class NonLocalDiagnosticsAnalyzer : DiagnosticAnalyzer
Diagnostics\PullDiagnosticTests.cs (2)
127private sealed class CSharpSyntaxAnalyzer : DiagnosticAnalyzer 141private sealed class CSharpSemanticAnalyzer : DiagnosticAnalyzer
Diagnostics\WorkspaceProjectDiagnosticsTests.cs (1)
72private class MockProjectDiagnosticAnalyzer : DiagnosticAnalyzer
Microsoft.CodeAnalysis.Rebuild.UnitTests (2)
DeterministicKeyBuilderTests.Helpers.cs (2)
30private sealed class Analyzer : DiagnosticAnalyzer 37private sealed class Analyzer2 : DiagnosticAnalyzer
Microsoft.CodeAnalysis.Test.Utilities (94)
Diagnostics\BoxingOperationAnalyzer.cs (1)
15public class BoxingOperationAnalyzer : DiagnosticAnalyzer
Diagnostics\CommonDiagnosticAnalyzers.cs (45)
29public class AnalyzerForErrorLogTest : DiagnosticAnalyzer 531public class NotConfigurableDiagnosticAnalyzer : DiagnosticAnalyzer 573public class CodeBlockActionAnalyzer : DiagnosticAnalyzer 638public abstract class CodeBlockObjectCreationAnalyzer<TLanguageKindEnum> : DiagnosticAnalyzer 666public class CSharpGenericNameAnalyzer : DiagnosticAnalyzer 704public abstract class AbstractNamespaceDeclarationAnalyzer<TLanguageKindEnum> : DiagnosticAnalyzer 733public sealed class AnalyzerWithNoActions : DiagnosticAnalyzer 748public sealed class AnalyzerWithDisabledRules : DiagnosticAnalyzer 772public sealed class EnsureNoMergedNamespaceSymbolAnalyzer : DiagnosticAnalyzer 804public sealed class AnalyzerWithNoSupportedDiagnostics : DiagnosticAnalyzer 811public sealed class AnalyzerWithInvalidDiagnosticId : DiagnosticAnalyzer 830public sealed class AnalyzerWithNullDescriptor : DiagnosticAnalyzer 840public sealed class AnalyzerWithCSharpCompilerDiagnosticId : DiagnosticAnalyzer 861public sealed class AnalyzerWithBasicCompilerDiagnosticId : DiagnosticAnalyzer 882public sealed class AnalyzerWithInvalidDiagnosticSpan : DiagnosticAnalyzer 916public sealed class AnalyzerWithInvalidDiagnosticLocation : DiagnosticAnalyzer 981public sealed class AnalyzerThatThrowsInSupportedDiagnostics : DiagnosticAnalyzer 988public sealed class AnalyzerThatThrowsInGetMessage : DiagnosticAnalyzer 1027public sealed class AnalyzerReportingMisformattedDiagnostic : DiagnosticAnalyzer 1049public class CompilationAnalyzerWithSeverity : DiagnosticAnalyzer 1087public class SemanticModelAnalyzerWithId : DiagnosticAnalyzer 1116public class ConcurrentAnalyzer : DiagnosticAnalyzer 1188public class NonConcurrentAnalyzer : DiagnosticAnalyzer 1226public sealed class OperationAnalyzer : DiagnosticAnalyzer 1375public sealed class OperationBlockAnalyzer : DiagnosticAnalyzer 1400public sealed class FieldReferenceOperationAnalyzer : DiagnosticAnalyzer 1451public sealed class MethodOrConstructorBodyOperationAnalyzer : DiagnosticAnalyzer 1472public abstract class AbstractGeneratedCodeAnalyzer<TSyntaxKind> : DiagnosticAnalyzer 1681public class GeneratedCodeAnalyzer2 : DiagnosticAnalyzer 1715public class SharedStateAnalyzer : DiagnosticAnalyzer 1845public class AnalyzerForParameters : DiagnosticAnalyzer 1869public class SymbolStartAnalyzer : DiagnosticAnalyzer 2383public sealed class NamedTypeAnalyzer : DiagnosticAnalyzer 2467public sealed class AnalyzerWithNoLocationDiagnostics : DiagnosticAnalyzer 2491public sealed class NamedTypeAnalyzerWithConfigurableEnabledByDefault : DiagnosticAnalyzer 2550public sealed class RegisterOperationBlockAndOperationActionAnalyzer : DiagnosticAnalyzer 2575public sealed class FieldAnalyzer : DiagnosticAnalyzer 2617public class AdditionalFileAnalyzer : DiagnosticAnalyzer 2666public sealed class RegisterSyntaxTreeCancellationAnalyzer : DiagnosticAnalyzer 2703public sealed class LocalNonLocalDiagnosticsAnalyzer : DiagnosticAnalyzer 2858public sealed class VariableDeclarationAnalyzer : DiagnosticAnalyzer 2904internal sealed class CancellationTestAnalyzer : DiagnosticAnalyzer 2973public sealed class AllActionsAnalyzer : DiagnosticAnalyzer 3060public sealed class FilterSpanTestAnalyzer : DiagnosticAnalyzer 3224public class MinimumReportedSeverityAnalyzer : DiagnosticAnalyzer
Diagnostics\CouldHaveMoreSpecificTypeAnalyzer.cs (1)
16public class SymbolCouldHaveMoreSpecificTypeAnalyzer : DiagnosticAnalyzer
Diagnostics\EmptyArrayAnalyzer.cs (1)
15public class EmptyArrayAnalyzer : DiagnosticAnalyzer
Diagnostics\FieldCouldBeReadOnlyAnalyzer.cs (1)
16public class FieldCouldBeReadOnlyAnalyzer : DiagnosticAnalyzer
Diagnostics\LocalCouldBeConstAnalyzer.cs (1)
16public class LocalCouldBeConstAnalyzer : DiagnosticAnalyzer
Diagnostics\OperationTestAnalyzer.cs (35)
20public class BadStuffTestAnalyzer : DiagnosticAnalyzer 82public class OwningSymbolTestAnalyzer : DiagnosticAnalyzer 120public class BigForTestAnalyzer : DiagnosticAnalyzer 293public class SwitchTestAnalyzer : DiagnosticAnalyzer 489public class InvocationTestAnalyzer : DiagnosticAnalyzer 606public class SeventeenTestAnalyzer : DiagnosticAnalyzer 643public class NullArgumentTestAnalyzer : DiagnosticAnalyzer 683public class MemberInitializerTestAnalyzer : DiagnosticAnalyzer 729public class AssignmentTestAnalyzer : DiagnosticAnalyzer 770public class ArrayInitializerTestAnalyzer : DiagnosticAnalyzer 810public class VariableDeclarationTestAnalyzer : DiagnosticAnalyzer 867public class CaseTestAnalyzer : DiagnosticAnalyzer 928public class ExplicitVsImplicitInstanceAnalyzer : DiagnosticAnalyzer 962public class MemberReferenceAnalyzer : DiagnosticAnalyzer 1075public class ParamsArrayTestAnalyzer : DiagnosticAnalyzer 1164public class EqualsValueTestAnalyzer : DiagnosticAnalyzer 1203public class NoneOperationTestAnalyzer : DiagnosticAnalyzer 1233public class AddressOfTestAnalyzer : DiagnosticAnalyzer 1274public class LambdaTestAnalyzer : DiagnosticAnalyzer 1343public class StaticMemberTestAnalyzer : DiagnosticAnalyzer 1424public class LabelOperationsTestAnalyzer : DiagnosticAnalyzer 1474public class UnaryAndBinaryOperationsTestAnalyzer : DiagnosticAnalyzer 1551public class BinaryOperatorVBTestAnalyzer : DiagnosticAnalyzer 1582public class OperatorPropertyPullerTestAnalyzer : DiagnosticAnalyzer 1661public class NullOperationSyntaxTestAnalyzer : DiagnosticAnalyzer 1748public class InvalidOperatorExpressionTestAnalyzer : DiagnosticAnalyzer 1817public class ConditionalAccessOperationTestAnalyzer : DiagnosticAnalyzer 1872public class ConversionExpressionCSharpTestAnalyzer : DiagnosticAnalyzer 1904public class ForLoopConditionCrashVBTestAnalyzer : DiagnosticAnalyzer 1943public class TrueFalseUnaryOperationTestAnalyzer : DiagnosticAnalyzer 1985public class AssignmentOperationSyntaxTestAnalyzer : DiagnosticAnalyzer 2029public class LiteralTestAnalyzer : DiagnosticAnalyzer 2059public class AnalysisContextAnalyzer : DiagnosticAnalyzer 2087public class CompilationStartAnalysisContextAnalyzer : DiagnosticAnalyzer 2119public class SemanticModelAnalyzer : DiagnosticAnalyzer
Diagnostics\SuppressMessageAttributeTests.DiagnosticAnalyzers.cs (8)
25protected class WarningOnCompilationEndedAnalyzer : DiagnosticAnalyzer 50protected class WarningOnNamePrefixDeclarationAnalyzer : DiagnosticAnalyzer 90protected class WarningOnTypeDeclarationAnalyzer : DiagnosticAnalyzer 115protected class WarningOnCodeBodyAnalyzer : DiagnosticAnalyzer 187protected class WarningOnCommentAnalyzer : DiagnosticAnalyzer 220protected class WarningOnTokenAnalyzer : DiagnosticAnalyzer 256protected class ThrowExceptionForEachNamedTypeAnalyzer : DiagnosticAnalyzer 290protected class ThrowExceptionFromSupportedDiagnostics : DiagnosticAnalyzer
Diagnostics\TestDiagnosticAnalyzer.cs (1)
15public abstract class TestDiagnosticAnalyzer<TLanguageKindEnum> : DiagnosticAnalyzer where TLanguageKindEnum : struct
Microsoft.CodeAnalysis.UnitTests (9)
Analyzers\AnalyzerFileReferenceTests.cs (7)
596public class TestAnalyzer : DiagnosticAnalyzer 603public class TestAnalyzerCS : DiagnosticAnalyzer 610public class TestAnalyzerVB : DiagnosticAnalyzer 626public class NestedAnalyzer : DiagnosticAnalyzer 659public class TestAnalyzerCSVB : DiagnosticAnalyzer 669public abstract class AbstractAnalyzer : DiagnosticAnalyzer 676public class OpenGenericAnalyzer<T> : DiagnosticAnalyzer
Diagnostics\AnalysisContextInfoTests.cs (1)
53private class Analyzer : DiagnosticAnalyzer
Diagnostics\DiagnosticLocalizationTests.cs (1)
365private class MyAnalyzer : DiagnosticAnalyzer
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (1)
CommandLineTests.vb (1)
10910Inherits DiagnosticAnalyzer
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (7)
Diagnostics\Configuration\ConfigureSeverity\DotNetDiagnosticSeverityBasedSeverityConfigurationTests.vb (1)
17Inherits DiagnosticAnalyzer
Diagnostics\Suppression\SuppressionTests.vb (6)
695Inherits DiagnosticAnalyzer 770Inherits DiagnosticAnalyzer 814Inherits DiagnosticAnalyzer 880Inherits DiagnosticAnalyzer 1000Inherits DiagnosticAnalyzer 1716Inherits DiagnosticAnalyzer
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (12)
Diagnostics\DiagnosticAnalyzerTests.vb (10)
25Inherits DiagnosticAnalyzer 213Inherits DiagnosticAnalyzer 229Inherits DiagnosticAnalyzer 263Inherits DiagnosticAnalyzer 301Inherits DiagnosticAnalyzer 346Inherits DiagnosticAnalyzer 397Inherits DiagnosticAnalyzer 495Inherits DiagnosticAnalyzer 560Inherits DiagnosticAnalyzer 948Inherits DiagnosticAnalyzer
Diagnostics\GetDiagnosticsTests.vb (2)
585Inherits DiagnosticAnalyzer 709Inherits DiagnosticAnalyzer
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (1)
Parser\ParseDirectives.vb (1)
3151Inherits DiagnosticAnalyzer
Microsoft.CodeAnalysis.Workspaces (4)
Diagnostics\DocumentDiagnosticAnalyzer.cs (1)
16internal abstract class DocumentDiagnosticAnalyzer : DiagnosticAnalyzer
Diagnostics\FileContentLoadAnalyzer.cs (1)
14internal sealed class FileContentLoadAnalyzer : DiagnosticAnalyzer
Diagnostics\GeneratorDiagnosticsPlaceholderAnalyzer.cs (1)
12internal sealed class GeneratorDiagnosticsPlaceholderAnalyzer : DiagnosticAnalyzer
Diagnostics\ProjectDiagnosticAnalyzer.cs (1)
16internal abstract class ProjectDiagnosticAnalyzer : DiagnosticAnalyzer
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
BatchFixAllProviderTests.cs (1)
54private class LiteralZeroAnalyzer : DiagnosticAnalyzer
SolutionTests\SolutionTests.cs (1)
2962private class MockDiagnosticAnalyzer : DiagnosticAnalyzer
Microsoft.DotNet.CodeAnalysis (1)
Analyzers\BaseAnalyzer.cs (1)
10public abstract class BaseAnalyzer : DiagnosticAnalyzer
Microsoft.Interop.ComInterfaceGenerator (5)
Analyzers\AddGeneratedComClassAnalyzer.cs (1)
14public class AddGeneratedComClassAnalyzer : DiagnosticAnalyzer
Analyzers\ComHostingDoesNotSupportGeneratedComInterfaceAnalyzer.cs (1)
15public class ComHostingDoesNotSupportGeneratedComInterfaceAnalyzer : 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
Microsoft.Interop.LibraryImportGenerator (3)
Analyzers\ConvertToLibraryImportAnalyzer.cs (1)
19public class ConvertToLibraryImportAnalyzer : DiagnosticAnalyzer
Analyzers\CustomMarshallerAttributeAnalyzer.cs (1)
19public class CustomMarshallerAttributeAnalyzer : DiagnosticAnalyzer
Analyzers\NativeMarshallingAttributeAnalyzer.cs (1)
20public class NativeMarshallingAttributeAnalyzer : 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
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
EditorConfigSettings\DataProvider\DataProviderTests.MockAnalyzerReference.cs (1)
71public class MockDiagnosticAnalyzer : DiagnosticAnalyzer
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
Diagnostics\ExternalDiagnosticUpdateSourceTests.vb (1)
266Inherits DiagnosticAnalyzer
Roslyn.VisualStudio.Next.UnitTests (2)
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (2)
263private class MyAnalyzer : DiagnosticAnalyzer 283private class DuplicateAnalyzer : DiagnosticAnalyzer
System.Private.CoreLib.Generators (1)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (1)
25public class IntrinsicsInSystemPrivateCoreLibAnalyzer : DiagnosticAnalyzer
System.Text.RegularExpressions.Generator (1)
UpgradeToGeneratedRegexAnalyzer.cs (1)
21public 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 (2)
System\Windows\Forms\CSharp\Analyzers\AvoidPassingTaskWithoutCancellationToken\AvoidPassingTaskWithoutCancellationTokenAnalyzer.cs (1)
14public class AvoidPassingTaskWithoutCancellationTokenAnalyzer : DiagnosticAnalyzer
System\Windows\Forms\CSharp\Analyzers\MissingPropertySerializationConfiguration\MissingPropertySerializationConfigurationAnalyzer.cs (1)
13public class MissingPropertySerializationConfigurationAnalyzer : DiagnosticAnalyzer
System.Windows.Forms.Analyzers.VisualBasic (2)
Analyzers\AvoidPassingTaskWithoutCancellationToken\AvoidPassingTaskWithoutCancellationTokenAnalyzer.vb (1)
14Inherits DiagnosticAnalyzer
Analyzers\MissingPropertySerializationConfiguration\MissingPropertySerializationConfigurationDiagnosticAnalyzer.vb (1)
13Inherits DiagnosticAnalyzer
1670 references to DiagnosticAnalyzer
AnalyzerRunner (14)
DiagnosticAnalyzerRunner.cs (14)
27private readonly ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> _analyzers; 178private static async Task<DocumentAnalyzerPerformance> TestDocumentPerformanceAsync(ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> analyzers, Project project, DocumentId documentId, Options analyzerOptionsInternal, CancellationToken cancellationToken) 182languageAnalyzers = ImmutableArray<DiagnosticAnalyzer>.Empty; 232private static ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> FilterAnalyzers(ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> analyzers, Options options) 239private static IEnumerable<DiagnosticAnalyzer> FilterAnalyzers(IEnumerable<DiagnosticAnalyzer> analyzers, Options options) 259foreach (var analyzer in analyzers) 285private static ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> GetDiagnosticAnalyzers(string path) 304private static ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> GetDiagnosticAnalyzersFromFile(string path) 309return ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>>.Empty 316ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> analyzers, 380ImmutableArray<DiagnosticAnalyzer> analyzers, 414var telemetryInfoDictionary = new Dictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo>();
Aspire.Hosting.Analyzers.Tests (1)
AnalyzerTest.cs (1)
15where TAnalyzer : DiagnosticAnalyzer, new()
CodeStyleConfigFileGenerator (1)
Program.cs (1)
59foreach (var analyzer in analyzers)
GenerateRulesMissingDocumentation (1)
Program.cs (1)
157foreach (var analyzer in analyzers)
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.AspNetCore.Analyzer.Testing (5)
DiagnosticAnalyzerRunner.cs (3)
15/// Base type for executing a <see cref="DiagnosticAnalyzer" />. Derived types implemented in the test assembly will 33DiagnosticAnalyzer analyzer, 55DiagnosticAnalyzer analyzer,
DiagnosticVerifier.cs (2)
58protected Task<Diagnostic[]> GetDiagnosticsAsync(string[] sources, DiagnosticAnalyzer analyzer, string[] additionalEnabledDiagnostics) 71protected async Task<Diagnostic[]> GetDiagnosticsAsync(Document[] documents, DiagnosticAnalyzer analyzer, string[] additionalEnabledDiagnostics)
Microsoft.AspNetCore.Analyzers.Test (1)
StartupCSharpAnalyzerTest.cs (1)
23protected override IEnumerable<DiagnosticAnalyzer> GetDiagnosticAnalyzers() => new[] { StartupAnalyzer };
Microsoft.AspNetCore.App.Analyzers.Test (4)
TestDiagnosticAnalyzer.cs (2)
22public TestDiagnosticAnalyzerRunner(DiagnosticAnalyzer analyzer) 27public DiagnosticAnalyzer Analyzer { get; }
Verifiers\CSharpAnalyzerVerifier.cs (1)
19where TAnalyzer : DiagnosticAnalyzer, new()
Verifiers\CSharpCodeFixVerifier.cs (1)
14where TAnalyzer : DiagnosticAnalyzer, new()
Microsoft.AspNetCore.Components.Analyzers.Tests (18)
ComponentAnalyzerDiagnosticAnalyzerRunner.cs (2)
12public ComponentAnalyzerDiagnosticAnalyzerRunner(DiagnosticAnalyzer analyzer) 17public DiagnosticAnalyzer Analyzer { get; }
ComponentParameterCaptureUnmatchedValuesHasWrongTypeTest.cs (1)
74protected override DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer()
ComponentParameterCaptureUnmatchedValuesMustBeUniqueTest.cs (1)
62protected override DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer()
ComponentParameterSettersShouldBePublicTest.cs (1)
108protected override DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer() => new ComponentParameterAnalyzer();
ComponentParameterShouldBeAutoPropertiesTest.cs (1)
151protected override DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer() => new ComponentParameterAnalyzer();
ComponentParametersShouldBePublicCodeFixProviderTest.cs (1)
120protected override DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer()
ComponentParametersShouldBePublicTest.cs (1)
103protected override DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer() => new ComponentParameterAnalyzer();
ComponentParameterUsageAnalyzerTest.cs (1)
358protected override DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer() => new ComponentParameterUsageAnalyzer();
Helpers\DiagnosticVerifier.Helper.cs (2)
39private static Diagnostic[] GetSortedDiagnostics(string[] sources, string language, DiagnosticAnalyzer analyzer) 51protected static Diagnostic[] GetSortedDiagnosticsFromDocuments(DiagnosticAnalyzer analyzer, Document[] documents)
Verifiers\CodeFixVerifier.cs (1)
76private void VerifyFix(string language, DiagnosticAnalyzer analyzer, CodeFixProvider codeFixProvider, string oldSource, string newSource, int? codeFixIndex, bool allowNewCompilerDiagnostics)
Verifiers\DiagnosticVerifier.cs (6)
22protected virtual DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer() 30protected virtual DiagnosticAnalyzer GetBasicDiagnosticAnalyzer() 90private void VerifyDiagnostics(string[] sources, string language, DiagnosticAnalyzer analyzer, params DiagnosticResult[] expected) 106private static void VerifyDiagnosticResults(IEnumerable<Diagnostic> actualResults, DiagnosticAnalyzer analyzer, params DiagnosticResult[] expectedResults) 190private static void VerifyDiagnosticLocation(DiagnosticAnalyzer analyzer, Diagnostic diagnostic, Location actual, DiagnosticResultLocation expected) 237private static string FormatDiagnostics(DiagnosticAnalyzer analyzer, params Diagnostic[] diagnostics)
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (17)
ComponentAnalyzerDiagnosticAnalyzerRunner.cs (2)
12public ComponentAnalyzerDiagnosticAnalyzerRunner(DiagnosticAnalyzer analyzer) 17public DiagnosticAnalyzer Analyzer { get; }
ComponentParameterCaptureUnmatchedValuesHasWrongTypeTest.cs (1)
74protected override DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer()
ComponentParameterCaptureUnmatchedValuesMustBeUniqueTest.cs (1)
62protected override DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer()
ComponentParameterSettersShouldBePublicTest.cs (1)
108protected override DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer() => new ComponentParameterAnalyzer();
ComponentParametersShouldBePublicCodeFixProviderTest.cs (1)
120protected override DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer()
ComponentParametersShouldBePublicTest.cs (1)
103protected override DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer() => new ComponentParameterAnalyzer();
ComponentParameterUsageAnalyzerTest.cs (1)
358protected override DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer() => new ComponentParameterUsageAnalyzer();
Helpers\DiagnosticVerifier.Helper.cs (2)
39private static Diagnostic[] GetSortedDiagnostics(string[] sources, string language, DiagnosticAnalyzer analyzer) 51protected static Diagnostic[] GetSortedDiagnosticsFromDocuments(DiagnosticAnalyzer analyzer, Document[] documents)
Verifiers\CodeFixVerifier.cs (1)
76private void VerifyFix(string language, DiagnosticAnalyzer analyzer, CodeFixProvider codeFixProvider, string oldSource, string newSource, int? codeFixIndex, bool allowNewCompilerDiagnostics)
Verifiers\DiagnosticVerifier.cs (6)
22protected virtual DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer() 30protected virtual DiagnosticAnalyzer GetBasicDiagnosticAnalyzer() 90private void VerifyDiagnostics(string[] sources, string language, DiagnosticAnalyzer analyzer, params DiagnosticResult[] expected) 106private static void VerifyDiagnosticResults(IEnumerable<Diagnostic> actualResults, DiagnosticAnalyzer analyzer, params DiagnosticResult[] expectedResults) 190private static void VerifyDiagnosticLocation(DiagnosticAnalyzer analyzer, Diagnostic diagnostic, Location actual, DiagnosticResultLocation expected) 237private static string FormatDiagnostics(DiagnosticAnalyzer analyzer, params Diagnostic[] diagnostics)
Microsoft.CodeAnalysis (490)
CommandLine\CommandLineArguments.cs (4)
190/// Skip execution of <see cref="DiagnosticAnalyzer"/>s. 477out ImmutableArray<DiagnosticAnalyzer> analyzers, 480var analyzerBuilder = ImmutableArray.CreateBuilder<DiagnosticAnalyzer>(); 562bool shouldIncludeAnalyzer(DiagnosticAnalyzer analyzer) => !skipAnalyzers || analyzer is DiagnosticSuppressor;
CommandLine\CommonCompiler.cs (3)
122out ImmutableArray<DiagnosticAnalyzer> analyzers, 1097ImmutableArray<DiagnosticAnalyzer> analyzers, 1747ImmutableArray<DiagnosticAnalyzer> analyzers,
CommandLine\ReportAnalyzerUtil.cs (1)
105private static IEnumerable<string> GetSupportedIds(DiagnosticAnalyzer analyzer)
Compilation\Compilation.cs (3)
125internal abstract AnalyzerDriver CreateAnalyzerDriver(ImmutableArray<DiagnosticAnalyzer> analyzers, AnalyzerManager analyzerManager, SeverityFilter severityFilter); 200ImmutableArray<DiagnosticAnalyzer> analyzers = default, 212ImmutableArray<DiagnosticAnalyzer> analyzers = default,
Compilation\DeterministicKey.cs (2)
56ImmutableArray<DiagnosticAnalyzer> analyzers = default, 83ImmutableArray<DiagnosticAnalyzer> analyzers = default,
Compilation\DeterministicKeyBuilder.cs (2)
126ImmutableArray<DiagnosticAnalyzer> analyzers, 175foreach (var analyzer in analyzers)
Diagnostic\WellKnownDiagnosticTags.cs (1)
54/// Indicates that the diagnostic is related to an exception thrown by a <see cref="DiagnosticAnalyzer"/>.
DiagnosticAnalyzer\AnalysisResult.cs (20)
22ImmutableArray<DiagnosticAnalyzer> analyzers, 23ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSyntaxDiagnostics, 24ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSemanticDiagnostics, 25ImmutableDictionary<AdditionalText, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localAdditionalFileDiagnostics, 26ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> nonLocalDiagnostics, 27ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo> analyzerTelemetryInfo) 40public ImmutableArray<DiagnosticAnalyzer> Analyzers { get; } 45public ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> SyntaxDiagnostics { get; } 50public ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> SemanticDiagnostics { get; } 55public ImmutableDictionary<AdditionalText, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> AdditionalFileDiagnostics { get; } 60public ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> CompilationDiagnostics { get; } 65public ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo> AnalyzerTelemetryInfo { get; } 70public ImmutableArray<Diagnostic> GetAllDiagnostics(DiagnosticAnalyzer analyzer) 88private ImmutableArray<Diagnostic> GetDiagnostics(IEnumerable<DiagnosticAnalyzer> analyzers) 91var excludedAnalyzersSet = excludedAnalyzers.Any() ? excludedAnalyzers.ToImmutableHashSet() : ImmutableHashSet<DiagnosticAnalyzer>.Empty; 95private ImmutableArray<Diagnostic> GetDiagnostics(ImmutableHashSet<DiagnosticAnalyzer> excludedAnalyzers) 112ImmutableDictionary<T, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localDiagnostics, 113ImmutableHashSet<DiagnosticAnalyzer> excludedAnalyzers, 132ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> nonLocalDiagnostics, 133ImmutableHashSet<DiagnosticAnalyzer> excludedAnalyzers,
DiagnosticAnalyzer\AnalysisResultBuilder.cs (64)
28private readonly Dictionary<DiagnosticAnalyzer, TimeSpan>? _analyzerExecutionTimeOpt; 29private readonly HashSet<DiagnosticAnalyzer> _completedAnalyzersForCompilation; 30private readonly Dictionary<SyntaxTree, HashSet<DiagnosticAnalyzer>> _completedSyntaxAnalyzersByTree; 31private readonly Dictionary<SyntaxTree, HashSet<DiagnosticAnalyzer>> _completedSemanticAnalyzersByTree; 32private readonly Dictionary<AdditionalText, HashSet<DiagnosticAnalyzer>> _completedSyntaxAnalyzersByAdditionalFile; 33private readonly Dictionary<DiagnosticAnalyzer, AnalyzerActionCounts> _analyzerActionCounts; 36private Dictionary<SyntaxTree, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? _localSemanticDiagnosticsOpt = null; 37private Dictionary<SyntaxTree, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? _localSyntaxDiagnosticsOpt = null; 38private Dictionary<AdditionalText, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? _localAdditionalFileDiagnosticsOpt = null; 39private Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>? _nonLocalDiagnosticsOpt = null; 41internal AnalysisResultBuilder(bool logAnalyzerExecutionTime, ImmutableArray<DiagnosticAnalyzer> analyzers, ImmutableArray<AdditionalText> additionalFiles) 44_completedAnalyzersForCompilation = new HashSet<DiagnosticAnalyzer>(); 45_completedSyntaxAnalyzersByTree = new Dictionary<SyntaxTree, HashSet<DiagnosticAnalyzer>>(); 46_completedSemanticAnalyzersByTree = new Dictionary<SyntaxTree, HashSet<DiagnosticAnalyzer>>(); 47_completedSyntaxAnalyzersByAdditionalFile = new Dictionary<AdditionalText, HashSet<DiagnosticAnalyzer>>(); 48_analyzerActionCounts = new Dictionary<DiagnosticAnalyzer, AnalyzerActionCounts>(analyzers.Length); 52private static Dictionary<DiagnosticAnalyzer, TimeSpan> CreateAnalyzerExecutionTimeMap(ImmutableArray<DiagnosticAnalyzer> analyzers) 54var map = new Dictionary<DiagnosticAnalyzer, TimeSpan>(analyzers.Length); 55foreach (var analyzer in analyzers) 94public TimeSpan GetAnalyzerExecutionTime(DiagnosticAnalyzer analyzer) 104private HashSet<DiagnosticAnalyzer>? GetCompletedAnalyzersForFile_NoLock(SourceOrAdditionalFile filterFile, bool syntax) 129private void AddCompletedAnalyzerForFile_NoLock(SourceOrAdditionalFile filterFile, bool syntax, DiagnosticAnalyzer analyzer) 131var completedAnalyzers = new HashSet<DiagnosticAnalyzer> { analyzer }; 159public ImmutableArray<DiagnosticAnalyzer> GetPendingAnalyzers(ImmutableArray<DiagnosticAnalyzer> analyzers, (SourceOrAdditionalFile file, bool syntax)? filterScope) 187public void ApplySuppressionsAndStoreAnalysisResult(AnalysisScope analysisScope, AnalyzerDriver driver, Compilation compilation, Func<DiagnosticAnalyzer, AnalyzerActionCounts> getAnalyzerActionCounts, CancellationToken cancellationToken) 189foreach (var analyzer in analysisScope.Analyzers) 327DiagnosticAnalyzer analyzer, 331ref Dictionary<TKey, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? lazyLocalDiagnostics) 339lazyLocalDiagnostics = lazyLocalDiagnostics ?? new Dictionary<TKey, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>(); 349Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>? allDiagnostics; 352allDiagnostics = new Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>(); 367private void UpdateNonLocalDiagnostics_NoLock(DiagnosticAnalyzer analyzer, ImmutableArray<Diagnostic> diagnostics, bool overwrite) 374_nonLocalDiagnosticsOpt = _nonLocalDiagnosticsOpt ?? new Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>(); 442Dictionary<TKey, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? lazyLocalDiagnostics, 457Dictionary<SyntaxTree, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? localDiagnostics, 463Dictionary<AdditionalText, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? localDiagnostics, 469Dictionary<TKey, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? localDiagnostics, 471ImmutableArray<DiagnosticAnalyzer> analyzers, 475Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>? diagnosticsForTree; 483Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder> diagnostics, 484ImmutableArray<DiagnosticAnalyzer> analyzers, 489foreach (var analyzer in analyzers) 499internal AnalysisResult ToAnalysisResult(ImmutableArray<DiagnosticAnalyzer> analyzers, AnalysisScope analysisScope, CancellationToken cancellationToken) 503ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSyntaxDiagnostics; 504ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSemanticDiagnostics; 505ImmutableDictionary<AdditionalText, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localAdditionalFileDiagnostics; 506ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> nonLocalDiagnostics; 523private static ImmutableDictionary<TKey, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> GetImmutable<TKey>( 524ImmutableHashSet<DiagnosticAnalyzer> analyzers, 526Dictionary<TKey, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? localDiagnosticsOpt) 531return ImmutableDictionary<TKey, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>>.Empty; 534var builder = ImmutableDictionary.CreateBuilder<TKey, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>>(); 535var perTreeBuilder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>(); 559private static ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> GetImmutable( 560ImmutableHashSet<DiagnosticAnalyzer> analyzers, 562Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>? nonLocalDiagnosticsOpt) 566return ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>.Empty; 569var builder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>(); 585private ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo> GetTelemetryInfo( 586ImmutableArray<DiagnosticAnalyzer> analyzers) 588var builder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, AnalyzerTelemetryInfo>(); 592foreach (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, AnalyzerOptions analyzerOptions, ImmutableArray<DiagnosticAnalyzer> analyzers) 109private static AnalysisScope Create(Compilation compilation, AnalyzerOptions? analyzerOptions, ImmutableArray<DiagnosticAnalyzer> analyzers, bool hasAllAnalyzers, bool concurrentAnalysis) 118public static AnalysisScope Create(ImmutableArray<DiagnosticAnalyzer> analyzers, SourceOrAdditionalFile filterFile, TextSpan? filterSpan, bool isSyntacticSingleFileAnalysis, CompilationWithAnalyzers compilationWithAnalyzers) 121public static AnalysisScope Create(ImmutableArray<DiagnosticAnalyzer> analyzers, SourceOrAdditionalFile filterFile, TextSpan? filterSpan, SourceOrAdditionalFile originalFilterFile, TextSpan? originalFilterSpan, bool isSyntacticSingleFileAnalysis, CompilationWithAnalyzers compilationWithAnalyzers) 133ImmutableArray<DiagnosticAnalyzer> analyzers, 155_lazyAnalyzersSet = new Lazy<ImmutableHashSet<DiagnosticAnalyzer>>(CreateAnalyzersSet); 179private ImmutableHashSet<DiagnosticAnalyzer> CreateAnalyzersSet() => Analyzers.ToImmutableHashSet(); 181public bool Contains(DiagnosticAnalyzer analyzer) 192public AnalysisScope WithAnalyzers(ImmutableArray<DiagnosticAnalyzer> analyzers, CompilationWithAnalyzers compilationWithAnalyzers) 198private static bool ComputeHasAllAnalyzers(ImmutableArray<DiagnosticAnalyzer> analyzers, CompilationWithAnalyzers compilationWithAnalyzers) 201foreach (var analyzer in analyzers)
DiagnosticAnalyzer\AnalyzerDriver.cs (117)
37private static readonly Func<DiagnosticAnalyzer, bool> s_IsCompilerAnalyzerFunc = IsCompilerAnalyzer; 64protected ImmutableArray<DiagnosticAnalyzer> Analyzers { get; } 94private ImmutableHashSet<DiagnosticAnalyzer>? _lazyUnsuppressedAnalyzers; 99protected ImmutableHashSet<DiagnosticAnalyzer> UnsuppressedAnalyzers 108private ConcurrentDictionary<(INamespaceOrTypeSymbol, DiagnosticAnalyzer), IGroupedAnalyzerActions>? _lazyPerSymbolAnalyzerActionsCache; 116private ConcurrentDictionary<(INamespaceOrTypeSymbol, DiagnosticAnalyzer), IGroupedAnalyzerActions> PerSymbolAnalyzerActionsCache 125private ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<ImmutableArray<SymbolAnalyzerAction>>)> _lazySymbolActionsByKind; 126private ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<SemanticModelAnalyzerAction>)> _lazySemanticModelActions; 127private ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<SyntaxTreeAnalyzerAction>)> _lazySyntaxTreeActions; 128private ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<AdditionalFileAnalyzerAction>)> _lazyAdditionalFileActions; 131private ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<CompilationAnalyzerAction>)> _lazyCompilationActions; 132private ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<CompilationAnalyzerAction>)> _lazyCompilationEndActions; 134private ImmutableHashSet<DiagnosticAnalyzer>? _lazyCompilationEndAnalyzers; 135private ImmutableHashSet<DiagnosticAnalyzer> CompilationEndAnalyzers 156private ImmutableSegmentedDictionary<DiagnosticAnalyzer, SemaphoreSlim> _lazyAnalyzerGateMap; 157private ImmutableSegmentedDictionary<DiagnosticAnalyzer, SemaphoreSlim> AnalyzerGateMap 166private ImmutableSegmentedDictionary<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags> _lazyGeneratedCodeAnalysisFlagsMap; 171private ImmutableSegmentedDictionary<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags> GeneratedCodeAnalysisFlagsMap 186private ImmutableHashSet<DiagnosticAnalyzer>? _lazyNonConfigurableAndCustomConfigurableAnalyzers; 191private ImmutableHashSet<DiagnosticAnalyzer> NonConfigurableAndCustomConfigurableAnalyzers 200private ImmutableHashSet<DiagnosticAnalyzer>? _lazySymbolStartAnalyzers; 205private ImmutableHashSet<DiagnosticAnalyzer> SymbolStartAnalyzers 261private ConcurrentDictionary<SyntaxTree, ImmutableHashSet<DiagnosticAnalyzer>>? _lazySuppressedAnalyzersForTreeMap; 266private ConcurrentDictionary<SyntaxTree, ImmutableHashSet<DiagnosticAnalyzer>> SuppressedAnalyzersForTreeMap 371protected AnalyzerDriver(ImmutableArray<DiagnosticAnalyzer> analyzers, AnalyzerManager analyzerManager, SeverityFilter severityFilter, Func<SyntaxTrivia, bool> isComment) 383_lazyAnalyzerGateMap = ImmutableSegmentedDictionary<DiagnosticAnalyzer, SemaphoreSlim>.Empty; 422_lazySuppressedAnalyzersForTreeMap = new ConcurrentDictionary<SyntaxTree, ImmutableHashSet<DiagnosticAnalyzer>>(); 435_lazyPerSymbolAnalyzerActionsCache = new ConcurrentDictionary<(INamespaceOrTypeSymbol, DiagnosticAnalyzer), IGroupedAnalyzerActions>(); 477Action<Diagnostic, DiagnosticAnalyzer, bool, CancellationToken>? addCategorizedLocalDiagnostic = null; 478Action<Diagnostic, DiagnosticAnalyzer, CancellationToken>? addCategorizedNonLocalDiagnostic = null; 490Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> newOnAnalyzerException = (ex, analyzer, diagnostic, cancellationToken) => 519private SemaphoreSlim? GetAnalyzerGate(DiagnosticAnalyzer analyzer) 531private ImmutableHashSet<DiagnosticAnalyzer> ComputeNonConfigurableAndCustomConfigurableAnalyzers(ImmutableHashSet<DiagnosticAnalyzer> unsuppressedAnalyzers, CancellationToken cancellationToken) 533var builder = ImmutableHashSet.CreateBuilder<DiagnosticAnalyzer>(); 534foreach (var analyzer in unsuppressedAnalyzers) 550private ImmutableHashSet<DiagnosticAnalyzer> ComputeSymbolStartAnalyzers(ImmutableHashSet<DiagnosticAnalyzer> unsuppressedAnalyzers) 552var builder = ImmutableHashSet.CreateBuilder<DiagnosticAnalyzer>(); 565ImmutableHashSet<DiagnosticAnalyzer> analyzers, 566ImmutableSegmentedDictionary<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags> generatedCodeAnalysisFlagsMap, 569foreach (var analyzer in analyzers) 583private static bool ComputeShouldTreatAllCodeAsNonGeneratedCode(ImmutableHashSet<DiagnosticAnalyzer> analyzers, ImmutableSegmentedDictionary<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags> generatedCodeAnalysisFlagsMap) 585foreach (var analyzer in analyzers) 599private bool ShouldSkipAnalysisOnGeneratedCode(DiagnosticAnalyzer analyzer) 603DiagnosticAnalyzer analyzer, 604ImmutableSegmentedDictionary<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags> generatedCodeAnalysisFlagsMap, 616private bool ShouldSuppressGeneratedCodeDiagnostic(Diagnostic diagnostic, DiagnosticAnalyzer analyzer, Compilation compilation, CancellationToken cancellationToken) 716private static void OnDriverException(Task faultedTask, AnalyzerExecutor analyzerExecutor, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 730var analyzer = analyzers[0]; 814ImmutableArray<DiagnosticAnalyzer> analyzers, 824Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = 834ImmutableArray<DiagnosticAnalyzer> analyzers, 837Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException, 902foreach (var analyzer in Analyzers) 1179public ImmutableArray<Diagnostic> DequeueLocalDiagnosticsAndApplySuppressions(DiagnosticAnalyzer analyzer, bool syntax, Compilation compilation, CancellationToken cancellationToken) 1185public ImmutableArray<Diagnostic> DequeueNonLocalDiagnosticsAndApplySuppressions(DiagnosticAnalyzer analyzer, Compilation compilation, CancellationToken cancellationToken) 1355private bool IsAnalyzerSuppressedForTree(DiagnosticAnalyzer analyzer, SyntaxTree tree, SyntaxTreeOptionsProvider? options, CancellationToken cancellationToken) 1365private ImmutableHashSet<DiagnosticAnalyzer> ComputeSuppressedAnalyzersForTree(SyntaxTree tree, SyntaxTreeOptionsProvider? options, CancellationToken cancellationToken) 1369return ImmutableHashSet<DiagnosticAnalyzer>.Empty; 1372ImmutableHashSet<DiagnosticAnalyzer>.Builder? suppressedAnalyzersBuilder = null; 1373foreach (var analyzer in UnsuppressedAnalyzers) 1416suppressedAnalyzersBuilder ??= ImmutableHashSet.CreateBuilder<DiagnosticAnalyzer>(); 1421return suppressedAnalyzersBuilder != null ? suppressedAnalyzersBuilder.ToImmutable() : ImmutableHashSet<DiagnosticAnalyzer>.Empty; 1450internal ImmutableDictionary<DiagnosticAnalyzer, TimeSpan> AnalyzerExecutionTimes => AnalyzerExecutor.AnalyzerExecutionTimes; 1451internal TimeSpan ResetAnalyzerExecutionTime(DiagnosticAnalyzer analyzer) => AnalyzerExecutor.ResetAnalyzerExecutionTime(analyzer); 1453private static ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<ImmutableArray<SymbolAnalyzerAction>>)> MakeSymbolActionsByKind(in AnalyzerActions analyzerActions) 1455var builder = ArrayBuilder<(DiagnosticAnalyzer, ImmutableArray<ImmutableArray<SymbolAnalyzerAction>>)>.GetInstance(); 1484private static ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<TAnalyzerAction>)> MakeActionsByAnalyzer<TAnalyzerAction>(in ImmutableArray<TAnalyzerAction> analyzerActions) 1487var builder = ArrayBuilder<(DiagnosticAnalyzer, ImmutableArray<TAnalyzerAction>)>.GetInstance(); 1497private static ImmutableHashSet<DiagnosticAnalyzer> MakeCompilationEndAnalyzers(ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<CompilationAnalyzerAction>)> compilationEndActionsByAnalyzer) 1499var builder = ImmutableHashSet.CreateBuilder<DiagnosticAnalyzer>(); 1638ImmutableArray<DiagnosticAnalyzer> processedAnalyzers; 1656private async Task OnEventProcessedCoreAsync(CompilationEvent compilationEvent, ImmutableArray<DiagnosticAnalyzer> processedAnalyzers, AnalysisScope analysisScope, CancellationToken cancellationToken) 1663foreach (var analyzer in processedAnalyzers) 1685async Task onSymbolAndMembersProcessedAsync(ISymbol symbol, DiagnosticAnalyzer analyzer) 1703async Task processContainerOnMemberCompletedAsync(INamespaceOrTypeSymbol containerSymbol, ISymbol processedMemberSymbol, DiagnosticAnalyzer analyzer) 1815out ImmutableArray<DiagnosticAnalyzer> subsetProcessedAnalyzers) 1823subsetProcessedAnalyzers = ImmutableArray<DiagnosticAnalyzer>.Empty; 1828var completedAnalyzers = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(); 1829var processedAnalyzers = PooledHashSet<DiagnosticAnalyzer>.GetInstance(); 1856foreach (var analyzer in analysisScope.Analyzers) 1874subsetProcessedAnalyzers = ImmutableArray<DiagnosticAnalyzer>.Empty; 1939ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<CompilationAnalyzerAction>)> compilationActionsMap, 1969internal static Action<Diagnostic, DiagnosticAnalyzer, bool, CancellationToken> GetDiagnosticSink(Action<Diagnostic, DiagnosticAnalyzer, bool> addLocalDiagnosticCore, Compilation compilation, AnalyzerOptions? analyzerOptions, SeverityFilter severityFilter, ConcurrentSet<string>? suppressedDiagnosticIds) 1981internal static Action<Diagnostic, DiagnosticAnalyzer, CancellationToken> GetDiagnosticSink(Action<Diagnostic, DiagnosticAnalyzer> addDiagnosticCore, Compilation compilation, AnalyzerOptions? analyzerOptions, SeverityFilter severityFilter, ConcurrentSet<string>? suppressedDiagnosticIds) 2023private static async Task<(AnalyzerActions actions, ImmutableHashSet<DiagnosticAnalyzer> unsuppressedAnalyzers)> GetAnalyzerActionsAsync( 2024ImmutableArray<DiagnosticAnalyzer> analyzers, 2032var unsuppressedAnalyzersBuilder = PooledHashSet<DiagnosticAnalyzer>.GetInstance(); 2033foreach (var analyzer in analyzers) 2066var analyzer = analysisScope.Analyzers[0]; 2079var symbolStartAnalyzers = PooledHashSet<DiagnosticAnalyzer>.GetInstance(); 2087foreach (var analyzer in analysisScope.Analyzers) 2117foreach (var analyzer in analysisScope.Analyzers) 2139DiagnosticAnalyzer analyzer, 2167async ValueTask<IGroupedAnalyzerActions> getAllActionsAsync(AnalyzerDriver driver, ISymbol symbol, DiagnosticAnalyzer analyzer, SyntaxTree? filterTree, TextSpan? filterSpan, CancellationToken cancellationToken) 2183async ValueTask<IGroupedAnalyzerActions> getInheritedActionsAsync(AnalyzerDriver driver, ISymbol symbol, DiagnosticAnalyzer analyzer, SyntaxTree? filterTree, TextSpan? filterSpan, CancellationToken cancellationToken) 2207static async ValueTask<AnalyzerActions> getSymbolActionsCoreAsync(AnalyzerDriver driver, ISymbol symbol, DiagnosticAnalyzer analyzer, SyntaxTree? filterTree, TextSpan? filterSpan, CancellationToken cancellationToken) 2224private static async Task<ImmutableSegmentedDictionary<DiagnosticAnalyzer, SemaphoreSlim>> CreateAnalyzerGateMapAsync( 2225ImmutableHashSet<DiagnosticAnalyzer> analyzers, 2232var builder = ImmutableSegmentedDictionary.CreateBuilder<DiagnosticAnalyzer, SemaphoreSlim>(); 2233foreach (var analyzer in analyzers) 2249private static async Task<ImmutableSegmentedDictionary<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags>> CreateGeneratedCodeAnalysisFlagsMapAsync( 2250ImmutableHashSet<DiagnosticAnalyzer> analyzers, 2257var builder = ImmutableSegmentedDictionary.CreateBuilder<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags>(); 2258foreach (var analyzer in analyzers) 2358internal async Task<AnalyzerActionCounts> GetAnalyzerActionCountsAsync(DiagnosticAnalyzer analyzer, CompilationOptions compilationOptions, AnalysisScope analysisScope, CancellationToken cancellationToken) 2378DiagnosticAnalyzer analyzer, 2389internal static bool IsCompilerAnalyzer(DiagnosticAnalyzer analyzer) => analyzer is CompilerDiagnosticAnalyzer; 2416internal AnalyzerDriver(ImmutableArray<DiagnosticAnalyzer> analyzers, Func<SyntaxNode, TLanguageKindEnum> getKind, AnalyzerManager analyzerManager, SeverityFilter severityFilter, Func<SyntaxTrivia, bool> isComment) 2488protected override IGroupedAnalyzerActions CreateGroupedActions(DiagnosticAnalyzer analyzer, in AnalyzerActions analyzerActions) 2646DiagnosticAnalyzer analyzer, 2725var 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 (7)
16/// <see cref="AnalyzerActions"/> grouped by <see cref="DiagnosticAnalyzer"/>, and possibly other entities, such as <see cref="OperationKind"/>, <see cref="SymbolKind"/>, etc. 20public static readonly GroupedAnalyzerActions Empty = new GroupedAnalyzerActions(ImmutableArray<(DiagnosticAnalyzer, GroupedAnalyzerActionsForAnalyzer)>.Empty, AnalyzerActions.Empty); 22private GroupedAnalyzerActions(ImmutableArray<(DiagnosticAnalyzer, GroupedAnalyzerActionsForAnalyzer)> groupedActionsAndAnalyzers, in AnalyzerActions analyzerActions) 28public ImmutableArray<(DiagnosticAnalyzer analyzer, GroupedAnalyzerActionsForAnalyzer groupedActions)> GroupedActionsByAnalyzer { get; } 42public static GroupedAnalyzerActions Create(DiagnosticAnalyzer analyzer, in AnalyzerActions analyzerActions) 50var groupedActionsAndAnalyzers = ImmutableArray<(DiagnosticAnalyzer, GroupedAnalyzerActionsForAnalyzer)>.Empty.Add((analyzer, groupedActions)); 54public static GroupedAnalyzerActions Create(ImmutableArray<DiagnosticAnalyzer> analyzers, in AnalyzerActions analyzerActions)
DiagnosticAnalyzer\AnalyzerDriver.GroupedAnalyzerActionsForAnalyzer.cs (5)
16private readonly DiagnosticAnalyzer _analyzer; 28public GroupedAnalyzerActionsForAnalyzer(DiagnosticAnalyzer analyzer, in AnalyzerActions analyzerActions, bool analyzerActionsNeedFiltering) 40private static void VerifyActions<TAnalyzerAction>(in ImmutableArray<TAnalyzerAction> actions, DiagnosticAnalyzer analyzer) 55DiagnosticAnalyzer analyzer, 141DiagnosticAnalyzer analyzer,
DiagnosticAnalyzer\AnalyzerDriver.IGroupedAnalyzerActions.cs (1)
10protected abstract IGroupedAnalyzerActions CreateGroupedActions(DiagnosticAnalyzer analyzer, in AnalyzerActions analyzerActions);
DiagnosticAnalyzer\AnalyzerExecutor.AnalyzerDiagnosticReporter.cs (8)
31DiagnosticAnalyzer analyzer, 34Action<Diagnostic, DiagnosticAnalyzer, bool, CancellationToken>? addCategorizedLocalDiagnostic, 35Action<Diagnostic, DiagnosticAnalyzer, CancellationToken>? addCategorizedNonLocalDiagnostic, 36Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> shouldSuppressGeneratedCodeDiagnostic, 70private DiagnosticAnalyzer _analyzer; 73private Action<Diagnostic, DiagnosticAnalyzer, bool, CancellationToken>? _addCategorizedLocalDiagnostic; 74private Action<Diagnostic, DiagnosticAnalyzer, CancellationToken>? _addCategorizedNonLocalDiagnostic; 75private Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> _shouldSuppressGeneratedCodeDiagnostic;
DiagnosticAnalyzer\AnalyzerExecutor.cs (67)
35private readonly Action<Diagnostic, DiagnosticAnalyzer, bool, CancellationToken>? _addCategorizedLocalDiagnostic; 36private readonly Action<Diagnostic, DiagnosticAnalyzer, 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; 61private bool IsAnalyzerSuppressedForTree(DiagnosticAnalyzer analyzer, SyntaxTree tree, CancellationToken cancellationToken) 102Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> onAnalyzerException, 104Func<DiagnosticAnalyzer, bool> isCompilerAnalyzer, 106Func<DiagnosticAnalyzer, bool> shouldSkipAnalysisOnGeneratedCode, 107Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> shouldSuppressGeneratedCodeDiagnostic, 109Func<DiagnosticAnalyzer, SyntaxTree, SyntaxTreeOptionsProvider?, CancellationToken, bool> isAnalyzerSuppressedForTree, 110Func<DiagnosticAnalyzer, object?> getAnalyzerGate, 114Action<Diagnostic, DiagnosticAnalyzer, bool, CancellationToken>? addCategorizedLocalDiagnostic = null, 115Action<Diagnostic, DiagnosticAnalyzer, CancellationToken>? addCategorizedNonLocalDiagnostic = null, 122var analyzerExecutionTimeMap = logExecutionTime ? new ConcurrentDictionary<DiagnosticAnalyzer, StrongBox<long>>() : null; 134Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> onAnalyzerException, 136Func<DiagnosticAnalyzer, bool> isCompilerAnalyzer, 138Func<DiagnosticAnalyzer, bool> shouldSkipAnalysisOnGeneratedCode, 139Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> shouldSuppressGeneratedCodeDiagnostic, 141Func<DiagnosticAnalyzer, SyntaxTree, SyntaxTreeOptionsProvider?, CancellationToken, bool> isAnalyzerSuppressedForTree, 142Func<DiagnosticAnalyzer, object?> getAnalyzerGate, 145ConcurrentDictionary<DiagnosticAnalyzer, StrongBox<long>>? analyzerExecutionTimeMap, 146Action<Diagnostic, DiagnosticAnalyzer, bool, CancellationToken>? addCategorizedLocalDiagnostic, 147Action<Diagnostic, DiagnosticAnalyzer, CancellationToken>? addCategorizedNonLocalDiagnostic, 178internal Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> OnAnalyzerException { get; } 180internal ImmutableDictionary<DiagnosticAnalyzer, TimeSpan> AnalyzerExecutionTimes 190/// Executes the <see cref="DiagnosticAnalyzer.Initialize(AnalysisContext)"/> for the given analyzer. 317DiagnosticAnalyzer analyzer, 355DiagnosticAnalyzer analyzer, 411DiagnosticAnalyzer analyzer, 447DiagnosticAnalyzer analyzer, 464DiagnosticAnalyzer analyzer, 513DiagnosticAnalyzer analyzer, 559DiagnosticAnalyzer analyzer, 606DiagnosticAnalyzer analyzer, 692DiagnosticAnalyzer analyzer, 729DiagnosticAnalyzer analyzer, 749DiagnosticAnalyzer analyzer, 875DiagnosticAnalyzer analyzer, 956DiagnosticAnalyzer analyzer, 983DiagnosticAnalyzer analyzer, 1059DiagnosticAnalyzer analyzer, 1084DiagnosticAnalyzer analyzer, 1145internal void ExecuteAndCatchIfThrows<TArg>(DiagnosticAnalyzer analyzer, Action<TArg> analyze, TArg argument, AnalysisContextInfo? contextInfo, CancellationToken cancellationToken) 1177private void ExecuteAndCatchIfThrows_NoLock<TArg>(DiagnosticAnalyzer analyzer, Action<TArg> analyze, TArg argument, AnalysisContextInfo? info, CancellationToken cancellationToken) 1190private bool HandleAnalyzerException(DiagnosticAnalyzer analyzer, Exception ex, in AnalysisContextInfo? info) 1204DiagnosticAnalyzer analyzer, 1206Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> onAnalyzerException, 1244internal static Diagnostic CreateAnalyzerExceptionDiagnostic(DiagnosticAnalyzer analyzer, Exception e, AnalysisContextInfo? info = null) 1266private static string CreateDisablingMessage(DiagnosticAnalyzer analyzer, string analyzerName) 1358private bool IsSupportedDiagnostic(DiagnosticAnalyzer analyzer, Diagnostic diagnostic, CancellationToken cancellationToken) 1369private Action<Diagnostic> GetAddDiagnostic(ISymbol contextSymbol, ImmutableArray<SyntaxReference> cachedDeclaringReferences, DiagnosticAnalyzer analyzer, Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, CancellationToken cancellationToken) 1379DiagnosticAnalyzer analyzer, 1381Action<Diagnostic, DiagnosticAnalyzer, bool, CancellationToken>? addCategorizedLocalDiagnostic, 1382Action<Diagnostic, DiagnosticAnalyzer, CancellationToken>? addCategorizedNonLocalDiagnostic, 1384Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> shouldSuppressGeneratedCodeDiagnostic, 1424private Action<Diagnostic> GetAddCompilationDiagnostic(DiagnosticAnalyzer analyzer, CancellationToken cancellationToken) 1444private AnalyzerDiagnosticReporter GetAddSemanticDiagnostic(SyntaxTree tree, DiagnosticAnalyzer analyzer, CancellationToken cancellationToken) 1451private AnalyzerDiagnosticReporter GetAddSemanticDiagnostic(SyntaxTree tree, TextSpan? span, DiagnosticAnalyzer analyzer, CancellationToken cancellationToken) 1458private AnalyzerDiagnosticReporter GetAddSyntaxDiagnostic(SourceOrAdditionalFile file, DiagnosticAnalyzer analyzer, CancellationToken cancellationToken) 1465private bool ShouldExecuteNode(SyntaxNode node, DiagnosticAnalyzer analyzer, CancellationToken cancellationToken) 1477private bool ShouldExecuteOperation(IOperation operation, DiagnosticAnalyzer analyzer, CancellationToken cancellationToken) 1489internal TimeSpan ResetAnalyzerExecutionTime(DiagnosticAnalyzer analyzer) 1512private bool IsAnalyzerSuppressedForSymbol(DiagnosticAnalyzer analyzer, ISymbol symbol, CancellationToken cancellationToken)
DiagnosticAnalyzer\AnalyzerFileReference.cs (6)
39private readonly Extensions<DiagnosticAnalyzer> _diagnosticAnalyzers; 109public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzersForAllLanguages() 116public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzers(string language) 185/// Adds the <see cref="ImmutableArray{T}"/> of <see cref="DiagnosticAnalyzer"/> defined in this assembly reference of given <paramref name="language"/>. 187internal 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)
22/// 1) <see cref="DiagnosticAnalyzer.Initialize(AnalysisContext)"/> is invoked only once per-analyzer. 23/// 2) <see cref="DiagnosticAnalyzer.SupportedDiagnostics"/> is invoked only once per-analyzer. 30private readonly Dictionary<DiagnosticAnalyzer, AnalyzerExecutionContext> _analyzerExecutionContextMap; 32public AnalyzerManager(ImmutableArray<DiagnosticAnalyzer> analyzers) 37public AnalyzerManager(DiagnosticAnalyzer analyzer) 42private Dictionary<DiagnosticAnalyzer, AnalyzerExecutionContext> CreateAnalyzerExecutionContextMap(IEnumerable<DiagnosticAnalyzer> analyzers) 44var analyzerExecutionContextMap = new Dictionary<DiagnosticAnalyzer, AnalyzerExecutionContext>(); 45foreach (var analyzer in analyzers) 53private AnalyzerExecutionContext GetAnalyzerExecutionContext(DiagnosticAnalyzer analyzer) => _analyzerExecutionContextMap[analyzer]; 96DiagnosticAnalyzer analyzer, 132DiagnosticAnalyzer analyzer, 164/// The returned actions include the actions registered during <see cref="DiagnosticAnalyzer.Initialize(AnalysisContext)"/> method as well as 168public async ValueTask<AnalyzerActions> GetAnalyzerActionsAsync(DiagnosticAnalyzer analyzer, AnalyzerExecutor analyzerExecutor, CancellationToken cancellationToken) 190DiagnosticAnalyzer analyzer, 233public async Task<bool> IsConcurrentAnalyzerAsync(DiagnosticAnalyzer analyzer, AnalyzerExecutor analyzerExecutor, CancellationToken cancellationToken) 243public async Task<GeneratedCodeAnalysisFlags> GetGeneratedCodeAnalysisFlagsAsync(DiagnosticAnalyzer analyzer, AnalyzerExecutor analyzerExecutor, CancellationToken cancellationToken) 250/// Return <see cref="DiagnosticAnalyzer.SupportedDiagnostics"/> of given <paramref name="analyzer"/>. 253DiagnosticAnalyzer analyzer, 273internal bool IsSupportedDiagnostic(DiagnosticAnalyzer analyzer, Diagnostic diagnostic, Func<DiagnosticAnalyzer, bool> isCompilerAnalyzer, AnalyzerExecutor analyzerExecutor, CancellationToken cancellationToken) 299DiagnosticAnalyzer analyzer, 301Func<DiagnosticAnalyzer, bool> isCompilerAnalyzer, 307Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnosticDescriptors = 341DiagnosticAnalyzer analyzer, 343Func<DiagnosticAnalyzer, bool> isCompilerAnalyzer, 346Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnosticDescriptors, 467DiagnosticAnalyzer analyzer, 473public bool TryStartExecuteSymbolEndActions(ImmutableArray<SymbolEndAnalyzerAction> symbolEndActions, DiagnosticAnalyzer analyzer, SymbolDeclaredCompilationEvent symbolDeclaredEvent) 480DiagnosticAnalyzer analyzer, 487public 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, bool allowDefaultOrEmpty = false) 152private void VerifyAnalyzerArgument(DiagnosticAnalyzer analyzer) 162private static void VerifyAnalyzerArgumentForStaticApis(DiagnosticAnalyzer analyzer) 170private void VerifyExistingAnalyzersArgument(ImmutableArray<DiagnosticAnalyzer> analyzers) 253public async Task<ImmutableArray<Diagnostic>> GetAnalyzerDiagnosticsAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 273public async Task<AnalysisResult> GetAnalysisResultAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 302async Task<ImmutableArray<Diagnostic>> getAllDiagnosticsWithoutStateTrackingAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 335public async Task<ImmutableArray<Diagnostic>> GetAnalyzerCompilationDiagnosticsAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 342private async Task<ImmutableArray<Diagnostic>> GetAnalyzerCompilationDiagnosticsCoreAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 349private async Task<AnalysisResult> GetAnalysisResultCoreAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 356private async Task<ImmutableArray<Diagnostic>> GetAnalyzerDiagnosticsCoreAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 427public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsAsync(SyntaxTree tree, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 445public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsAsync(SyntaxTree tree, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 488public Task<AnalysisResult> GetAnalysisResultAsync(SyntaxTree tree, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 505public Task<AnalysisResult> GetAnalysisResultAsync(SyntaxTree tree, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 535public async Task<AnalysisResult> GetAnalysisResultAsync(AdditionalText file, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 569public async Task<AnalysisResult> GetAnalysisResultAsync(AdditionalText file, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 577private async Task<AnalysisResult> GetAnalysisResultCoreAsync(SourceOrAdditionalFile file, ImmutableArray<DiagnosticAnalyzer> analyzers, TextSpan? filterSpan, CancellationToken cancellationToken) 584private async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsCoreAsync(SyntaxTree tree, ImmutableArray<DiagnosticAnalyzer> analyzers, TextSpan? filterSpan, CancellationToken cancellationToken) 613public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSemanticDiagnosticsAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 643public Task<AnalysisResult> GetAnalysisResultAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 651private async Task<AnalysisResult> GetAnalysisResultCoreAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 658private async Task<ImmutableArray<Diagnostic>> GetAnalyzerSemanticDiagnosticsCoreAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 737Func<DiagnosticAnalyzer, AnalyzerActionCounts> getAnalyzerActionCounts = analyzer => analyzerActionCounts[analyzer]; 830static async Task<(ImmutableDictionary<DiagnosticAnalyzer, AnalyzerActionCounts> analyzerActionCounts, bool hasAnyActionsRequiringCompilationEvents)> getAnalyzerActionCountsAsync( 839var builder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, AnalyzerActionCounts>(); 841foreach (var analyzer in analysisScope.Analyzers) 853static (ImmutableArray<DiagnosticAnalyzer> symbolStartAnalyzers, ImmutableArray<DiagnosticAnalyzer> otherAnalyzers) getSymbolStartAnalyzers( 854ImmutableArray<DiagnosticAnalyzer> analyzers, 855ImmutableDictionary<DiagnosticAnalyzer, AnalyzerActionCounts> analyzerActionCounts) 857var symbolStartAnalyzersBuilder = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(); 858var otherAnalyzersBuilder = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(); 860foreach (var analyzer in analyzers) 879ImmutableArray<DiagnosticAnalyzer> symbolStartAnalyzers, 1151/// Given a set of compiler or <see cref="DiagnosticAnalyzer"/> generated <paramref name="diagnostics"/>, returns the effective diagnostics after applying the below filters: 1161/// Given a set of compiler or <see cref="DiagnosticAnalyzer"/> generated <paramref name="diagnostics"/>, returns the effective diagnostics after applying the below filters: 1219DiagnosticAnalyzer analyzer, 1221Action<Exception, DiagnosticAnalyzer, Diagnostic>? onAnalyzerException = null) 1232Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> wrappedOnAnalyzerException = 1235Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnosticDescriptors = analyzer => 1269public static void ClearAnalyzerState(ImmutableArray<DiagnosticAnalyzer> analyzers) 1276public async Task<AnalyzerTelemetryInfo> GetAnalyzerTelemetryInfoAsync(DiagnosticAnalyzer analyzer, CancellationToken cancellationToken) 1296private async Task<AnalyzerActionCounts> GetAnalyzerActionCountsAsync(DiagnosticAnalyzer analyzer, CancellationToken cancellationToken) 1307private TimeSpan GetAnalyzerExecutionTime(DiagnosticAnalyzer analyzer)
DiagnosticAnalyzer\CompilationWithAnalyzersOptions.cs (6)
15private readonly Action<Exception, DiagnosticAnalyzer, Diagnostic>? _onAnalyzerException; 22/// Options passed to <see cref="DiagnosticAnalyzer"/>s. 29public Action<Exception, DiagnosticAnalyzer, Diagnostic>? OnAnalyzerException => _onAnalyzerException; 60Action<Exception, DiagnosticAnalyzer, Diagnostic>? onAnalyzerException, 77Action<Exception, DiagnosticAnalyzer, Diagnostic>? onAnalyzerException, 96Action<Exception, DiagnosticAnalyzer, Diagnostic>? onAnalyzerException,
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 (1)
357internal sealed class HostSessionStartAnalysisScope(DiagnosticAnalyzer 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.CodeStyle (8)
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\DiagnosticAnalyzerCategory.cs (1)
19/// Note: an <see cref="DiagnosticAnalyzer"/> that uses this will not work properly if
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
26Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnostics,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticAnalyzerExtensions.cs (1)
15public static bool IsCompilerAnalyzer(this DiagnosticAnalyzer analyzer)
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (8)
src\Features\DiagnosticsTestUtilities\CodeActions\CodeFixVerifierHelper.cs (4)
20public static void VerifyStandardProperty(DiagnosticAnalyzer analyzer, AnalyzerProperty property) 41private static void VerifyMessageTitle(DiagnosticAnalyzer analyzer) 55private static void VerifyMessageDescription(DiagnosticAnalyzer analyzer) 85private static void VerifyMessageHelpLinkUri(DiagnosticAnalyzer analyzer)
src\Features\DiagnosticsTestUtilities\CodeActions\CSharpCodeFixVerifier`2.cs (1)
15where TAnalyzer : DiagnosticAnalyzer, new()
src\Features\DiagnosticsTestUtilities\CodeActions\CSharpCodeFixVerifier`2+Test.cs (1)
28where TAnalyzer : DiagnosticAnalyzer, new()
src\Features\DiagnosticsTestUtilities\CodeActions\VisualBasicCodeFixVerifier`2.cs (1)
14where TAnalyzer : DiagnosticAnalyzer, new()
src\Features\DiagnosticsTestUtilities\CodeActions\VisualBasicCodeFixVerifier`2+Test.cs (1)
27where TAnalyzer : DiagnosticAnalyzer, new()
Microsoft.CodeAnalysis.CSharp (2)
CommandLine\CSharpCompiler.cs (1)
338out ImmutableArray<DiagnosticAnalyzer> analyzers,
Compilation\CSharpCompilation.cs (1)
4733internal override AnalyzerDriver CreateAnalyzerDriver(ImmutableArray<DiagnosticAnalyzer> analyzers, AnalyzerManager analyzerManager, SeverityFilter severityFilter)
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper`1.cs (1)
25/// requirements with <see cref="DiagnosticAnalyzer"/> and "CodeRefactoringProvider".
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (67)
src\Analyzers\CSharp\Tests\AddAccessibilityModifiers\AddAccessibilityModifiersFixAllTests.cs (1)
27internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\AddAnonymousTypeMemberName\AddAnonymousTypeMemberNameTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\AddBraces\AddBracesTests.cs (1)
27internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\AddExplicitCast\AddExplicitCastTests.cs (1)
22internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\AddParameter\AddParameterTests.cs (1)
30internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\AddRequiredParentheses\AddRequiredExpressionParenthesesTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\AddRequiredParentheses\AddRequiredPatternParenthesesTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\AliasAmbiguousType\AliasAmbiguousTypeTests.cs (1)
29internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\ConditionalExpressionInStringInterpolation\CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProviderTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\DocumentationComments\AddDocCommentNodesCodeFixProviderTests.cs (1)
28internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\DocumentationComments\RemoveDocCommentNodeCodeFixProviderTests.cs (1)
28internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\GenerateConstructor\GenerateConstructorTests.cs (1)
25internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\GenerateEnumMember\GenerateEnumMemberTests.cs (1)
22internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\GenerateMethod\GenerateConversionTests.cs (1)
23internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\GenerateMethod\GenerateDeconstructMethodTests.cs (1)
22internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\GenerateMethod\GenerateMethodTests.cs (1)
22internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\HideBase\HideBaseTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\ImplementAbstractClass\ImplementAbstractClassTests.cs (1)
26internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\ImplementAbstractClass\ImplementAbstractClassTests_ThroughMember.cs (1)
29internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\InlineDeclaration\CSharpInlineDeclarationTests.cs (1)
24internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessTests.cs (1)
25internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\Iterator\ChangeToIEnumerableTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\MakeFieldReadonly\MakeFieldReadonlyTests.cs (1)
42internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\MakeLocalFunctionStatic\MakeLocalFunctionStaticTests.cs (1)
27internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\MakeMethodAsynchronous\MakeMethodAsynchronousTests.cs (1)
26internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\MakeRefStruct\MakeRefStructTests.cs (1)
45internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\MakeTypeAbstract\MakeTypeAbstractTests.cs (1)
25internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\MisplacedUsingDirectives\MisplacedUsingDirectivesTests.cs (1)
29internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\NamingStyles\NamingStylesTests.cs (1)
27internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\Nullable\CSharpDeclareAsNullableCodeFixTests.cs (1)
21internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\OrderModifiers\OrderModifiersCompilerErrorTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\OrderModifiers\OrderModifiersTests.cs (1)
25internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\PopulateSwitch\PopulateSwitchExpressionTests.cs (1)
24internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\PopulateSwitch\PopulateSwitchStatementTests.cs (1)
20internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\QualifyMemberAccess\QualifyMemberAccessTests.cs (1)
27internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\RemoveInKeyword\RemoveInKeywordCodeFixProviderTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\RemoveNewModifier\RemoveNewModifierCodeFixProviderTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\RemoveUnnecessaryCast\RemoveUnnecessaryCastTests_FixAllTests.cs (1)
23internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\RemoveUnnecessaryImports\RemoveUnnecessaryImportsTests_FixAllTests.cs (1)
25internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\RemoveUnnecessaryParentheses\RemoveUnnecessaryExpressionParenthesesTests.cs (1)
27internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\RemoveUnnecessaryParentheses\RemoveUnnecessaryPatternParenthesesTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\RemoveUnusedLocalFunction\RemoveUnusedLocalFunctionTests.cs (1)
26internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedParametersTests.cs (1)
32internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedValuesTestsBase.cs (1)
24internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\ReplaceDefaultLiteral\ReplaceDefaultLiteralTests.cs (1)
26internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\SimplifyBooleanExpression\SimplifyConditionalTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\SimplifyInterpolation\SimplifyInterpolationTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UpdateProjectToAllowUnsafe\UpdateProjectToAllowUnsafeTests.cs (1)
27internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UpgradeProject\UpgradeProjectTests.cs (1)
28internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseAutoProperty\UseAutoPropertyTests.cs (1)
27internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseCoalesceExpression\UseCoalesceExpressionForNullableTernaryConditionalCheckTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseCoalesceExpression\UseCoalesceExpressionForTernaryConditionalCheckTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseConditionalExpression\UseConditionalExpressionForReturnTests.cs (1)
25internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseExplicitTypeForConst\UseExplicitTypeForConstTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseExpressionBodyForLambda\UseExpressionBodyForLambdasAnalyzerTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseImplicitOrExplicitType\UseExplicitTypeTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseImplicitOrExplicitType\UseImplicitTypeTests.cs (1)
29internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseInferredMemberName\UseInferredMemberNameTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseInterpolatedVerbatimString\UseInterpolatedVerbatimStringCodeFixTests.cs (1)
25internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseIsNullCheck\UseIsNullCheckForCastAndEqualityOperatorTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseIsNullCheck\UseIsNullCheckForReferenceEqualsTests.cs (1)
30internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseLocalFunction\UseLocalFunctionTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UsePatternMatching\CSharpAsAndNullCheckTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzerTests.cs (1)
30internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseSystemHashCode\UseSystemHashCodeTests.cs (1)
23internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseThrowExpression\UseThrowExpressionTests.cs (1)
29internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\ValidateFormatString\ValidateFormatStringTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider?) CreateDiagnosticProviderAndFixer(Workspace workspace)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (11)
CommandLineTestBase.cs (2)
55internal MockCSharpCompiler CreateCSharpCompiler(string[] args, DiagnosticAnalyzer[]? analyzers = null, ISourceGenerator[]? generators = null, AnalyzerAssemblyLoader? loader = null, GeneratorDriverCache? driverCache = null, MetadataReference[]? additionalReferences = null) 60internal MockCSharpCompiler CreateCSharpCompiler(string? responseFile, string workingDirectory, string[] args, DiagnosticAnalyzer[]? analyzers = null, ISourceGenerator[]? generators = null, AnalyzerAssemblyLoader? loader = null, GeneratorDriverCache? driverCache = null, MetadataReference[]? additionalReferences = null)
CommandLineTests.cs (8)
9533? Array.Empty<DiagnosticAnalyzer>() 9534: new DiagnosticAnalyzer[] { new HiddenDiagnosticAnalyzer(), new WarningDiagnosticAnalyzer() }; 10560DiagnosticAnalyzer[] analyzers = null, 13079var analyzerAndSuppressor = new DiagnosticAnalyzer[] { analyzer, suppressor }; 13109analyzerAndSuppressor = new DiagnosticAnalyzer[] { analyzer, suppressor }; 13137var analyzerAndSuppressor = new DiagnosticAnalyzer[] { analyzer, suppressor }; 13637private void TestAnalyzerConfigRespectedCore(DiagnosticAnalyzer analyzer, DiagnosticDescriptor descriptor, ReportDiagnostic analyzerConfigSeverity, bool noWarn, bool errorlog, bool customConfigurable) 15290params DiagnosticAnalyzer[] analyzers)
SarifV2ErrorLoggerTests.cs (1)
604analyzers: new DiagnosticAnalyzer[] { new AnalyzerForErrorLogTest(), new SuppressorForErrorLogTest() });
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (28)
CodeActions\AddUsing\AbstractAddUsingTests.cs (1)
27internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
CodeActions\AddUsing\AddUsingNuGetTests.cs (1)
40internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(
CodeActions\AddUsing\AddUsingTestsWithAddImportDiagnosticProvider.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
CodeActions\GenerateType\GenerateTypeTests.cs (1)
33internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
CodeActions\GenerateType\GenerateTypeWithUnboundAnalyzerTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (14)
58var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer)); 89var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(ideEngineAnalyzer)); 137analyzer.ThrowOn(typeof(DiagnosticAnalyzer).GetProperties().Single().Name); 145analyzer.ThrowOn(typeof(DiagnosticAnalyzer).GetProperties().Single().Name); 168var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer)); 179private static void AccessSupportedDiagnostics(DiagnosticAnalyzer analyzer) 201var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer)); 257var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer)); 771var vsixAnalyzerReferences = new List<DiagnosticAnalyzer>(vsixAnalyzers.CastArray<DiagnosticAnalyzer>()); 772vsixAnalyzerReferences.AddRange(vsixSuppressors.CastArray<DiagnosticAnalyzer>()); 781var nugetAnalyzerReferences = new List<DiagnosticAnalyzer>(); 784nugetAnalyzerReferences.AddRange(nugetAnalyzers.As<DiagnosticAnalyzer>()); 789nugetAnalyzerReferences.AddRange(nugetSuppressors.As<DiagnosticAnalyzer>());
Diagnostics\FixAllProvider\BatchFixerTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
Diagnostics\MockDiagnosticAnalyzerTests.cs (1)
49internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
Formatting\CodeCleanupTests.cs (6)
769where TAnalyzer : DiagnosticAnalyzer, new() 776where TAnalyzer : DiagnosticAnalyzer, new() 783where TAnalyzer : DiagnosticAnalyzer, new() 790var analyzer = (DiagnosticAnalyzer)new TAnalyzer(); 799var map = new Dictionary<string, ImmutableArray<DiagnosticAnalyzer>>{
QuickInfo\DiagnosticAnalyzerQuickInfoSourceTests.cs (1)
210var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (202)
Diagnostics\DiagnosticAnalyzerTests.cs (113)
82.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new ComplainAboutX() }, null, null, 114.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new ComplainAboutX() }, null, null, 174.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new ComplainAboutX() }, null, null, 207.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new ComplainAboutX() }, null, null, 229.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new ImplicitlyDeclaredSymbolAnalyzer() }); 290.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new SyntaxAndSymbolAnalyzer() }, null, null, 555var analyzers = new DiagnosticAnalyzer[] { new CodeBlockOrSyntaxNodeAnalyzer(isCodeBlockAnalyzer: true) }; 575var analyzers = new DiagnosticAnalyzer[] { new CodeBlockOrSyntaxNodeAnalyzer(isCodeBlockAnalyzer: true) }; 595var analyzers = new DiagnosticAnalyzer[] { new CodeBlockOrSyntaxNodeAnalyzer(isCodeBlockAnalyzer: true) }; 618var analyzers = new DiagnosticAnalyzer[] { new CodeBlockOrSyntaxNodeAnalyzer(isCodeBlockAnalyzer: false) }; 638var analyzers = new DiagnosticAnalyzer[] { new MethodSymbolAnalyzer() }; 681var analyzers = new DiagnosticAnalyzer[] { new FieldDeclarationAnalyzer() }; 699var analyzers = new DiagnosticAnalyzer[] { new FieldDeclarationAnalyzer() }; 853var analyzers = new DiagnosticAnalyzer[] { analyzer }; 911var analyzers = new DiagnosticAnalyzer[] { new AnalyzerWithInvalidDiagnosticId() }; 950var analyzers = new DiagnosticAnalyzer[] { new AnalyzerWithNullDescriptor() }; 986var analyzers = new DiagnosticAnalyzer[] { new AnalyzerWithCSharpCompilerDiagnosticId() }; 997var analyzers = new DiagnosticAnalyzer[] { new AnalyzerWithBasicCompilerDiagnosticId() }; 1020var analyzers = new DiagnosticAnalyzer[] { analyzer }; 1119var analyzers = new DiagnosticAnalyzer[] { analyzer }; 1132var analyzers = new DiagnosticAnalyzer[] { new NotConfigurableDiagnosticAnalyzer() }; 1166var analyzers = new DiagnosticAnalyzer[] { new CodeBlockActionAnalyzer() }; 1185var analyzers = new DiagnosticAnalyzer[] { new CodeBlockActionAnalyzer(onlyStatelessAction: true) }; 1215private void TestGenericNameCore(string source, params DiagnosticAnalyzer[] analyzers) 1229var analyzers = new DiagnosticAnalyzer[] { new CSharpNamespaceDeclarationAnalyzer() }; 1269var analyzers = new DiagnosticAnalyzer[] { new AnalyzerWithNoSupportedDiagnostics() }; 1362var analyzers = new DiagnosticAnalyzer[] { new CSharpCodeBlockObjectCreationAnalyzer() }; 1395var analyzers = new DiagnosticAnalyzer[] { new NonConcurrentAnalyzer() }; 1427var analyzers = new DiagnosticAnalyzer[] { new ConcurrentAnalyzer(typeNames) }; 1440analyzers = new DiagnosticAnalyzer[] { new ConcurrentAnalyzer(typeNames), new NonConcurrentAnalyzer() }; 1617var analyzers = new DiagnosticAnalyzer[] { new GeneratedCodeAnalyzer2() }; 1687.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new OwningSymbolTestAnalyzer() }, null, null, 1701var analyzers = new DiagnosticAnalyzer[] { new GeneratedCodeAnalyzer(generatedCodeAnalysisFlagsOpt, testIsGeneratedCodeInCallbacks) }; 1707var analyzers = new DiagnosticAnalyzer[] { new GeneratedCodeAnalyzer(generatedCodeAnalysisFlagsOpt, testIsGeneratedCodeInCallbacks: true) }; 1889var analyzers = new DiagnosticAnalyzer[] { new EnsureNoMergedNamespaceSymbolAnalyzer() }; 1914var analyzers = new DiagnosticAnalyzer[] { new SharedStateAnalyzer() }; 1947var analyzers = new DiagnosticAnalyzer[] { new AnalyzerForParameters() }; 1968var analyzers = new DiagnosticAnalyzer[] { new AnalyzerForParameters() }; 1991var analyzers = new DiagnosticAnalyzer[] { new AnalyzerForParameters() }; 2012var analyzers = new DiagnosticAnalyzer[] { new AnalyzerForParameters() }; 2037var analyzers = new DiagnosticAnalyzer[] { new AnalyzerForParameters() }; 2057var analyzers = new DiagnosticAnalyzer[] { new AnalyzerForParameters() }; 2076var analyzers = new DiagnosticAnalyzer[] { new AnalyzerForParameters() }; 2099var analyzers = new DiagnosticAnalyzer[] { new AnalyzerForParameters() }; 2120var analyzers = new DiagnosticAnalyzer[] { new AnalyzerForParameters() }; 2146var analyzers = new DiagnosticAnalyzer[] { new AnalyzerForParameters() }; 2179var analyzers = new DiagnosticAnalyzer[] { new GeneratedCodeAnalyzer(GeneratedCodeAnalysisFlags.None) }; 2187analyzers = new DiagnosticAnalyzer[] { new GeneratedCodeAnalyzer(GeneratedCodeAnalysisFlags.Analyze) }; 2195analyzers = new DiagnosticAnalyzer[] { new GeneratedCodeAnalyzer(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics) }; 2247var analyzers = new DiagnosticAnalyzer[] { new GeneratedCodeSyntaxAndOperationAnalyzer(GeneratedCodeAnalysisFlags.None, syntaxKinds, operationKinds) }; 2255analyzers = new DiagnosticAnalyzer[] { new GeneratedCodeSyntaxAndOperationAnalyzer(GeneratedCodeAnalysisFlags.Analyze, syntaxKinds, operationKinds) }; 2263analyzers = new DiagnosticAnalyzer[] { new GeneratedCodeSyntaxAndOperationAnalyzer(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics, syntaxKinds, operationKinds) }; 2478var analyzers = new DiagnosticAnalyzer[] { new FieldReferenceOperationAnalyzer(doOperationBlockAnalysis) }; 2545var analyzers = new DiagnosticAnalyzer[] { new FieldReferenceOperationAnalyzer(doOperationBlockAnalysis) }; 2574var analyzers = new DiagnosticAnalyzer[] { new FieldReferenceOperationAnalyzer(doOperationBlockAnalysis) }; 2593var analyzers = new DiagnosticAnalyzer[] { new MethodOrConstructorBodyOperationAnalyzer() }; 2611var analyzers = new DiagnosticAnalyzer[] { new MethodOrConstructorBodyOperationAnalyzer() }; 2632var analyzers = new DiagnosticAnalyzer[] { new MethodOrConstructorBodyOperationAnalyzer() }; 2657var analyzers = new DiagnosticAnalyzer[] { new MethodOrConstructorBodyOperationAnalyzer() }; 2733compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { analyzer }, 2742compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { analyzer }, 2751compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { analyzer }, 2758compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { analyzer }, 2777TestSymbolStartAnalyzerCore(new DiagnosticAnalyzer[] { analyzer }, diagnostics); 2780private static void TestSymbolStartAnalyzerCore(DiagnosticAnalyzer[] analyzers, params DiagnosticDescription[] diagnostics) 2932TestSymbolStartAnalyzerCore(new DiagnosticAnalyzer[] { analyzer1, analyzer2 }, 2958TestSymbolStartAnalyzerCore(new DiagnosticAnalyzer[] { analyzer1, analyzer2 }, 2992var analyzers = new DiagnosticAnalyzer[symbolKinds.Length]; 3086var analyzers = new DiagnosticAnalyzer[symbolKinds.Length]; 3146var analyzers = new DiagnosticAnalyzer[symbolKinds.Length]; 3191var analyzers = new DiagnosticAnalyzer[] { new SymbolStartAnalyzer(topLevelAction: false, SymbolKind.NamedType, OperationKind.Invocation) }; 3223var analyzers = new DiagnosticAnalyzer[] { new SymbolStartAnalyzer(topLevelAction: true, SymbolKind.NamedType, OperationKind.FieldReference) }; 3265var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(new SymbolStartAnalyzer(topLevelAction: false, SymbolKind.NamedType)); 3311var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(new SymbolStartAnalyzer(topLevelAction: false, SymbolKind.NamedType)); 3349var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer1, analyzer2)); 3357var tree1SemanticDiagnostics = await compilationWithAnalyzers.GetAnalyzerSemanticDiagnosticsAsync(semanticModel1, filterSpan: null, ImmutableArray.Create<DiagnosticAnalyzer>(analyzer1), CancellationToken.None); 3376compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3391compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3400compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3419compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3435compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3444compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3453compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3472compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3487compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3496compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3505compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3523compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3538compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }); 3544compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3559compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3597var analyzers = new DiagnosticAnalyzer[] { new RegisterOperationBlockAndOperationActionAnalyzer() }; 3625var analyzers = new DiagnosticAnalyzer[] { new RegisterOperationBlockAndOperationActionAnalyzer() }; 3652var analyzers = new DiagnosticAnalyzer[] { new RegisterOperationBlockAndOperationActionAnalyzer() }; 3686var allAnalyzers = ImmutableArray.Create<DiagnosticAnalyzer>(analyzer1, analyzer2); 3694var analyzersToQuery = singleAnalyzer ? ImmutableArray.Create<DiagnosticAnalyzer>(analyzer1) : allAnalyzers; 3711var diagnostics = diagnosticsMap.TryGetValue(tree1, out var value) ? value : ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>.Empty; 3713foreach (var analyzer in allAnalyzers) 3753var allAnalyzers = ImmutableArray.Create<DiagnosticAnalyzer>(analyzer1, analyzer2); 3813var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(analyzer); 3887var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(analyzer); 3929var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(analyzer1, analyzer2); 3939var singleAnalyzerArray = ImmutableArray.Create<DiagnosticAnalyzer>(analyzer1); 3957ImmutableArray<DiagnosticAnalyzer> analyzers, 3998ImmutableArray<DiagnosticAnalyzer> analyzers, 4009foreach (var analyzer in analyzers) 4021static ImmutableArray<Diagnostic> getReportedDiagnostics(AnalysisResult analysisResult, DiagnosticAnalyzer analyzer, AdditionalText additionalFile) 4097var analyzers = new DiagnosticAnalyzer[] { new RecordDeclarationAnalyzer() }; 4154var analyzers = new DiagnosticAnalyzer[] { new PrimaryConstructorBaseTypeAnalyzer(baseListNode, syntaxKinds) }; 4205.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { analyzer }, null, null, 4229var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer)); 4314var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(analyzer); 4397var analyzersArray = ImmutableArray.Create<DiagnosticAnalyzer>(analyzer);
Diagnostics\DiagnosticSuppressorTests.cs (36)
29DiagnosticAnalyzer[] analyzers, 35DiagnosticAnalyzer[] analyzers, 41DiagnosticAnalyzer[] analyzers) 66var analyzers = new DiagnosticAnalyzer[] { new DiagnosticSuppressorForId("CS1522") }; 109var analyzers = new DiagnosticAnalyzer[] { new DiagnosticSuppressorForId("CS1522") }; 152var analyzers = new DiagnosticAnalyzer[] { new DiagnosticSuppressorForId("CS1522") }; 177var analyzers = new DiagnosticAnalyzer[] { new DiagnosticSuppressorForId("CS0169") }; 200var analyzers = new DiagnosticAnalyzer[] { new DiagnosticSuppressorForId("CS1001") }; 221var analyzers = new DiagnosticAnalyzer[] { new DiagnosticSuppressorForId("CS0246") }; 238VerifyAnalyzerDiagnostics(compilation, new DiagnosticAnalyzer[] { analyzer }, expectedDiagnostics); 240var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, new DiagnosticSuppressorForId(analyzer.Descriptor.Id) }; 258VerifyAnalyzerDiagnostics(compilation, new DiagnosticAnalyzer[] { analyzer }, expectedDiagnostic); 262var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, new DiagnosticSuppressorForId(analyzer.Descriptor.Id), new DiagnosticSuppressorForId(analyzer.Descriptor.Id) }; 267analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, new DiagnosticSuppressorForId(analyzer.Descriptor.Id, suppressionId: "SPR0001"), new DiagnosticSuppressorForId(analyzer.Descriptor.Id, suppressionId: "SPR0002") }; 283VerifyAnalyzerDiagnostics(compilation, new DiagnosticAnalyzer[] { analyzer }, 289var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, suppressor1, suppressor2 }; 306VerifyAnalyzerDiagnostics(compilation, new DiagnosticAnalyzer[] { analyzer }, expectedDiagnostic); 309var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, new DiagnosticSuppressorForId(analyzer.Descriptor.Id, suppressionId) }; 356var analyzersWithoutSuppressor = new DiagnosticAnalyzer[] { analyzer }; 357var analyzersWithSuppressor = new DiagnosticAnalyzer[] { analyzer, suppressor }; 409var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, suppressor }; 453var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, suppressor }; 481var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, suppressor }; 534var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, suppressor }; 587var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, suppressor }; 636VerifyAnalyzerDiagnostics(compilation, new DiagnosticAnalyzer[] { analyzer }, expectedDiagnostic); 640var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, suppressor }; 651analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, suppressor, suppressor2 }; 676VerifyAnalyzerDiagnostics(compilation, new DiagnosticAnalyzer[] { analyzer }, expectedDiagnostic); 680var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, suppressor }; 700VerifyAnalyzerDiagnostics(compilation, new DiagnosticAnalyzer[] { analyzer1, analyzer2 }, expectedDiagnostics); 704var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer1, analyzer2, suppressor }; 718var analyzers = withSuppressor ? ImmutableArray.Create<DiagnosticAnalyzer>(analyzer1, suppressor) : ImmutableArray.Create<DiagnosticAnalyzer>(analyzer1); 722analyzers = withSuppressor ? ImmutableArray.Create<DiagnosticAnalyzer>(analyzer2, suppressor) : ImmutableArray.Create<DiagnosticAnalyzer>(analyzer2);
Diagnostics\GetDiagnosticsTests.cs (14)
526var analyzers = new DiagnosticAnalyzer[] { new CSharpCompilerDiagnosticAnalyzer() }; 552var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(new CSharpCompilerDiagnosticAnalyzer()); 599static async Task verifyDiagnosticsAsync(Compilation compilation, DiagnosticAnalyzer analyzer, (string key, string value)? options) 662var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(new CSharpCompilerDiagnosticAnalyzer()); 715var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(new SymbolStartAnalyzer(topLevelAction: false, SymbolKind.NamedType, OperationKind.VariableDeclaration)); 744var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(analyzer); 784var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(new CSharpCompilerDiagnosticAnalyzer()); 838var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer), AnalyzerOptions.Empty); 1064var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(compilerAnalyzer), AnalyzerOptions.Empty); 1124var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer), AnalyzerOptions.Empty); 1438var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(new CSharpCompilerDiagnosticAnalyzer()); 1457analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(new CSharpCompilerDiagnosticAnalyzer(), suppressor); 1519var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer), AnalyzerOptions.Empty); 1698var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer), AnalyzerOptions.Empty);
Diagnostics\OperationAnalyzerTests.cs (39)
48.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new EmptyArrayAnalyzer() }, null, null, 110.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new BoxingOperationAnalyzer() }, null, null, 140.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new BadStuffTestAnalyzer() }, null, null, 189.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new BadStuffTestAnalyzer() }, null, null); 217.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new BigForTestAnalyzer() }, null, null, 282.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new SwitchTestAnalyzer() }, null, null, 347.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new InvocationTestAnalyzer() }, null, null, 424.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new FieldCouldBeReadOnlyAnalyzer() }, null, null, 496.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new FieldCouldBeReadOnlyAnalyzer() }, null, null, 551.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new LocalCouldBeConstAnalyzer() }, null, null, 722.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new SymbolCouldHaveMoreSpecificTypeAnalyzer() }, null, null, 787.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new SeventeenTestAnalyzer() }, null, null, 827.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new NullArgumentTestAnalyzer() }, null, null, 880.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new MemberInitializerTestAnalyzer() }, null, null, 930.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new AssignmentTestAnalyzer() }, null, null, 979.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new ArrayInitializerTestAnalyzer() }, null, null, 1015.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new VariableDeclarationTestAnalyzer() }, null, null, 1079.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new CaseTestAnalyzer() }, null, null, 1120.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new ExplicitVsImplicitInstanceAnalyzer() }, null, null, 1156.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new MemberReferenceAnalyzer() }, null, null, 1219.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new ParamsArrayTestAnalyzer() }, null, null, 1244.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new EqualsValueTestAnalyzer() }, null, null, 1275.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new OwningSymbolTestAnalyzer() }, null, null, 1299.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new NoneOperationTestAnalyzer() }, null, null); 1339.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new AssignmentOperationSyntaxTestAnalyzer() }, null, null, 1388.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new AddressOfTestAnalyzer() }, null, null, 1432.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new LambdaTestAnalyzer() }, null, null, 1481.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new StaticMemberTestAnalyzer() }, null, null, 1507.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new LabelOperationsTestAnalyzer() }, null, null, 1566.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new UnaryAndBinaryOperationsTestAnalyzer() }, null, null, 1614.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new OperatorPropertyPullerTestAnalyzer() }, null, null); 1640.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new NullOperationSyntaxTestAnalyzer() }, null, null, 1675.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new ConversionExpressionCSharpTestAnalyzer() }, null, null, 1709.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new InvalidOperatorExpressionTestAnalyzer() }, null, null, 1739.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new InvocationTestAnalyzer() }, null, null); 1782.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new ConditionalAccessOperationTestAnalyzer() }, null, null, 1827.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new LiteralTestAnalyzer() }, null, null, Diagnostic("Literal", "null").WithArguments("null").WithLocation(6, 20), 1873.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new TrueFalseUnaryOperationTestAnalyzer() }, null, null, 1899.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new OperationBlockAnalyzer() }, null, null,
Microsoft.CodeAnalysis.CSharp.Features (1)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper`1.cs (1)
25/// requirements with <see cref="DiagnosticAnalyzer"/> and "CodeRefactoringProvider".
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (142)
Diagnostics\Configuration\ConfigureCodeStyle\BooleanCodeStyleOptionConfigurationTests.cs (2)
26internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 28return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>(
Diagnostics\Configuration\ConfigureCodeStyle\EnumCodeStyleOptionConfigurationTests.cs (2)
26internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 42return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>(
Diagnostics\Configuration\ConfigureCodeStyle\MultipleCodeStyleOptionConfigurationTests.cs (2)
37internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 44return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>(
Diagnostics\Configuration\ConfigureSeverity\AllAnalyzersSeverityConfigurationTests.cs (2)
47internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 49return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>(
Diagnostics\Configuration\ConfigureSeverity\CategoryBasedSeverityConfigurationTests.cs (2)
47internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 49return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>(
Diagnostics\Configuration\ConfigureSeverity\CodeStyleOptionBasedSeverityConfigurationTests.cs (2)
26internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 28return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>(
Diagnostics\Configuration\ConfigureSeverity\CSharpCodeStyleOptionBasedSeverityConfigurationTests.cs (2)
26internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 28return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>(
Diagnostics\Configuration\ConfigureSeverity\DotNetDiagnosticSeverityBasedSeverityConfigurationTests.cs (2)
47internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 49return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>(
Diagnostics\Configuration\ConfigureSeverity\MultipleCodeStyleOptionBasedSeverityConfigurationTests.cs (2)
26internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 28return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>(
Diagnostics\Configuration\ConfigureSeverity\VarForBuiltInTypesSeverityConfigurationTests.cs (1)
26internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace)
Diagnostics\Suppression\RemoveSuppressionTests.cs (4)
56internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 58return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>( 945internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 947return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>(
Diagnostics\Suppression\RemoveUnnecessaryPragmaSuppressionsTests.cs (10)
144internal override ImmutableArray<DiagnosticAnalyzer> OtherAnalyzers 145=> ImmutableArray.Create<DiagnosticAnalyzer>(new CSharpCompilerDiagnosticAnalyzer()); 183internal override ImmutableArray<DiagnosticAnalyzer> OtherAnalyzers 184=> ImmutableArray.Create<DiagnosticAnalyzer>(new UserDiagnosticAnalyzer(), new CompilationEndDiagnosticAnalyzer()); 1018internal override ImmutableArray<DiagnosticAnalyzer> OtherAnalyzers 1019=> ImmutableArray.Create<DiagnosticAnalyzer>(new CSharpCompilerDiagnosticAnalyzer(), new UserDiagnosticAnalyzer()); 1315internal override ImmutableArray<DiagnosticAnalyzer> OtherAnalyzers 1316=> ImmutableArray.Create<DiagnosticAnalyzer>(new NonLocalDiagnosticsAnalyzer()); 1341internal override ImmutableArray<DiagnosticAnalyzer> OtherAnalyzers 1342=> ImmutableArray.Create<DiagnosticAnalyzer>(new CSharpUseAutoPropertyAnalyzer());
Diagnostics\Suppression\SuppressionTest_FixMultipleTests.cs (2)
30internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 32return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>(
Diagnostics\Suppression\SuppressionTests.cs (26)
49internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 50=> Tuple.Create<DiagnosticAnalyzer, IConfigurationFixProvider>(null, new CSharpSuppressionCodeFixProvider()); 664internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 666return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>( 713internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 715return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>( 750internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 752return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>( 823internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 825return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>( 886internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 888return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>( 936internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 938return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>( 971internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 972=> Tuple.Create<DiagnosticAnalyzer, IConfigurationFixProvider>(null, new CSharpSuppressionCodeFixProvider()); 992internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 994return Tuple.Create<DiagnosticAnalyzer, IConfigurationFixProvider>( 1029internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 1031return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>( 1116internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 1118return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>( 2086internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 2088return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>( 2464internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 2466return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>(
EmbeddedLanguages\ValidateJsonStringTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider?) CreateDiagnosticProviderAndFixer(Workspace workspace)
EmbeddedLanguages\ValidateRegexStringTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider?) CreateDiagnosticProviderAndFixer(Workspace workspace)
FullyQualify\FullyQualifyTests.cs (1)
29internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
FullyQualify\FullyQualifyUnboundIdentifierTests.cs (1)
28internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
GenerateVariable\GenerateVariableTests.cs (1)
38internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
MakeLocalFunctionStatic\PassInCapturedVariablesAsArgumentsCodeFixProviderTests.cs (1)
26internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
PreferFrameworkType\PreferFrameworkTypeTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
RemoveUnnecessaryCast\RemoveUnnecessaryCastTests_AsTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
RemoveUnusedVariable\RemoveUnusedVariableTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
SimplifyThisOrMe\SimplifyThisOrMeTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
SimplifyTypeNames\SimplifyTypeNamesTests.cs (1)
31internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
SpellCheck\SpellCheckTests.cs (1)
29internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\AddAccessibilityModifiers\AddAccessibilityModifiersFixAllTests.cs (1)
27internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\AddAnonymousTypeMemberName\AddAnonymousTypeMemberNameTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\AddBraces\AddBracesTests.cs (1)
27internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\AddExplicitCast\AddExplicitCastTests.cs (1)
22internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\AddParameter\AddParameterTests.cs (1)
30internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\AddRequiredParentheses\AddRequiredExpressionParenthesesTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\AddRequiredParentheses\AddRequiredPatternParenthesesTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\AliasAmbiguousType\AliasAmbiguousTypeTests.cs (1)
29internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\ConditionalExpressionInStringInterpolation\CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProviderTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\DocumentationComments\AddDocCommentNodesCodeFixProviderTests.cs (1)
28internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\DocumentationComments\RemoveDocCommentNodeCodeFixProviderTests.cs (1)
28internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\GenerateConstructor\GenerateConstructorTests.cs (1)
25internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\GenerateEnumMember\GenerateEnumMemberTests.cs (1)
22internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\GenerateMethod\GenerateConversionTests.cs (1)
23internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\GenerateMethod\GenerateDeconstructMethodTests.cs (1)
22internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\GenerateMethod\GenerateMethodTests.cs (1)
22internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\HideBase\HideBaseTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\ImplementAbstractClass\ImplementAbstractClassTests.cs (1)
26internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\ImplementAbstractClass\ImplementAbstractClassTests_ThroughMember.cs (1)
29internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\InlineDeclaration\CSharpInlineDeclarationTests.cs (1)
24internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessTests.cs (1)
25internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\Iterator\ChangeToIEnumerableTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\MakeFieldReadonly\MakeFieldReadonlyTests.cs (1)
42internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\MakeLocalFunctionStatic\MakeLocalFunctionStaticTests.cs (1)
27internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\MakeMethodAsynchronous\MakeMethodAsynchronousTests.cs (1)
26internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\MakeRefStruct\MakeRefStructTests.cs (1)
45internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\MakeTypeAbstract\MakeTypeAbstractTests.cs (1)
25internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\MisplacedUsingDirectives\MisplacedUsingDirectivesTests.cs (1)
29internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\NamingStyles\NamingStylesTests.cs (1)
27internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\Nullable\CSharpDeclareAsNullableCodeFixTests.cs (1)
21internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\OrderModifiers\OrderModifiersCompilerErrorTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\OrderModifiers\OrderModifiersTests.cs (1)
25internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\PopulateSwitch\PopulateSwitchExpressionTests.cs (1)
24internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\PopulateSwitch\PopulateSwitchStatementTests.cs (1)
20internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\QualifyMemberAccess\QualifyMemberAccessTests.cs (1)
27internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\RemoveInKeyword\RemoveInKeywordCodeFixProviderTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\RemoveNewModifier\RemoveNewModifierCodeFixProviderTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\RemoveUnnecessaryCast\RemoveUnnecessaryCastTests_FixAllTests.cs (1)
23internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\RemoveUnnecessaryImports\RemoveUnnecessaryImportsTests_FixAllTests.cs (1)
25internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\RemoveUnnecessaryParentheses\RemoveUnnecessaryExpressionParenthesesTests.cs (1)
27internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\RemoveUnnecessaryParentheses\RemoveUnnecessaryPatternParenthesesTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\RemoveUnusedLocalFunction\RemoveUnusedLocalFunctionTests.cs (1)
26internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedParametersTests.cs (1)
32internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedValuesTestsBase.cs (1)
24internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\ReplaceDefaultLiteral\ReplaceDefaultLiteralTests.cs (1)
26internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\SimplifyBooleanExpression\SimplifyConditionalTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\SimplifyInterpolation\SimplifyInterpolationTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UpdateProjectToAllowUnsafe\UpdateProjectToAllowUnsafeTests.cs (1)
27internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UpgradeProject\UpgradeProjectTests.cs (1)
28internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseAutoProperty\UseAutoPropertyTests.cs (1)
27internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseCoalesceExpression\UseCoalesceExpressionForNullableTernaryConditionalCheckTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseCoalesceExpression\UseCoalesceExpressionForTernaryConditionalCheckTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseConditionalExpression\UseConditionalExpressionForReturnTests.cs (1)
25internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseExplicitTypeForConst\UseExplicitTypeForConstTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseExpressionBodyForLambda\UseExpressionBodyForLambdasAnalyzerTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseImplicitOrExplicitType\UseExplicitTypeTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseImplicitOrExplicitType\UseImplicitTypeTests.cs (1)
29internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseInferredMemberName\UseInferredMemberNameTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseInterpolatedVerbatimString\UseInterpolatedVerbatimStringCodeFixTests.cs (1)
25internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseIsNullCheck\UseIsNullCheckForCastAndEqualityOperatorTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseIsNullCheck\UseIsNullCheckForReferenceEqualsTests.cs (1)
30internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseLocalFunction\UseLocalFunctionTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UsePatternMatching\CSharpAsAndNullCheckTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzerTests.cs (1)
30internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseSystemHashCode\UseSystemHashCodeTests.cs (1)
23internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\UseThrowExpression\UseThrowExpressionTests.cs (1)
29internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
src\Analyzers\CSharp\Tests\ValidateFormatString\ValidateFormatStringTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider?) CreateDiagnosticProviderAndFixer(Workspace workspace)
UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzerTests.cs (1)
37internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzerTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (5)
MockCSharpCompiler.cs (5)
19private readonly ImmutableArray<DiagnosticAnalyzer> _analyzers; 27public MockCSharpCompiler(string responseFile, string workingDirectory, string[] args, ImmutableArray<DiagnosticAnalyzer> analyzers = default, ImmutableArray<ISourceGenerator> generators = default, AnalyzerAssemblyLoader loader = null, ImmutableArray<MetadataReference> additionalReferences = default) 32public MockCSharpCompiler(string responseFile, BuildPaths buildPaths, string[] args, ImmutableArray<DiagnosticAnalyzer> analyzers = default, ImmutableArray<ISourceGenerator> generators = default, AnalyzerAssemblyLoader loader = null, GeneratorDriverCache driverCache = null, ImmutableArray<MetadataReference> additionalReferences = default) 47out ImmutableArray<DiagnosticAnalyzer> analyzers, 64out ImmutableArray<DiagnosticAnalyzer> analyzers,
Microsoft.CodeAnalysis.EditorFeatures (7)
EditorConfigSettings\DataProvider\Analyzer\AnalyzerSettingsProvider.cs (7)
41IEnumerable<DiagnosticAnalyzer> csharpAnalyzers = analyzerReference.GetAnalyzers(LanguageNames.CSharp); 42IEnumerable<DiagnosticAnalyzer> visualBasicAnalyzers = analyzerReference.GetAnalyzers(LanguageNames.VisualBasic); 51IEnumerable<AnalyzerSetting> ToAnalyzerSetting(IEnumerable<DiagnosticAnalyzer> analyzers, 69private class DiagnosticAnalyzerComparer : IEqualityComparer<DiagnosticAnalyzer> 73public bool Equals(DiagnosticAnalyzer? x, DiagnosticAnalyzer? y) 84public int GetHashCode(DiagnosticAnalyzer obj) => obj.GetAnalyzerIdAndVersion().GetHashCode();
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (6)
Diagnostics\DiagnosticTaggerWrapper.cs (1)
34IReadOnlyDictionary<string, ImmutableArray<DiagnosticAnalyzer>>? analyzerMap = null,
Diagnostics\MockDiagnosticAnalyzerService.cs (2)
64public Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, Func<Project, DocumentId?, IReadOnlyList<DocumentId>>? getDocuments, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 70public Task<ImmutableArray<DiagnosticData>> GetProjectDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeSuppressedDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken)
LanguageServer\AbstractLanguageServerProtocolTests.InitializationOptions.cs (1)
30internal IEnumerable<DiagnosticAnalyzer>? AdditionalAnalyzers { get; init; } = null;
Squiggles\SquiggleUtilities.cs (1)
32IReadOnlyDictionary<string, ImmutableArray<DiagnosticAnalyzer>> analyzerMap = null)
Squiggles\TestDiagnosticTagProducer.cs (1)
22IReadOnlyDictionary<string, ImmutableArray<DiagnosticAnalyzer>>? analyzerMap = null)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (46)
CodeFixes\CodeFixServiceTests.cs (19)
77ImmutableArray.Create<DiagnosticAnalyzer>( 101ImmutableArray.Create<DiagnosticAnalyzer>( 131var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(analyzerWithFix, analyzerWithoutFix); 167var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(documentDiagnosticAnalyzer); 196var analyzers = ImmutableArray<DiagnosticAnalyzer>.Empty; 281private static async Task<ImmutableArray<CodeFixCollection>> GetAddedFixesAsync(CodeFixProvider codefix, DiagnosticAnalyzer diagnosticAnalyzer, bool exception = false, bool throwExceptionInFixerCreation = false) 449public readonly ImmutableArray<DiagnosticAnalyzer> Analyzers; 453private static readonly ImmutableArray<DiagnosticAnalyzer> s_defaultAnalyzers = ImmutableArray.Create<DiagnosticAnalyzer>(new MockDiagnosticAnalyzer()); 455public MockAnalyzerReference(ImmutableArray<CodeFixProvider> fixers, ImmutableArray<DiagnosticAnalyzer> analyzers, ImmutableArray<ISourceGenerator> generators) 462public MockAnalyzerReference(ImmutableArray<CodeFixProvider> fixers, ImmutableArray<DiagnosticAnalyzer> analyzers) 467public MockAnalyzerReference(CodeFixProvider? fixer, ImmutableArray<DiagnosticAnalyzer> analyzers) 507public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzers(string language) 510public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzersForAllLanguages() 511=> ImmutableArray<DiagnosticAnalyzer>.Empty; 777var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(diagnosticAnalyzer); 878var analyzerReference = new MockAnalyzerReference(fixers, ImmutableArray.Create<DiagnosticAnalyzer>(analyzer)); 1033var analyzerReference = new MockAnalyzerReference(codeFix, ImmutableArray.Create<DiagnosticAnalyzer>(analyzer)); 1103var lowPriorityAnalyzer = Assert.Single(lowPriorityAnalyzerData.Analyzers);
CodeRefactorings\CodeRefactoringServiceTest.cs (4)
144public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzers(string language) 145=> ImmutableArray<DiagnosticAnalyzer>.Empty; 147public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzersForAllLanguages() 148=> ImmutableArray<DiagnosticAnalyzer>.Empty;
Completion\CompletionServiceTests.cs (4)
85public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzers(string language) 86=> ImmutableArray<DiagnosticAnalyzer>.Empty; 88public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzersForAllLanguages() 89=> ImmutableArray<DiagnosticAnalyzer>.Empty;
Diagnostics\DiagnosticAnalyzerServiceTests.cs (15)
60var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(new Analyzer())); 81var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(new Analyzer())); 99var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(new Analyzer())); 114var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(new CSharpCompilerDiagnosticAnalyzer())); 130var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(new CSharpCompilerDiagnosticAnalyzer())); 149var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(new DisabledByDefaultAnalyzer())); 245var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>( 292var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>( 367private static AdhocWorkspace CreateWorkspaceWithProjectAndAnalyzer(DiagnosticAnalyzer analyzer) 429var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(analyzer); 491var analyzers = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(); 556var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>( 701var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer1, analyzer2)); 746var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer)); 815var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer));
Diagnostics\IDEDiagnosticIDConfigurationTests.cs (1)
33foreach (var analyzer in analyzerReference.GetAnalyzers(languageName))
Diagnostics\SuppressMessageAttributeWorkspaceTests.cs (1)
54protected override async Task VerifyAsync(string source, string language, DiagnosticAnalyzer[] analyzers, DiagnosticDescription[] expectedDiagnostics, string rootNamespace = null)
Preview\PreviewWorkspaceTests.cs (2)
139var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(new CommonDiagnosticAnalyzers.NotConfigurableDiagnosticAnalyzer()); 163private static void ExecuteAnalyzers(PreviewWorkspace previewWorkspace, ImmutableArray<DiagnosticAnalyzer> analyzers)
Microsoft.CodeAnalysis.EditorFeatures.Wpf (3)
Suggestions\SuggestedActionPriorityProvider.cs (3)
26public ConcurrentSet<DiagnosticAnalyzer> Analyzers { get; } = new(); 30public void AddDeprioritizedAnalyzerWithLowPriority(DiagnosticAnalyzer analyzer) 38public bool IsDeprioritizedAnalyzerWithLowPriority(DiagnosticAnalyzer analyzer)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (60)
CodeFixes\CodeFixServiceTests.vb (2)
52Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(workspaceDiagnosticAnalyzer)) 124Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(workspaceDiagnosticAnalyzer))
Diagnostics\AbstractCrossLanguageUserDiagnosticTest.vb (2)
36Friend MustOverride Function CreateDiagnosticProviderAndFixer(workspace As Workspace, language As String) As (DiagnosticAnalyzer, CodeFixProvider) 135Public Shared Sub AddAnalyzerToWorkspace(workspace As Workspace, analyzer As DiagnosticAnalyzer)
Diagnostics\AddImport\AddImportCrossLanguageTests.vb (1)
23Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace, language As String) As (DiagnosticAnalyzer, CodeFixProvider)
Diagnostics\AdditionalFileDiagnosticsTests.vb (1)
21Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace, language As String) As (DiagnosticAnalyzer, CodeFixProvider)
Diagnostics\AddMissingReference\AddMissingReferenceTests.vb (1)
29Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace, language As String) As (DiagnosticAnalyzer, CodeFixProvider)
Diagnostics\DiagnosticProviderTests.vb (1)
284NoCompilationConstants.LanguageName, ImmutableArray.Create(Of DiagnosticAnalyzer)(New NoCompilationDocumentDiagnosticAnalyzer()))
Diagnostics\DiagnosticServiceTests.vb (46)
86Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(workspaceDiagnosticAnalyzer)) 109Dim projectAnalyzers1 = ImmutableArray.Create(Of DiagnosticAnalyzer)(projectDiagnosticAnalyzer1) 125Dim projectAnalyzers2 = ImmutableArray.Create(Of DiagnosticAnalyzer)(projectDiagnosticAnalyzer2) 191Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(workspaceDiagnosticAnalyzer)) 201Dim projectAnalyzersEmpty = ImmutableArray(Of DiagnosticAnalyzer).Empty 231ImmutableArray.Create(Of DiagnosticAnalyzer)(New TestDiagnosticAnalyzer1(0)), display:=referenceName) 240ImmutableArray.Create(Of DiagnosticAnalyzer)(New TestDiagnosticAnalyzer1(1)), display:=referenceName) 271Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(workspaceDiagnosticAnalyzer)) 334Dim analyzer1 As DiagnosticAnalyzer = New TestDiagnosticAnalyzer1(1) 335Dim analyzer2 As DiagnosticAnalyzer = New TestDiagnosticAnalyzer2(2) 381Dim analyzersMap = New Dictionary(Of String, ImmutableArray(Of DiagnosticAnalyzer)) From 383{LanguageNames.CSharp, ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer1)}, 384{LanguageNames.VisualBasic, ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer2)} 464Dim analyzerReference1 = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 465Dim analyzerReference2 = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 488Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 523Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 569Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 603Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 636Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 670Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 746Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 782Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 842Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 867Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 906Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 941Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 980Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 1003Await TestDiagnosticsReportedOnAllPartialDefinitionsCoreAsync(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 1015Await TestDiagnosticsReportedOnAllPartialDefinitionsCoreAsync(ImmutableArray.Create(Of DiagnosticAnalyzer)(dummyAnalyzer, analyzer)) 1019Private Shared Async Function TestDiagnosticsReportedOnAllPartialDefinitionsCoreAsync(analyzers As ImmutableArray(Of DiagnosticAnalyzer)) As Task 1087Dim analyzer As DiagnosticAnalyzer = New CodeBlockOrSyntaxNodeAnalyzer(isCodeBlockAnalyzer:=True) 1130Dim analyzer As DiagnosticAnalyzer = New CodeBlockOrSyntaxNodeAnalyzer(isCodeBlockAnalyzer:=False) 1173Dim analyzer As DiagnosticAnalyzer = New MethodSymbolAnalyzer 1226Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 1289Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 1336Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 1402Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 1957Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 2011Private Shared Async Function TestGenericNameCoreAsync(test As XElement, expectedMessage As String, expectedId As String, ParamArray analyzers As DiagnosticAnalyzer()) As Task 2084Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 2123Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 2227Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 2272Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(compilerAnalyzer, syntaxAnalyzer, semanticAnalyzer)) 2342Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(compilerAnalyzer, syntaxAnalyzer, semanticAnalyzer)) 2432Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer))
Diagnostics\GenerateEvent\GenerateEventCrossLanguageTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace, language As String) As (DiagnosticAnalyzer, CodeFixProvider)
Diagnostics\GenerateFromUsage\GenerateConstructorCrossLanguageTests.vb (1)
12Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace, language As String) As (DiagnosticAnalyzer, CodeFixProvider)
Diagnostics\GenerateFromUsage\GenerateMethodCrossLanguageTests.vb (1)
19Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace, language As String) As (DiagnosticAnalyzer, CodeFixProvider)
Diagnostics\GenerateFromUsage\GenerateVariableCrossLanguageTests.vb (1)
21Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace, language As String) As (DiagnosticAnalyzer, CodeFixProvider)
Diagnostics\ImplementInterface\ImplementInterfaceCrossLanguageTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace, language As String) As (DiagnosticAnalyzer, CodeFixProvider)
Diagnostics\UseAutoProperty\UseAutoPropertyTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace, language As String) As (DiagnosticAnalyzer, CodeFixProvider)
Microsoft.CodeAnalysis.Features (27)
CodeFixesAndRefactorings\CodeActionRequestPriorityProvider.cs (6)
23void AddDeprioritizedAnalyzerWithLowPriority(DiagnosticAnalyzer analyzer); 25bool IsDeprioritizedAnalyzerWithLowPriority(DiagnosticAnalyzer analyzer); 42public static bool MatchesPriority(this ICodeActionRequestPriorityProvider provider, DiagnosticAnalyzer analyzer) 116private HashSet<DiagnosticAnalyzer>? _lowPriorityAnalyzers; 121public void AddDeprioritizedAnalyzerWithLowPriority(DiagnosticAnalyzer analyzer) 152public bool IsDeprioritizedAnalyzerWithLowPriority(DiagnosticAnalyzer analyzer)
Diagnostics\DiagnosticAnalyzerExtensions.cs (8)
18public static bool IsWorkspaceDiagnosticAnalyzer(this DiagnosticAnalyzer analyzer) 24public static bool IsBuiltInAnalyzer(this DiagnosticAnalyzer analyzer) 34public static (string analyzerId, VersionStamp version) GetAnalyzerIdAndVersion(this DiagnosticAnalyzer analyzer) 52public static string GetAnalyzerAssemblyName(this DiagnosticAnalyzer analyzer) 55public static void AppendAnalyzerMap(this Dictionary<string, DiagnosticAnalyzer> analyzerMap, ImmutableArray<DiagnosticAnalyzer> analyzers) 57foreach (var analyzer in analyzers) 64public static IEnumerable<AnalyzerPerformanceInfo> ToAnalyzerPerformanceInfo(this IDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo> analysisResult, DiagnosticAnalyzerInfoCache analyzerInfo)
Diagnostics\DiagnosticAnalyzerTelemetry.cs (1)
50public void UpdateAnalyzerActionsTelemetry(DiagnosticAnalyzer analyzer, AnalyzerTelemetryInfo analyzerTelemetryInfo, bool isTelemetryCollectionAllowed)
Diagnostics\IDiagnosticAnalyzerService.cs (4)
58/// Note that for project case, this method returns diagnostics from all project documents as well. Use <see cref="GetProjectDiagnosticsForIdsAsync(Solution, ProjectId?, ImmutableHashSet{string}?, Func{DiagnosticAnalyzer, bool}?, bool, bool, CancellationToken)"/> 79Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, Func<Project, DocumentId?, IReadOnlyList<DocumentId>>? getDocumentIds, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken); 98Task<ImmutableArray<DiagnosticData>> GetProjectDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeSuppressedDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken); 167this IDiagnosticAnalyzerService service, Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken)
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.LanguageServer.Protocol (132)
Features\Diagnostics\DiagnosticAnalyzerService.cs (2)
114Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, Func<Project, DocumentId?, IReadOnlyList<DocumentId>>? getDocuments, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 122Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeSuppressedDiagnostics,
Features\Diagnostics\DocumentAnalysisExecutor.cs (9)
34private readonly ImmutableArray<DiagnosticAnalyzer> _compilationBasedProjectAnalyzersInAnalysisScope; 35private readonly ImmutableArray<DiagnosticAnalyzer> _compilationBasedHostAnalyzersInAnalysisScope; 37private ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>? _lazySyntaxDiagnostics; 38private ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>? _lazySemanticDiagnostics; 74public async Task<IEnumerable<DiagnosticData>> ComputeDiagnosticsAsync(DiagnosticAnalyzer analyzer, CancellationToken cancellationToken) 182private async Task<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>> GetAnalysisResultAsync(DocumentAnalysisScope analysisScope, CancellationToken cancellationToken) 212private async Task<ImmutableArray<DiagnosticData>> GetCompilerAnalyzerDiagnosticsAsync(DiagnosticAnalyzer analyzer, TextSpan? span, CancellationToken cancellationToken) 231private async Task<ImmutableArray<DiagnosticData>> GetSyntaxDiagnosticsAsync(DiagnosticAnalyzer analyzer, bool isCompilerAnalyzer, CancellationToken cancellationToken) 266private async Task<ImmutableArray<DiagnosticData>> GetSemanticDiagnosticsAsync(DiagnosticAnalyzer analyzer, bool isCompilerAnalyzer, CancellationToken cancellationToken)
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (4)
56internal static Diagnostic CreateAnalyzerExceptionDiagnostic(DiagnosticAnalyzer analyzer, Exception e) 133ImmutableArray<DiagnosticAnalyzer> projectAnalyzers, 134ImmutableArray<DiagnosticAnalyzer> hostAnalyzers, 214public static bool IsAnalyzerEnabledForProject(DiagnosticAnalyzer analyzer, Project project, IGlobalOptionService globalOptions)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.AnalysisData.cs (9)
80public readonly ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> Result; 85public readonly ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>? OldResult; 87public ProjectAnalysisData(ProjectId projectId, VersionStamp version, ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> result) 99ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> oldResult, 100ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> newResult) 106public DiagnosticAnalysisResult GetResult(DiagnosticAnalyzer analyzer) 109public bool TryGetResult(DiagnosticAnalyzer analyzer, out DiagnosticAnalysisResult result) 116var builder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, DiagnosticAnalysisResult>(); 141return new ProjectAnalysisData(project.Id, VersionStamp.Default, ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>.Empty);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.cs (3)
72private static DiagnosticAnalysisResult GetResultOrEmpty(ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> map, DiagnosticAnalyzer analyzer, ProjectId projectId, VersionStamp version) 82internal async Task<IEnumerable<DiagnosticAnalyzer>> GetAnalyzersTestOnlyAsync(Project project, CancellationToken cancellationToken)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.Executor.cs (20)
56private static async Task<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>> RemoveCompilerSemanticErrorsIfProjectNotLoadedAsync( 57ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> result, Project project, CancellationToken cancellationToken) 91private async Task<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>> ComputeDiagnosticsAsync( 92CompilationWithAnalyzersPair? compilationWithAnalyzers, Project project, ImmutableArray<DiagnosticAnalyzer> ideAnalyzers, CancellationToken cancellationToken) 96var result = ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>.Empty; 122private async Task<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>> ComputeDiagnosticsAsync( 124ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> existing, CancellationToken cancellationToken) 164private static ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> MergeExistingDiagnostics( 165VersionStamp version, ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> existing, ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> result) 188ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> existing, 189out ImmutableArray<DiagnosticAnalyzer> projectAnalyzers, 190out ImmutableArray<DiagnosticAnalyzer> hostAnalyzers) 236private async Task<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>> MergeProjectDiagnosticAnalyzerDiagnosticsAsync( 238ImmutableArray<DiagnosticAnalyzer> ideAnalyzers, 240ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> result, 249foreach (var analyzer in ideAnalyzers) 296private async Task<(ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> results, ImmutableHashSet<Document>? failedDocuments)> UpdateWithDocumentLoadAndGeneratorFailuresAsync( 297ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> results, 345private void UpdateAnalyzerTelemetryData(ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo> telemetry)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.IncrementalMemberEditAnalyzer.cs (10)
46public async Task<ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>>> ComputeDiagnosticsAsync( 50Func<DiagnosticAnalyzer, DocumentAnalysisExecutor, CancellationToken, Task<ImmutableArray<DiagnosticData>>> computeAnalyzerDiagnosticsAsync, 51Func<DocumentAnalysisExecutor, CancellationToken, Task<ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>>>> computeDiagnosticsNonIncrementallyAsync, 116using var _ = PooledDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>>.GetInstance(out var builder); 132PooledDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>> builder) 147PooledDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>> builder) 159PooledDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>> builder) 172PooledDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>> builder) 239DiagnosticAnalyzer analyzer, 244Func<DiagnosticAnalyzer, DocumentAnalysisExecutor, CancellationToken, Task<ImmutableArray<DiagnosticData>>> computeAnalyzerDiagnosticsAsync,
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.InMemoryStorage.cs (5)
16private static readonly ConcurrentDictionary<DiagnosticAnalyzer, ConcurrentDictionary<(object key, string stateKey), CacheEntry>> s_map = 19public static bool TryGetValue(DiagnosticAnalyzer analyzer, (object key, string stateKey) key, out CacheEntry entry) 28public static void Cache(DiagnosticAnalyzer analyzer, (object key, string stateKey) key, CacheEntry entry) 37public static void Remove(DiagnosticAnalyzer analyzer, (object key, string stateKey) key) 54public static void DropCache(DiagnosticAnalyzer analyzer)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.InProcOrRemoteHostAnalyzerRunner.cs (14)
40public Task<DiagnosticAnalysisResultMap<DiagnosticAnalyzer, DiagnosticAnalysisResult>> AnalyzeDocumentAsync( 50public Task<DiagnosticAnalysisResultMap<DiagnosticAnalyzer, DiagnosticAnalysisResult>> AnalyzeProjectAsync( 59private async Task<DiagnosticAnalysisResultMap<DiagnosticAnalyzer, DiagnosticAnalysisResult>> AnalyzeAsync( 69return DiagnosticAnalysisResultMap<DiagnosticAnalyzer, DiagnosticAnalysisResult>.Empty; 75async Task<DiagnosticAnalysisResultMap<DiagnosticAnalyzer, DiagnosticAnalysisResult>> AnalyzeCoreAsync() 114private async Task<DiagnosticAnalysisResultMap<DiagnosticAnalyzer, DiagnosticAnalysisResult>> AnalyzeInProcAsync( 140var builderMap = ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResultBuilder>.Empty; 151var telemetry = ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo>.Empty; 194private static async Task<DiagnosticAnalysisResultMap<DiagnosticAnalyzer, DiagnosticAnalysisResult>> AnalyzeOutOfProcAsync( 204using var pooledObject1 = SharedPools.Default<Dictionary<string, DiagnosticAnalyzer>>().GetPooledObject(); 205using var pooledObject2 = SharedPools.Default<Dictionary<string, DiagnosticAnalyzer>>().GetPooledObject(); 217return DiagnosticAnalysisResultMap<DiagnosticAnalyzer, DiagnosticAnalysisResult>.Empty; 239return DiagnosticAnalysisResultMap<DiagnosticAnalyzer, DiagnosticAnalysisResult>.Empty; 247return new DiagnosticAnalysisResultMap<DiagnosticAnalyzer, DiagnosticAnalysisResult>(
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.cs (8)
93/// Return <see cref="StateSet"/> for the given <see cref="DiagnosticAnalyzer"/> in the context of <see cref="Project"/>. 97public async Task<StateSet?> GetOrCreateStateSetAsync(Project project, DiagnosticAnalyzer analyzer, CancellationToken cancellationToken) 133private static ImmutableDictionary<DiagnosticAnalyzer, StateSet> CreateStateSetMap( 135IEnumerable<ImmutableArray<DiagnosticAnalyzer>> projectAnalyzerCollection, 136IEnumerable<ImmutableArray<DiagnosticAnalyzer>> hostAnalyzerCollection, 139var builder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, StateSet>(); 149foreach (var analyzer in analyzers) 168foreach (var analyzer in analyzers)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.HostStates.cs (9)
53static (IEnumerable<ImmutableArray<DiagnosticAnalyzer>> HostAnalyzerCollection, IEnumerable<ImmutableArray<DiagnosticAnalyzer>> ProjectAnalyzerCollection) GetAnalyzerCollections( 54ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> analyzersPerReference, 62var hostAnalyzerCollection = ArrayBuilder<ImmutableArray<DiagnosticAnalyzer>>.GetInstance(); 63var projectAnalyzerCollection = ArrayBuilder<ImmutableArray<DiagnosticAnalyzer>>.GetInstance(); 117public readonly ImmutableDictionary<DiagnosticAnalyzer, StateSet> StateSetMap; 119private HostAnalyzerStateSets(ImmutableDictionary<DiagnosticAnalyzer, StateSet> stateSetMap, ImmutableArray<StateSet> orderedStateSets) 125public HostAnalyzerStateSets(ImmutableDictionary<DiagnosticAnalyzer, StateSet> analyzerMap) 135public HostAnalyzerStateSets WithExcludedAnalyzers(ImmutableHashSet<DiagnosticAnalyzer> excludedAnalyzers)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.ProjectStates.cs (11)
23ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>>.Empty, 24ImmutableDictionary<DiagnosticAnalyzer, StateSet>.Empty, 30public readonly ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> MapPerReferences; 32public readonly ImmutableDictionary<DiagnosticAnalyzer, StateSet> StateSetMap; 38ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> mapPerReferences, 39ImmutableDictionary<DiagnosticAnalyzer, StateSet> stateSetMap, 126ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> newMapPerReference, 127ImmutableDictionary<DiagnosticAnalyzer, StateSet> newMap) 159ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> mapPerReference, 160ImmutableDictionary<DiagnosticAnalyzer, StateSet> map) 178foreach (var analyzer in analyzers)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateSet.cs (3)
20/// this contains all states regarding a <see cref="DiagnosticAnalyzer"/> 25public readonly DiagnosticAnalyzer Analyzer; 31public StateSet(string language, DiagnosticAnalyzer analyzer, bool isHostAnalyzer)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnostics.cs (3)
21public Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, Func<Project, DocumentId?, IReadOnlyList<DocumentId>>? getDocuments, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 24public Task<ImmutableArray<DiagnosticData>> GetProjectDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeSuppressedDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 138public async Task<ImmutableArray<DiagnosticData>> GetSpecificDiagnosticsAsync(DiagnosticAnalyzer analyzer, AnalysisKind analysisKind, CancellationToken cancellationToken)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs (12)
73private delegate Task<IEnumerable<DiagnosticData>> DiagnosticsGetterAsync(DiagnosticAnalyzer analyzer, DocumentAnalysisExecutor executor, CancellationToken cancellationToken); 205var analyzer = stateSet.Analyzer; 264DiagnosticAnalyzer analyzer, 297DiagnosticAnalyzer analyzer, 323DiagnosticAnalyzer analyzer, 386ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>> diagnosticsMap; 415async Task<bool> TryDeprioritizeAnalyzerAsync(DiagnosticAnalyzer analyzer, DocumentAnalysisData existingData) 485async Task<bool> IsCandidateForDeprioritizationBasedOnRegisteredActionsAsync(DiagnosticAnalyzer analyzer) 505private async Task<ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>>> ComputeDocumentDiagnosticsCoreAsync( 509using var _ = PooledDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>>.GetInstance(out var builder); 520DiagnosticAnalyzer analyzer, 540private sealed record class AnalyzerWithState(DiagnosticAnalyzer Analyzer, bool IsHostAnalyzer, ActiveFileState State, DocumentAnalysisData ExistingData);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_IncrementalAnalyzer.cs (1)
107private bool IsCandidateForFullSolutionAnalysis(DiagnosticAnalyzer analyzer, bool isHostAnalyzer, Project project)
Features\Options\SolutionCrawlerOptionsStorage.cs (1)
92public static bool IsFullSolutionAnalysisEnabled(this DiagnosticAnalyzer analyzer, IGlobalOptionService globalOptions, string language)
Handler\Diagnostics\DiagnosticSourceProviders\WorkspaceDocumentsAndProjectDiagnosticSourceProvider.cs (2)
73Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer = !compilerFullSolutionAnalysisEnabled || !analyzersFullSolutionAnalysisEnabled 114bool ShouldIncludeAnalyzer(DiagnosticAnalyzer analyzer)
Handler\Diagnostics\DiagnosticSources\AbstractProjectDiagnosticSource.cs (2)
19public static AbstractProjectDiagnosticSource CreateForFullSolutionAnalysisDiagnostics(Project project, IDiagnosticAnalyzerService diagnosticAnalyzerService, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer) 36private sealed class FullSolutionAnalysisDiagnosticSource(Project project, IDiagnosticAnalyzerService diagnosticAnalyzerService, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer)
Handler\Diagnostics\DiagnosticSources\AbstractWorkspaceDocumentDiagnosticSource.cs (2)
18public static AbstractWorkspaceDocumentDiagnosticSource CreateForFullSolutionAnalysisDiagnostics(TextDocument document, IDiagnosticAnalyzerService diagnosticAnalyzerService, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer) 24private sealed class FullSolutionAnalysisDiagnosticSource(TextDocument document, IDiagnosticAnalyzerService diagnosticAnalyzerService, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer)
Handler\Diagnostics\DiagnosticSources\NonLocalDocumentDiagnosticSource.cs (2)
13internal sealed class NonLocalDocumentDiagnosticSource(TextDocument document, IDiagnosticAnalyzerService diagnosticAnalyzerService, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer) 16private readonly Func<DiagnosticAnalyzer, bool>? _shouldIncludeAnalyzer = shouldIncludeAnalyzer;
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (11)
Diagnostics\AbstractPullDiagnosticTestsBase.cs (6)
42var builder = ImmutableDictionary.CreateBuilder<string, ImmutableArray<DiagnosticAnalyzer>>(); 51builder.Add(InternalLanguageNames.TypeScript, ImmutableArray.Create<DiagnosticAnalyzer>(new MockTypescriptDiagnosticAnalyzer())); 315private protected Task<TestLspServer> CreateTestWorkspaceWithDiagnosticsAsync(string markup, bool mutatingLspWorkspace, BackgroundAnalysisScope analyzerDiagnosticsScope, bool useVSDiagnostics, CompilerDiagnosticsScope? compilerDiagnosticsScope = null, IEnumerable<DiagnosticAnalyzer>? additionalAnalyzers = null) 318private protected Task<TestLspServer> CreateTestWorkspaceWithDiagnosticsAsync(string[] markups, bool mutatingLspWorkspace, BackgroundAnalysisScope analyzerDiagnosticsScope, bool useVSDiagnostics, CompilerDiagnosticsScope? compilerDiagnosticsScope = null, IEnumerable<DiagnosticAnalyzer>? additionalAnalyzers = null) 321private protected Task<TestLspServer> CreateTestWorkspaceFromXmlAsync(string xmlMarkup, bool mutatingLspWorkspace, BackgroundAnalysisScope analyzerDiagnosticsScope, bool useVSDiagnostics, CompilerDiagnosticsScope? compilerDiagnosticsScope = null, IEnumerable<DiagnosticAnalyzer>? additionalAnalyzers = null) 330IEnumerable<DiagnosticAnalyzer>? additionalAnalyzers = null,
Diagnostics\AdditionalFileDiagnosticsTests.cs (1)
118=> new(ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>>.Empty.Add(LanguageNames.CSharp, ImmutableArray.Create(
Diagnostics\BuildOnlyDiagnosticIdsHandlerTests.cs (1)
52var builder = ImmutableDictionary.CreateBuilder<string, ImmutableArray<DiagnosticAnalyzer>>();
Diagnostics\NonLocalDiagnosticTests.cs (1)
71=> new(ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>>.Empty.Add(LanguageNames.CSharp, ImmutableArray.Create(
Diagnostics\PullDiagnosticTests.cs (1)
81var additionalAnalyzers = new DiagnosticAnalyzer[] { new CSharpSyntaxAnalyzer(), new CSharpSemanticAnalyzer() };
Diagnostics\WorkspaceProjectDiagnosticsTests.cs (1)
67=> new(ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>>.Empty.Add(LanguageNames.CSharp, ImmutableArray.Create(
Microsoft.CodeAnalysis.Rebuild.UnitTests (1)
DeterministicKeyBuilderTests.cs (1)
227protected static JArray GetAnalyzerValues(Compilation compilation, params DiagnosticAnalyzer[] analyzers)
Microsoft.CodeAnalysis.Remote.ServiceHub (29)
Services\DiagnosticAnalyzer\DiagnosticComputer.cs (28)
29/// Cache of <see cref="CompilationWithAnalyzers"/> and a map from analyzer IDs to <see cref="DiagnosticAnalyzer"/>s 371BidirectionalMap<string, DiagnosticAnalyzer> analyzerToIdMap, 372ImmutableArray<DiagnosticAnalyzer> projectAnalyzers, 373ImmutableArray<DiagnosticAnalyzer> hostAnalyzers, 404var builderMap = ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResultBuilder>.Empty; 421ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResultBuilder> builderMap, 422BidirectionalMap<string, DiagnosticAnalyzer> analyzerToIdMap) 443ImmutableArray<DiagnosticAnalyzer> projectAnalyzers, 444ImmutableArray<DiagnosticAnalyzer> hostAnalyzers, 445BidirectionalMap<string, DiagnosticAnalyzer> analyzerToIdMap) 447Func<DiagnosticAnalyzer, bool> shouldInclude; 452using var _1 = PooledHashSet<DiagnosticAnalyzer>.GetInstance(out var analyzersSet); 479private static string GetAnalyzerId(BidirectionalMap<string, DiagnosticAnalyzer> analyzerMap, DiagnosticAnalyzer analyzer) 487private static (ImmutableArray<DiagnosticAnalyzer> projectAnalyzers, ImmutableArray<DiagnosticAnalyzer> hostAnalyzers) GetAnalyzers(BidirectionalMap<string, DiagnosticAnalyzer> analyzerMap, ImmutableArray<string> projectAnalyzerIds, ImmutableArray<string> hostAnalyzerIds) 490var projectBuilder = ImmutableArray.CreateBuilder<DiagnosticAnalyzer>(); 491var hostBuilder = ImmutableArray.CreateBuilder<DiagnosticAnalyzer>(); 520private async Task<(CompilationWithAnalyzersPair? compilationWithAnalyzers, BidirectionalMap<string, DiagnosticAnalyzer> analyzerToIdMap)> GetOrCreateCompilationWithAnalyzersAsync(CancellationToken cancellationToken) 557using var pooledMap = SharedPools.Default<Dictionary<string, DiagnosticAnalyzer>>().GetPooledObject(); 562using var _1 = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(out var projectAnalyzerBuilder); 563using var _2 = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(out var hostAnalyzerBuilder); 605var analyzerToIdMap = new BidirectionalMap<string, DiagnosticAnalyzer>(analyzerMapBuilder); 617private async Task<CompilationWithAnalyzersPair> CreateCompilationWithAnalyzerAsync(ImmutableArray<DiagnosticAnalyzer> projectAnalyzers, ImmutableArray<DiagnosticAnalyzer> hostAnalyzers, CancellationToken cancellationToken) 661public BidirectionalMap<string, DiagnosticAnalyzer> AnalyzerToIdMap { get; } 663public CompilationWithAnalyzersCacheEntry(Checksum solutionChecksum, Project project, CompilationWithAnalyzersPair? compilationWithAnalyzers, BidirectionalMap<string, DiagnosticAnalyzer> analyzerToIdMap)
Services\DiagnosticAnalyzer\PerformanceQueue.cs (1)
204public int GetUniqueNumber(DiagnosticAnalyzer analyzer)
Microsoft.CodeAnalysis.Test.Utilities (39)
Diagnostics\DiagnosticExtensions.cs (25)
144DiagnosticAnalyzer[] analyzers, 146Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null) 154DiagnosticAnalyzer[] analyzers, 156Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null, 165DiagnosticAnalyzer[] analyzers, 168Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null, 179DiagnosticAnalyzer[] analyzers, 181Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null, 190DiagnosticAnalyzer[] analyzers, 193Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null, 203DiagnosticAnalyzer[] analyzers, 205Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null, 225DiagnosticAnalyzer[] analyzers, 227Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException, 283DiagnosticAnalyzer[] analyzers, 285Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null, 297DiagnosticAnalyzer[] analyzers, 299Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException, 333/// Given a set of compiler or <see cref="DiagnosticAnalyzer"/> generated <paramref name="diagnostics"/>, returns the effective diagnostics after applying the below filters: 348public static bool IsDiagnosticAnalyzerSuppressed(this DiagnosticAnalyzer analyzer, CompilationOptions options) 394public static DiagnosticAnalyzer GetCompilerDiagnosticAnalyzer(string languageName) 397(DiagnosticAnalyzer)new Diagnostics.CSharp.CSharpCompilerDiagnosticAnalyzer() : 401public static ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> GetCompilerDiagnosticAnalyzersMap() 403var builder = ImmutableDictionary.CreateBuilder<string, ImmutableArray<DiagnosticAnalyzer>>(); 411var analyzer = GetCompilerDiagnosticAnalyzer(languageName);
Diagnostics\SuppressMessageAttributeTests.cs (8)
64new DiagnosticAnalyzer[] { new WarningOnNamePrefixDeclarationAnalyzer("C"), new WarningOnTypeDeclarationAnalyzer() }); 80new DiagnosticAnalyzer[] { new WarningOnNamePrefixDeclarationAnalyzer("C") }); 357new DiagnosticAnalyzer[] { new WarningOnNamePrefixDeclarationAnalyzer("E"), new WarningOnTypeDeclarationAnalyzer() }); 1364protected async Task VerifyCSharpAsync(string source, DiagnosticAnalyzer[] analyzers, params DiagnosticDescription[] diagnostics) 1374protected async Task VerifyBasicAsync(string source, string rootNamespace, DiagnosticAnalyzer[] analyzers, params DiagnosticDescription[] diagnostics) 1380protected async Task VerifyBasicAsync(string source, DiagnosticAnalyzer[] analyzers, params DiagnosticDescription[] diagnostics) 1390protected abstract Task VerifyAsync(string source, string language, DiagnosticAnalyzer[] analyzers, DiagnosticDescription[] diagnostics, string rootNamespace = null); 1398return VerifyAsync(source, language, new DiagnosticAnalyzer[] { new WarningOnTokenAnalyzer(spans) }, diagnostics);
Diagnostics\ThrowingDiagnosticAnalyzer.cs (3)
61public static void VerifyAnalyzerEngineIsSafeAgainstExceptions(Func<DiagnosticAnalyzer, IEnumerable<Diagnostic>> runAnalysis) 66public static async Task VerifyAnalyzerEngineIsSafeAgainstExceptionsAsync(Func<DiagnosticAnalyzer, IEnumerable<Diagnostic>> runAnalysis) 71public static async Task VerifyAnalyzerEngineIsSafeAgainstExceptionsAsync(Func<DiagnosticAnalyzer, Task<IEnumerable<Diagnostic>>> runAnalysis)
Mocks\TestAnalyzerReference.cs (2)
28public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzers(string language) => throw new NotImplementedException(); 29public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzersForAllLanguages() => throw new NotImplementedException();
Platform\Desktop\TestHelpers.cs (1)
76var analyzer = dir.CopyFile(typeof(DiagnosticAnalyzer).Assembly.Location);
Microsoft.CodeAnalysis.UnitTests (19)
AnalyzerAssemblyLoaderTests.cs (7)
1218ImmutableArray<DiagnosticAnalyzer> analyzers = state is true 1225foreach (var analyzer in analyzers) 1232void assertRan(DiagnosticAnalyzer a) 1240DiagnosticAnalyzer loadAnalyzer1() 1271return (DiagnosticAnalyzer)assembly.CreateInstance("Analyzer1")!; 1274DiagnosticAnalyzer loadAnalyzer2() 1305return (DiagnosticAnalyzer)assembly.CreateInstance("Analyzer2")!;
Analyzers\AnalyzerFileReferenceAppDomainTests.cs (2)
33var builder = ImmutableArray.CreateBuilder<DiagnosticAnalyzer>(); 88var analyzer = dir.CopyFile(typeof(DiagnosticAnalyzer).Assembly.Location);
Analyzers\AnalyzerFileReferenceTests.cs (6)
150var builder = ImmutableArray.CreateBuilder<DiagnosticAnalyzer>(); 169var builder = ImmutableArray.CreateBuilder<DiagnosticAnalyzer>(); 186var builder = ImmutableArray.CreateBuilder<DiagnosticAnalyzer>(); 246var builder = ImmutableArray.CreateBuilder<DiagnosticAnalyzer>(); 264var builder = ImmutableArray.CreateBuilder<DiagnosticAnalyzer>(); 286var builder = ImmutableArray.CreateBuilder<DiagnosticAnalyzer>();
Diagnostics\AnalysisContextInfoTests.cs (1)
47var diagnostics = compilation.GetAnalyzerDiagnostics(new DiagnosticAnalyzer[] { analyzer }, options);
Diagnostics\CompilationWithAnalyzersTests.cs (1)
59DiagnosticAnalyzer analyzer = new AnalyzerWithDisabledRules();
Diagnostics\DiagnosticLocalizationTests.cs (1)
304Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> onAnalyzerException = (ex, a, diag, ct) => exceptionDiagnostics.Add(diag);
Diagnostics\SuppressMessageAttributeCompilerTests.cs (1)
27protected override Task VerifyAsync(string source, string language, DiagnosticAnalyzer[] analyzers, DiagnosticDescription[] diagnostics, string rootNamespace = null)
Microsoft.CodeAnalysis.VisualBasic (2)
CommandLine\VisualBasicCompiler.vb (1)
261ByRef analyzers As ImmutableArray(Of DiagnosticAnalyzer),
Compilation\VisualBasicCompilation.vb (1)
2321Friend Overrides Function CreateAnalyzerDriver(analyzers As ImmutableArray(Of DiagnosticAnalyzer), analyzerManager As AnalyzerManager, severityFilter As SeverityFilter) As AnalyzerDriver
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.UnitTests (40)
src\Analyzers\VisualBasic\Tests\AddAnonymousTypeMemberName\AddAnonymousTypeMemberNameTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(Workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\AddExplicitCast\AddExplicitCastTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\AddObsoleteAttribute\AddObsoleteAttributeTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\AddParameter\AddParameterTests.vb (1)
17Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\AliasAmbiguousType\AliasAmbiguousTypeTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\ConvertToAsync\ConvertToAsyncTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\DocumentationComments\RemoveDocCommentNodeCodeFixProviderTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\GenerateConstructor\GenerateConstructorTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\GenerateEnumMember\GenerateEnumMemberTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\GenerateMethod\GenerateConversionTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\ImplementAbstractClass\ImplementAbstractClassTests.vb (1)
17Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\ImplementInterface\ImplementInterfaceTests.vb (1)
18Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\MakeFieldReadonly\MakeFieldReadonlyTests.vb (1)
17Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\MakeMethodAsynchronous\MakeMethodAsynchronousTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\MakeTypeAbstract\MakeTypeAbstractTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\NamingStyles\NamingStylesTests.vb (1)
19Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\OrderModifiers\OrderModifiersTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\PopulateSwitch\PopulateSwitchStatementTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\QualifyMemberAccess\QualifyMemberAccessTests.vb (1)
17Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\RemoveUnnecessaryCast\RemoveUnnecessaryCastTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\RemoveUnnecessaryImports\RemoveUnnecessaryImportsTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\RemoveUnnecessaryParentheses\RemoveUnnecessaryParenthesesTests.vb (1)
25Friend Overrides Function CreateDiagnosticProviderAndFixer(Workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\RemoveUnusedMembers\RemoveUnusedMembersTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\RemoveUnusedParametersAndValues\RemoveUnusedParametersTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\RemoveUnusedParametersAndValues\RemoveUnusedValuesTestsBase.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\SimplifyBooleanExpression\SimplifyConditionalTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\SimplifyInterpolation\SimplifyInterpolationTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\UnsealClass\UnsealClassTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\UseAutoProperty\UseAutoPropertyTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\UseCoalesceExpression\UseCoalesceExpressionForNullableTernaryConditionalCheckTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\UseCoalesceExpression\UseCoalesceExpressionForTernaryConditionalCheckTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\UseCollectionInitializer\UseCollectionInitializerTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\UseCompoundAssignment\UseCompoundAssignmentTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(Workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\UseConditionalExpression\UseConditionalExpressionForAssignmentTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(Workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\UseConditionalExpression\UseConditionalExpressionForReturnTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\UseInferredMemberName\UseInferredMemberNameTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\UseIsNullCheck\UseIsNullCheckForReferenceEqualsTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\UseNullPropagation\UseNullPropagationTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\UseSystemHashCode\UseSystemHashCodeTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
src\Analyzers\VisualBasic\Tests\ValidateFormatString\ValidateFormatStringTests.vb (1)
16workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (6)
CommandLineTests.vb (6)
7933Optional analyzers As DiagnosticAnalyzer() = Nothing, 9915Dim analyzerAndSuppressor As DiagnosticAnalyzer() = {analyzer, suppressor} 9971Dim analyzerAndSuppressor As DiagnosticAnalyzer() = {analyzer, suppressor} 10150Dim analyzer As DiagnosticAnalyzer = New WarningDiagnosticAnalyzer() ' Reports 2 warnings for each named type. 10428Dim analyzer As DiagnosticAnalyzer = New AdditionalFileAnalyzer(registerFromInitialize, diagnosticSpan) 10496ParamArray analyzers As DiagnosticAnalyzer())
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (48)
CorrectNextControlVariable\CorrectNextControlVariableTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
Diagnostics\Configuration\ConfigureCodeStyle\BooleanCodeStyleOptionConfigurationTests.vb (2)
28Friend Overrides Function CreateDiagnosticProviderAndFixer(ByVal workspace As Workspace) As Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider) 29Return New Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider)(New VisualBasicUseObjectInitializerDiagnosticAnalyzer(), New ConfigureCodeStyleOptionCodeFixProvider())
Diagnostics\Configuration\ConfigureSeverity\CodeStyleOptionBasedSeverityConfigurationTests.vb (2)
28Friend Overrides Function CreateDiagnosticProviderAndFixer(ByVal workspace As Workspace) As Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider) 29Return New Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider)(New VisualBasicUseObjectInitializerDiagnosticAnalyzer(), New ConfigureSeverityLevelCodeFixProvider())
Diagnostics\Configuration\ConfigureSeverity\DotNetDiagnosticSeverityBasedSeverityConfigurationTests.vb (2)
52Friend Overrides Function CreateDiagnosticProviderAndFixer(ByVal workspace As Workspace) As Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider) 53Return New Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider)(New CustomDiagnosticAnalyzer(), New ConfigureSeverityLevelCodeFixProvider())
Diagnostics\Configuration\ConfigureSeverity\MultipleCodeStyleOptionBasedConfigureSeverityTests.vb (2)
27Friend Overrides Function CreateDiagnosticProviderAndFixer(ByVal workspace As Workspace) As Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider) 28Return New Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider)(New VisualBasicUseInferredMemberNameDiagnosticAnalyzer(), New ConfigureSeverityLevelCodeFixProvider())
Diagnostics\Suppression\RemoveUnnecessaryPragmaSuppressionsTests.vb (2)
52Friend Overrides ReadOnly Property OtherAnalyzers As ImmutableArray(Of DiagnosticAnalyzer) 54Return ImmutableArray.Create(Of DiagnosticAnalyzer)(New VisualBasicCompilerDiagnosticAnalyzer())
Diagnostics\Suppression\SuppressionTests.vb (20)
47Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider) 48Return Tuple.Create(Of DiagnosticAnalyzer, IConfigurationFixProvider)(Nothing, New VisualBasicSuppressionCodeFixProvider()) 672Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider) 673Return New Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider)(New VisualBasicSimplifyTypeNamesDiagnosticAnalyzer(), New VisualBasicSuppressionCodeFixProvider()) 715Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider) 716Return New Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider)(New UserDiagnosticAnalyzer(), New VisualBasicSuppressionCodeFixProvider()) 790Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider) 791Return New Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider)(New UserDiagnosticAnalyzer(), New VisualBasicSuppressionCodeFixProvider()) 834Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider) 835Return New Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider)(New UserDiagnosticAnalyzer(), New VisualBasicSuppressionCodeFixProvider()) 900Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider) 901Return New Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider)(New UserDiagnosticAnalyzer(), New VisualBasicSuppressionCodeFixProvider()) 957Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider) 958Return Tuple.Create(Of DiagnosticAnalyzer, IConfigurationFixProvider)(Nothing, New VisualBasicSuppressionCodeFixProvider()) 978Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider) 979Return New Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider)(New VisualBasicSimplifyTypeNamesDiagnosticAnalyzer(), New VisualBasicSuppressionCodeFixProvider()) 1049Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider) 1050Return New Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider)(New UserDiagnosticAnalyzer(), New VisualBasicSuppressionCodeFixProvider()) 1765Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider) 1766Return New Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider)(New UserDiagnosticAnalyzer(), New VisualBasicSuppressionCodeFixProvider())
EmbeddedLanguages\ValidateJsonStringTests.vb (1)
22Friend Overrides Function CreateDiagnosticProviderAndFixer(Workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
EmbeddedLanguages\ValidateRegexStringTests.vb (1)
17Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
ExitContinue\ExitContinueCodeActionTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
FixIncorrectFunctionReturnType\FixIncorrectFunctionReturnTypeTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
FullyQualify\FullyQualifyTests.vb (2)
18Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider) 855Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
GenerateEndConstruct\GenerateEndConstructTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
GenerateEvent\GenerateEventTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
GenerateMethod\GenerateMethodTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
GenerateVariable\GenerateVariableTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
MoveToTopOfFile\MoveToTopOfFileTests.vb (1)
13Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
PreferFrameworkType\PreferFrameworkTypeTests.vb (1)
22Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
RemoveUnusedVariable\RemoveUnusedVariableTest.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
SimplifyThisOrMe\SimplifyThisOrMeTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
SimplifyTypeNames\SimplifyTypeNamesTests.vb (1)
22Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
SpellCheck\SpellCheckTests.vb (2)
18Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider) 500Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (7)
Diagnostics\DiagnosticAnalyzerTests.vb (5)
1163Dim analyzers = New DiagnosticAnalyzer() {New GeneratedCodeAnalyzer(generatedCodeAnalysisFlagsOpt, testIsGeneratedCodeInCallbacks)} 1168Dim analyzers = New DiagnosticAnalyzer() {New GeneratedCodeAnalyzer(generatedCodeAnalysisFlagsOpt, testIsGeneratedCodeInCallbacks:=True)} 1644Dim analyzers = New DiagnosticAnalyzer() {New SymbolStartAnalyzer(topLevelAction:=False, SymbolKind.NamedType)} 1659Dim analyzers As ImmutableArray(Of DiagnosticAnalyzer) = ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)
Diagnostics\GetDiagnosticsTests.vb (2)
524Dim compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer), AnalyzerOptions.Empty) 696Dim compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer), AnalyzerOptions.Empty)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (7)
MockVisualBasicCompiler.vb (7)
15Private ReadOnly _analyzers As ImmutableArray(Of DiagnosticAnalyzer) 23Public Sub New(baseDirectory As String, args As String(), Optional analyzer As DiagnosticAnalyzer = Nothing) 27Public Sub New(responseFile As String, baseDirectory As String, args As String(), analyzer As DiagnosticAnalyzer) 31Public Sub New(responseFile As String, buildPaths As BuildPaths, args As String(), analyzer As DiagnosticAnalyzer) 35Public Sub New(responseFile As String, workingDirectory As String, args As String(), Optional analyzers As DiagnosticAnalyzer() = Nothing, Optional generators As ISourceGenerator() = Nothing, Optional additionalReferences As MetadataReference() = Nothing) 39Public Sub New(responseFile As String, buildPaths As BuildPaths, args As String(), Optional analyzers As DiagnosticAnalyzer() = Nothing, Optional generators As ISourceGenerator() = Nothing, Optional additionalReferences As MetadataReference() = Nothing) 56ByRef analyzers As ImmutableArray(Of DiagnosticAnalyzer),
Microsoft.CodeAnalysis.Workspaces (98)
Diagnostics\AnalysisResultPair.cs (19)
16private ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>>? _lazyMergedSyntaxDiagnostics; 17private ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>>? _lazyMergedSemanticDiagnostics; 18private ImmutableDictionary<AdditionalText, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>>? _lazyMergedAdditionalFileDiagnostics; 19private ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>? _lazyMergedCompilationDiagnostics; 20private ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo>? _lazyMergedAnalyzerTelemetryInfo; 40public ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> MergedSyntaxDiagnostics 65public ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> MergedSemanticDiagnostics 90public ImmutableDictionary<AdditionalText, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> MergedAdditionalFileDiagnostics 115public ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> MergedCompilationDiagnostics 140public ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo> MergedAnalyzerTelemetryInfo 173private static ImmutableDictionary<TKey, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> MergeDiagnostics<TKey>( 174ImmutableDictionary<TKey, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> first, 175ImmutableDictionary<TKey, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> second) 193private static ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> MergeDiagnostics( 194ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> first, 195ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> second) 212private static ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo> MergeTelemetry( 213ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo> first, 214ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo> second)
Diagnostics\CompilationWithAnalyzersPair.cs (9)
53public ImmutableArray<DiagnosticAnalyzer> ProjectAnalyzers => _projectCompilationWithAnalyzers?.Analyzers ?? []; 55public ImmutableArray<DiagnosticAnalyzer> HostAnalyzers => _hostCompilationWithAnalyzers?.Analyzers ?? []; 57public Task<AnalyzerTelemetryInfo> GetAnalyzerTelemetryInfoAsync(DiagnosticAnalyzer analyzer, CancellationToken cancellationToken) 82public async Task<AnalysisResultPair?> GetAnalysisResultAsync(SyntaxTree tree, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> projectAnalyzers, ImmutableArray<DiagnosticAnalyzer> hostAnalyzers, CancellationToken cancellationToken) 94public async Task<AnalysisResultPair?> GetAnalysisResultAsync(AdditionalText file, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> projectAnalyzers, ImmutableArray<DiagnosticAnalyzer> hostAnalyzers, CancellationToken cancellationToken) 106public async Task<AnalysisResultPair?> GetAnalysisResultAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> projectAnalyzers, ImmutableArray<DiagnosticAnalyzer> hostAnalyzers, CancellationToken cancellationToken)
Diagnostics\DiagnosticAnalyzerExtensions.cs (5)
11public static DiagnosticAnalyzerCategory GetDiagnosticAnalyzerCategory(this DiagnosticAnalyzer analyzer) 26public static bool SupportAnalysisKind(this DiagnosticAnalyzer analyzer, AnalysisKind kind) 34public static bool SupportsSyntaxDiagnosticAnalysis(this DiagnosticAnalyzer analyzer) 40public static bool SupportsSemanticDiagnosticAnalysis(this DiagnosticAnalyzer analyzer) 46public static bool SupportsSpanBasedSemanticDiagnosticAnalysis(this DiagnosticAnalyzer analyzer)
Diagnostics\DiagnosticAnalyzerInfoCache.cs (5)
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;
Diagnostics\DocumentAnalysisScope.cs (6)
24ImmutableArray<DiagnosticAnalyzer> projectAnalyzers, 25ImmutableArray<DiagnosticAnalyzer> hostAnalyzers, 44public ImmutableArray<DiagnosticAnalyzer> ProjectAnalyzers { get; } 45public ImmutableArray<DiagnosticAnalyzer> HostAnalyzers { get; } 65public DocumentAnalysisScope WithAnalyzers(ImmutableArray<DiagnosticAnalyzer> projectAnalyzers, ImmutableArray<DiagnosticAnalyzer> hostAnalyzers)
Diagnostics\DocumentDiagnosticAnalyzer.cs (1)
37/// specify priority of the analyzer. Regular <see cref="DiagnosticAnalyzer"/> always comes before those 2 different types.
Diagnostics\Extensions.cs (8)
69public static string GetAnalyzerId(this DiagnosticAnalyzer analyzer) 101public static async Task<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResultBuilder>> ToResultBuilderMapAsync( 107ImmutableArray<DiagnosticAnalyzer> projectAnalyzers, 108ImmutableArray<DiagnosticAnalyzer> hostAnalyzers, 127var builder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, DiagnosticAnalysisResultBuilder>(); 148ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>? diagnosticsByAnalyzerMap; 238DiagnosticAnalyzer analyzer, 239ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> diagnosticsByAnalyzer,
Diagnostics\FileContentLoadAnalyzer.cs (1)
12/// A dummy singleton analyzer. Its only purpose is to represent file content load failures in maps that are keyed by <see cref="DiagnosticAnalyzer"/>.
Diagnostics\GeneratorDiagnosticsPlaceholderAnalyzer.cs (1)
10/// 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) 121/// Create <see cref="AnalyzerReference"/> identity and <see cref="DiagnosticAnalyzer"/>s map for given <paramref name="project"/> that 124public ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> CreateDiagnosticAnalyzersPerReference(Project project) 133/// Create <see cref="AnalyzerReference"/> identity and <see cref="DiagnosticAnalyzer"/>s map for given <paramref name="project"/> that 136public ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> CreateProjectDiagnosticAnalyzersPerReference(Project project) 139public ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> CreateProjectDiagnosticAnalyzersPerReference(IReadOnlyList<AnalyzerReference> projectAnalyzerReferences, string language) 143/// Return compiler <see cref="DiagnosticAnalyzer"/> for the given language. 145public DiagnosticAnalyzer? GetCompilerDiagnosticAnalyzer(string language) 148if (_compilerDiagnosticAnalyzerMap.TryGetValue(language, out var compilerAnalyzer)) 161ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> analyzersMap) 167foreach (var analyzer in analyzers) 180private ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> CreateHostDiagnosticAnalyzersAndBuildMap(string language) 184var builder = ImmutableDictionary.CreateBuilder<object, ImmutableArray<DiagnosticAnalyzer>>(); 202private void UpdateCompilerAnalyzerMapIfNeeded(string language, ImmutableArray<DiagnosticAnalyzer> analyzers) 209foreach (var analyzer in analyzers) 219private static ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> CreateDiagnosticAnalyzersPerReferenceMap( 222var builder = ImmutableDictionary.CreateBuilder<object, ImmutableArray<DiagnosticAnalyzer>>(); 279private static ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> MergeDiagnosticAnalyzerMap( 280ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> map1, 281ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> map2) 284var seen = new HashSet<DiagnosticAnalyzer>(map1.Values.SelectMany(v => v));
Diagnostics\ProjectDiagnosticAnalyzer.cs (1)
35/// specify priority of the analyzer. Regular <see cref="DiagnosticAnalyzer"/> always comes before those 2 different types.
Diagnostics\SkippedHostAnalyzersInfo.cs (8)
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) 83var fullySkippedHostAnalyzersBuilder = ImmutableHashSet.CreateBuilder<DiagnosticAnalyzer>(); 84var partiallySkippedHostAnalyzersBuilder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, ImmutableArray<string>>(); 120DiagnosticAnalyzer hostAnalyzer,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\DiagnosticAnalyzerCategory.cs (1)
19/// Note: an <see cref="DiagnosticAnalyzer"/> that uses this will not work properly if
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
26Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnostics,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticAnalyzerExtensions.cs (1)
15public static bool IsCompilerAnalyzer(this DiagnosticAnalyzer analyzer)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (8)
TestAnalyzerReferenceByLanguage.cs (6)
15private readonly IReadOnlyDictionary<string, ImmutableArray<DiagnosticAnalyzer>> _analyzersMap; 17public TestAnalyzerReferenceByLanguage(IReadOnlyDictionary<string, ImmutableArray<DiagnosticAnalyzer>> analyzersMap, string? fullPath = null) 34public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzersForAllLanguages() 37public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzers(string language) 44return ImmutableArray<DiagnosticAnalyzer>.Empty; 47public TestAnalyzerReferenceByLanguage WithAdditionalAnalyzers(string language, IEnumerable<DiagnosticAnalyzer> analyzers)
TestGeneratorReference.cs (2)
47public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzers(string language) => []; 48public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzersForAllLanguages() => [];
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
BatchFixAllProviderTests.cs (1)
167protected override IEnumerable<DiagnosticAnalyzer> GetDiagnosticAnalyzers()
SolutionTests\SolutionTests.cs (2)
2986DiagnosticAnalyzer analyzer = new MockDiagnosticAnalyzer(); 3013DiagnosticAnalyzer secondAnalyzer = new MockDiagnosticAnalyzer();
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.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()
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (6)
EditorConfigSettings\DataProvider\DataProviderTests.MockAnalyzerReference.cs (6)
19public readonly ImmutableArray<DiagnosticAnalyzer> Analyzers; 22private static readonly ImmutableArray<DiagnosticAnalyzer> s_defaultAnalyzers = ImmutableArray.Create<DiagnosticAnalyzer>(new MockDiagnosticAnalyzer()); 24public MockAnalyzerReference(CodeFixProvider? fixer, ImmutableArray<DiagnosticAnalyzer> analyzers) 46public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzers(string language) 49public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzersForAllLanguages()
Microsoft.VisualStudio.LanguageServices.UnitTests (9)
Diagnostics\ExternalDiagnosticUpdateSourceTests.vb (7)
49ImmutableDictionary(Of String, ImmutableArray(Of DiagnosticAnalyzer)).Empty.Add(LanguageNames.CSharp, ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer))) 95ImmutableDictionary(Of String, ImmutableArray(Of DiagnosticAnalyzer)).Empty.Add(LanguageNames.CSharp, ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer))) 228Dim analyzerReference = New AnalyzerImageReference(New DiagnosticAnalyzer() {compiler, analyzer}.ToImmutableArray()) 327Public Function GetDiagnosticsForIdsAsync(solution As Solution, projectId As ProjectId, documentId As DocumentId, diagnosticIds As ImmutableHashSet(Of String), shouldIncludeAnalyzer As Func(Of DiagnosticAnalyzer, Boolean), getDocuments As Func(Of Project, DocumentId, IReadOnlyList(Of DocumentId)), includeSuppressedDiagnostics As Boolean, includeLocalDocumentDiagnostics As Boolean, includeNonLocalDocumentDiagnostics As Boolean, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of DiagnosticData)) Implements IDiagnosticAnalyzerService.GetDiagnosticsForIdsAsync 331Public Function GetProjectDiagnosticsForIdsAsync(solution As Solution, projectId As ProjectId, diagnosticIds As ImmutableHashSet(Of String), shouldIncludeAnalyzer As Func(Of DiagnosticAnalyzer, Boolean), includeSuppressedDiagnostics As Boolean, includeNonLocalDocumentDiagnostics As Boolean, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of DiagnosticData)) Implements IDiagnosticAnalyzerService.GetProjectDiagnosticsForIdsAsync
SolutionExplorer\CpsDiagnosticItemSourceTests.vb (2)
32Dim analyzers = New Dictionary(Of String, ImmutableArray(Of DiagnosticAnalyzer)) 36analyzers.Add(LanguageNames.VisualBasic, ImmutableArray.Create(Of DiagnosticAnalyzer)(New Microsoft.CodeAnalysis.VisualBasic.UseAutoProperty.VisualBasicUseAutoPropertyAnalyzer()))
Mvc.Analyzers.Test (4)
AttributesShouldNotBeAppliedToPageModelAnalyzerTest.cs (1)
393protected override IEnumerable<DiagnosticAnalyzer> GetDiagnosticAnalyzers() => new[] { new AttributesShouldNotBeAppliedToPageModelAnalyzer() };
AvoidHtmlPartialAnalyzerTest.cs (1)
432protected override IEnumerable<DiagnosticAnalyzer> GetDiagnosticAnalyzers() => new[] { new AvoidHtmlPartialAnalyzer() };
TagHelpersInCodeBlocksAnalyzerTest.cs (1)
918protected override IEnumerable<DiagnosticAnalyzer> GetDiagnosticAnalyzers() => new[] { new TagHelpersInCodeBlocksAnalyzer() };
TopLevelParameterNameAnalyzerTest.cs (1)
606protected override IEnumerable<DiagnosticAnalyzer> GetDiagnosticAnalyzers() => new[] { new TopLevelParameterNameAnalyzer() };
Mvc.Api.Analyzers.Test (2)
Infrastructure\MvcDiagnosticAnalyzerRunner.cs (2)
13public MvcDiagnosticAnalyzerRunner(DiagnosticAnalyzer analyzer) 18public DiagnosticAnalyzer Analyzer { get; }