259 types derived from DiagnosticAnalyzer
Microsoft.CodeAnalysis (3)
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.CompilationAnalyzer.cs (1)
11internal abstract partial class CompilerDiagnosticAnalyzer : DiagnosticAnalyzer
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.cs (1)
12internal abstract partial class CompilerDiagnosticAnalyzer : DiagnosticAnalyzer
DiagnosticAnalyzer\DiagnosticSuppressor.cs (1)
12public abstract class DiagnosticSuppressor : DiagnosticAnalyzer
Microsoft.CodeAnalysis.CodeStyle (3)
AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (1)
13internal abstract partial class AbstractBuiltInCodeStyleDiagnosticAnalyzer : DiagnosticAnalyzer, IBuiltInAnalyzer
AbstractCodeQualityDiagnosticAnalyzer.cs (1)
13internal abstract class AbstractCodeQualityDiagnosticAnalyzer : DiagnosticAnalyzer, IBuiltInAnalyzer
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)
ConvertToRecordCodeFixTests.cs (1)
164private class TestAnalyzer : DiagnosticAnalyzer
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (2)
CommandLineTests.cs (2)
13988private sealed class FieldAnalyzer : DiagnosticAnalyzer 14588internal abstract class CompilationStartedAnalyzer : DiagnosticAnalyzer
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (24)
ConvertToRecord\ConvertToRecordCodeRefactoringTests.cs (1)
4604private class TestAnalyzer : DiagnosticAnalyzer
ConvertToRecordCodeFixTests.cs (1)
164private class TestAnalyzer : DiagnosticAnalyzer
Diagnostics\Configuration\ConfigureSeverity\AllAnalyzersSeverityConfigurationTests.cs (1)
24private sealed class CustomDiagnosticAnalyzer : DiagnosticAnalyzer
Diagnostics\Configuration\ConfigureSeverity\CategoryBasedSeverityConfigurationTests.cs (1)
24private sealed class CustomDiagnosticAnalyzer : DiagnosticAnalyzer
Diagnostics\Configuration\ConfigureSeverity\DotNetDiagnosticSeverityBasedSeverityConfigurationTests.cs (1)
24private sealed class CustomDiagnosticAnalyzer : DiagnosticAnalyzer
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (4)
213private class CompilationAnalyzerWithSyntaxTreeAnalyzer : DiagnosticAnalyzer 287private class CodeBlockAnalyzerFactory : DiagnosticAnalyzer 345private class InvalidSpanAnalyzer : DiagnosticAnalyzer 853private abstract class AbstractNuGetOrVsixAnalyzer : DiagnosticAnalyzer
Diagnostics\FixAllProvider\BatchFixerTests.cs (1)
32private class QualifyWithThisAnalyzer : DiagnosticAnalyzer
Diagnostics\MockDiagnosticAnalyzerTests.cs (1)
21private class MockDiagnosticAnalyzer : DiagnosticAnalyzer
Diagnostics\Suppression\RemoveSuppressionTests.cs (1)
26protected class UserDiagnosticAnalyzer : DiagnosticAnalyzer
Diagnostics\Suppression\RemoveUnnecessaryPragmaSuppressionsTests.cs (3)
56protected sealed class UserDiagnosticAnalyzer : DiagnosticAnalyzer 113protected sealed class CompilationEndDiagnosticAnalyzer : DiagnosticAnalyzer 1296private sealed class NonLocalDiagnosticsAnalyzer : DiagnosticAnalyzer
Diagnostics\Suppression\SuppressionTest_FixMultipleTests.cs (1)
36private class UserDiagnosticAnalyzer : DiagnosticAnalyzer
Diagnostics\Suppression\SuppressionTests.cs (7)
693private class UserDiagnosticAnalyzer : DiagnosticAnalyzer 803private class UserDiagnosticAnalyzer : DiagnosticAnalyzer 866private class UserDiagnosticAnalyzer : DiagnosticAnalyzer 916private class UserDiagnosticAnalyzer : DiagnosticAnalyzer 1057private class UserDiagnosticAnalyzer : DiagnosticAnalyzer 2057private class UserDiagnosticAnalyzer : DiagnosticAnalyzer 2452private class UserDiagnosticAnalyzer : DiagnosticAnalyzer
Squiggles\ErrorSquiggleProducerTests.cs (1)
409private sealed class ReportOnClassWithLink : DiagnosticAnalyzer
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (14)
Diagnostics\DiagnosticAnalyzerTests.cs (13)
34private class ComplainAboutX : DiagnosticAnalyzer 231private class SyntaxAndSymbolAnalyzer : DiagnosticAnalyzer 468internal class FullyDisabledAnalyzer : DiagnosticAnalyzer 484internal class PartiallyDisabledAnalyzer : DiagnosticAnalyzer 499internal class ImplicitlyDeclaredSymbolAnalyzer : DiagnosticAnalyzer 648public class FieldDeclarationAnalyzer : DiagnosticAnalyzer 744public class CodeBlockOrSyntaxNodeAnalyzer : DiagnosticAnalyzer 826public class MethodSymbolAnalyzer : DiagnosticAnalyzer 869public class AnalyzerReportingUnsupportedDiagnostic : DiagnosticAnalyzer 1632internal class OwningSymbolTestAnalyzer : DiagnosticAnalyzer 2276public class GeneratedCodeSyntaxAndOperationAnalyzer : DiagnosticAnalyzer 3735public class ActionsRegisteredAtDifferentScopesAnalyzer : DiagnosticAnalyzer 3976public class RecordDeclarationAnalyzer : DiagnosticAnalyzer
Diagnostics\GetDiagnosticsTests.cs (1)
868private sealed class BlockStartAnalyzer : DiagnosticAnalyzer
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (43)
Semantics\ColorColorTests.cs (1)
1765class ColorColorSymbolInfoInArrowExpressionClauseSyntaxAnalyzer : DiagnosticAnalyzer
Semantics\OutVarTests.cs (1)
18794private class ConstructorInitializers_08_SyntaxAnalyzer : DiagnosticAnalyzer
Semantics\PrimaryConstructorTests.cs (13)
3128private class AnalyzerActions_01_Class_Analyzer : DiagnosticAnalyzer 3480private class AnalyzerActions_02_Class_Analyzer : DiagnosticAnalyzer 3562private class AnalyzerActions_03_Class_Analyzer : DiagnosticAnalyzer 3704private class AnalyzerActions_04_Class_Analyzer : DiagnosticAnalyzer 3907private class AnalyzerActions_05_Class_Analyzer : DiagnosticAnalyzer 4221private class AnalyzerActions_07_Class_Analyzer : DiagnosticAnalyzer 4543private class AnalyzerActions_09_Class_Analyzer : DiagnosticAnalyzer 4651private class AnalyzerActions_01_Struct_Analyzer : DiagnosticAnalyzer 4884private class AnalyzerActions_02_Struct_Analyzer : DiagnosticAnalyzer 4967private class AnalyzerActions_03_Struct_Analyzer : DiagnosticAnalyzer 5086private class AnalyzerActions_04_Struct_Analyzer : DiagnosticAnalyzer 5186private class AnalyzerActions_05_Struct_Analyzer : DiagnosticAnalyzer 5243private class AnalyzerActions_07_Struct_Analyzer : DiagnosticAnalyzer
Semantics\RecordStructTests.cs (7)
5901private class AnalyzerActions_01_Analyzer : DiagnosticAnalyzer 6135private class AnalyzerActions_02_Analyzer : DiagnosticAnalyzer 6226private class AnalyzerActions_03_Analyzer : DiagnosticAnalyzer 6363private class AnalyzerActions_04_Analyzer : DiagnosticAnalyzer 6463private class AnalyzerActions_05_Analyzer : DiagnosticAnalyzer 6520private class AnalyzerActions_07_Analyzer : DiagnosticAnalyzer 6767private class AnalyzerActions_09_Analyzer : DiagnosticAnalyzer
Semantics\RecordTests.cs (7)
26166private class AnalyzerActions_01_Analyzer : DiagnosticAnalyzer 26515private class AnalyzerActions_02_Analyzer : DiagnosticAnalyzer 26605private class AnalyzerActions_03_Analyzer : DiagnosticAnalyzer 26765private class AnalyzerActions_04_Analyzer : DiagnosticAnalyzer 26968private class AnalyzerActions_05_Analyzer : DiagnosticAnalyzer 27282private class AnalyzerActions_07_Analyzer : DiagnosticAnalyzer 27606private class AnalyzerActions_09_Analyzer : DiagnosticAnalyzer
Semantics\TopLevelStatementsTests.cs (13)
6404private class AnalyzerActions_01_Analyzer : DiagnosticAnalyzer 6505private class AnalyzerActions_02_Analyzer : DiagnosticAnalyzer 6574private class AnalyzerActions_03_Analyzer : DiagnosticAnalyzer 6687private class AnalyzerActions_04_Analyzer : DiagnosticAnalyzer 6770private class AnalyzerActions_05_Analyzer : DiagnosticAnalyzer 6828private class AnalyzerActions_06_Analyzer : DiagnosticAnalyzer 6886private class AnalyzerActions_07_Analyzer : DiagnosticAnalyzer 6954private class AnalyzerActions_08_Analyzer : DiagnosticAnalyzer 7033private class AnalyzerActions_09_Analyzer : DiagnosticAnalyzer 7148private class AnalyzerActions_10_Analyzer : DiagnosticAnalyzer 7242private class AnalyzerActions_11_Analyzer : DiagnosticAnalyzer 7315private class AnalyzerActions_12_Analyzer : DiagnosticAnalyzer 7382private 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)
1151private class NullabilityPrinter : DiagnosticAnalyzer 1775private class CSharp73ProvidesNullableSemanticInfo_Analyzer : DiagnosticAnalyzer 4831private class AutoPropInitializer_02_Analyzer : DiagnosticAnalyzer
Microsoft.CodeAnalysis.EditorFeatures.DiagnosticsTests.Utilities (1)
Diagnostics\AbstractSuppressionAllCodeTests.cs (1)
142internal class Analyzer : DiagnosticAnalyzer, IBuiltInAnalyzer
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (8)
CodeFixes\CodeFixServiceTests.cs (2)
476public class MockDiagnosticAnalyzer : DiagnosticAnalyzer 840internal sealed class AdditionalFileAnalyzer : DiagnosticAnalyzer
Diagnostics\DiagnosticAnalyzerServiceTests.cs (4)
1243private class Analyzer : DiagnosticAnalyzer 1259private class DisabledByDefaultAnalyzer : DiagnosticAnalyzer 1275private class OpenFileOnlyAnalyzer : DiagnosticAnalyzer, IBuiltInAnalyzer 1379private class NamedTypeAnalyzer : DiagnosticAnalyzer
Diagnostics\DiagnosticsClassificationTaggerProviderTests.cs (1)
74private class Analyzer : DiagnosticAnalyzer
Diagnostics\DiagnosticsSquiggleTaggerProviderTests.cs (1)
213private class Analyzer : DiagnosticAnalyzer
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (18)
CodeFixes\CodeFixServiceTests.vb (1)
202Inherits DiagnosticAnalyzer
Diagnostics\AdditionalFileDiagnosticsTests.vb (1)
68Inherits DiagnosticAnalyzer
Diagnostics\DiagnosticServiceTests.vb (16)
1276Inherits DiagnosticAnalyzer 1397Inherits DiagnosticAnalyzer 1474Inherits DiagnosticAnalyzer 1566Inherits DiagnosticAnalyzer 1586Inherits DiagnosticAnalyzer 1619Inherits DiagnosticAnalyzer 1643Inherits DiagnosticAnalyzer 1662Inherits DiagnosticAnalyzer 1686Inherits DiagnosticAnalyzer 1714Inherits DiagnosticAnalyzer 1740Inherits DiagnosticAnalyzer 1766Inherits DiagnosticAnalyzer 1789Inherits DiagnosticAnalyzer 1828Inherits DiagnosticAnalyzer 1902Inherits DiagnosticAnalyzer 2485Inherits DiagnosticAnalyzer
Microsoft.CodeAnalysis.Features (4)
AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (1)
13internal abstract partial class AbstractBuiltInCodeStyleDiagnosticAnalyzer : DiagnosticAnalyzer, IBuiltInAnalyzer
AbstractCodeQualityDiagnosticAnalyzer.cs (1)
13internal abstract class AbstractCodeQualityDiagnosticAnalyzer : DiagnosticAnalyzer, IBuiltInAnalyzer
AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
16: DiagnosticAnalyzer
Diagnostics\Analyzers\UnboundIdentifiersDiagnosticAnalyzerBase.cs (1)
25internal abstract class UnboundIdentifiersDiagnosticAnalyzerBase<TLanguageKindEnum, TSimpleNameSyntax, TQualifiedNameSyntax, TIncompleteMemberSyntax> : DiagnosticAnalyzer, IBuiltInAnalyzer
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (2)
Diagnostics\AdditionalFileDiagnosticsTests.cs (1)
136private class MockAdditionalFileDiagnosticAnalyzer : DiagnosticAnalyzer
Diagnostics\WorkspaceProjectDiagnosticsTests.cs (1)
77private 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 (90)
Diagnostics\BoxingOperationAnalyzer.cs (1)
15public class BoxingOperationAnalyzer : DiagnosticAnalyzer
Diagnostics\CommonDiagnosticAnalyzers.cs (41)
28public class AnalyzerForErrorLogTest : DiagnosticAnalyzer 445public class NotConfigurableDiagnosticAnalyzer : DiagnosticAnalyzer 487public class CodeBlockActionAnalyzer : DiagnosticAnalyzer 552public abstract class CodeBlockObjectCreationAnalyzer<TLanguageKindEnum> : DiagnosticAnalyzer 580public class CSharpGenericNameAnalyzer : DiagnosticAnalyzer 618public abstract class AbstractNamespaceDeclarationAnalyzer<TLanguageKindEnum> : DiagnosticAnalyzer 647public sealed class AnalyzerWithNoActions : DiagnosticAnalyzer 662public sealed class AnalyzerWithDisabledRules : DiagnosticAnalyzer 686public sealed class EnsureNoMergedNamespaceSymbolAnalyzer : DiagnosticAnalyzer 718public sealed class AnalyzerWithNoSupportedDiagnostics : DiagnosticAnalyzer 725public sealed class AnalyzerWithInvalidDiagnosticId : DiagnosticAnalyzer 744public sealed class AnalyzerWithNullDescriptor : DiagnosticAnalyzer 754public sealed class AnalyzerWithCSharpCompilerDiagnosticId : DiagnosticAnalyzer 775public sealed class AnalyzerWithBasicCompilerDiagnosticId : DiagnosticAnalyzer 796public sealed class AnalyzerWithInvalidDiagnosticSpan : DiagnosticAnalyzer 830public sealed class AnalyzerWithInvalidDiagnosticLocation : DiagnosticAnalyzer 895public sealed class AnalyzerThatThrowsInSupportedDiagnostics : DiagnosticAnalyzer 902public sealed class AnalyzerThatThrowsInGetMessage : DiagnosticAnalyzer 941public sealed class AnalyzerReportingMisformattedDiagnostic : DiagnosticAnalyzer 963public class CompilationAnalyzerWithSeverity : DiagnosticAnalyzer 1006public class ConcurrentAnalyzer : DiagnosticAnalyzer 1078public class NonConcurrentAnalyzer : DiagnosticAnalyzer 1116public sealed class OperationAnalyzer : DiagnosticAnalyzer 1265public sealed class OperationBlockAnalyzer : DiagnosticAnalyzer 1290public sealed class FieldReferenceOperationAnalyzer : DiagnosticAnalyzer 1341public sealed class MethodOrConstructorBodyOperationAnalyzer : DiagnosticAnalyzer 1362public abstract class AbstractGeneratedCodeAnalyzer<TSyntaxKind> : DiagnosticAnalyzer 1571public class GeneratedCodeAnalyzer2 : DiagnosticAnalyzer 1605public class SharedStateAnalyzer : DiagnosticAnalyzer 1735public class AnalyzerForParameters : DiagnosticAnalyzer 1759public class SymbolStartAnalyzer : DiagnosticAnalyzer 2237public sealed class NamedTypeAnalyzer : DiagnosticAnalyzer 2321public sealed class AnalyzerWithNoLocationDiagnostics : DiagnosticAnalyzer 2345public sealed class NamedTypeAnalyzerWithConfigurableEnabledByDefault : DiagnosticAnalyzer 2379public sealed class RegisterOperationBlockAndOperationActionAnalyzer : DiagnosticAnalyzer 2404public sealed class FieldAnalyzer : DiagnosticAnalyzer 2446public class AdditionalFileAnalyzer : DiagnosticAnalyzer 2495public sealed class RegisterSyntaxTreeCancellationAnalyzer : DiagnosticAnalyzer 2532public sealed class VariableDeclarationAnalyzer : DiagnosticAnalyzer 2578internal sealed class CancellationTestAnalyzer : DiagnosticAnalyzer 2647public sealed class AllActionsAnalyzer : 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)
358private class MyAnalyzer : DiagnosticAnalyzer
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (1)
CommandLineTests.vb (1)
10594Inherits DiagnosticAnalyzer
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests (7)
Diagnostics\Configuration\ConfigureSeverity\DotNetDiagnosticSeverityBasedSeverityConfigurationTests.vb (1)
17Inherits DiagnosticAnalyzer
Diagnostics\Suppression\SuppressionTests.vb (6)
695Inherits DiagnosticAnalyzer 768Inherits DiagnosticAnalyzer 812Inherits DiagnosticAnalyzer 876Inherits DiagnosticAnalyzer 994Inherits DiagnosticAnalyzer 1710Inherits DiagnosticAnalyzer
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (11)
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 (1)
585Inherits 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)
2314private class MockDiagnosticAnalyzer : DiagnosticAnalyzer
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
EditorConfigSettings\DataProvider\DataProviderTests.MockAnalyzerReference.cs (1)
71public class MockDiagnosticAnalyzer : DiagnosticAnalyzer
Microsoft.VisualStudio.LanguageServices.UnitTests (2)
Diagnostics\ExternalDiagnosticUpdateSourceTests.vb (2)
576Inherits DiagnosticAnalyzer 602Inherits DiagnosticAnalyzer
Roslyn.VisualStudio.Next.UnitTests (2)
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (2)
282private class MyAnalyzer : DiagnosticAnalyzer 302private class DuplicateAnalyzer : DiagnosticAnalyzer
1667 references to DiagnosticAnalyzer
AnalyzerRunner (14)
DiagnosticAnalyzerRunner.cs (14)
26private readonly ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> _analyzers; 177private static async Task<DocumentAnalyzerPerformance> TestDocumentPerformanceAsync(ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> analyzers, Project project, DocumentId documentId, Options analyzerOptionsInternal, CancellationToken cancellationToken) 181languageAnalyzers = ImmutableArray<DiagnosticAnalyzer>.Empty; 233private static ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> FilterAnalyzers(ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> analyzers, Options options) 240private static IEnumerable<DiagnosticAnalyzer> FilterAnalyzers(IEnumerable<DiagnosticAnalyzer> analyzers, Options options) 260foreach (var analyzer in analyzers) 286private static ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> GetDiagnosticAnalyzers(string path) 305private static ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> GetDiagnosticAnalyzersFromFile(string path) 310return ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>>.Empty 317ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> analyzers, 381ImmutableArray<DiagnosticAnalyzer> analyzers, 417var telemetryInfoDictionary = new Dictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo>();
CodeStyleConfigFileGenerator (1)
Program.cs (1)
59foreach (var analyzer in analyzers)
GenerateRulesMissingDocumentation (1)
Program.cs (1)
139foreach (var analyzer in analyzers)
Microsoft.CodeAnalysis (522)
CommandLine\CommandLineArguments.cs (4)
185/// Skip execution of <see cref="DiagnosticAnalyzer"/>s. 471out ImmutableArray<DiagnosticAnalyzer> analyzers, 474var analyzerBuilder = ImmutableArray.CreateBuilder<DiagnosticAnalyzer>(); 556bool shouldIncludeAnalyzer(DiagnosticAnalyzer analyzer) => !skipAnalyzers || analyzer is DiagnosticSuppressor;
CommandLine\CommonCompiler.cs (3)
119out ImmutableArray<DiagnosticAnalyzer> analyzers, 973ImmutableArray<DiagnosticAnalyzer> analyzers, 1605ImmutableArray<DiagnosticAnalyzer> analyzers,
Compilation\Compilation.cs (3)
119internal abstract AnalyzerDriver CreateAnalyzerDriver(ImmutableArray<DiagnosticAnalyzer> analyzers, AnalyzerManager analyzerManager, SeverityFilter severityFilter); 194ImmutableArray<DiagnosticAnalyzer> analyzers = default, 206ImmutableArray<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)
42/// 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) 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>(); 378private void UpdateNonLocalDiagnostics_NoLock(DiagnosticAnalyzer analyzer, ImmutableArray<Diagnostic> diagnostics, bool overwrite) 385_nonLocalDiagnosticsOpt = _nonLocalDiagnosticsOpt ?? new Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>(); 443Dictionary<TKey, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? lazyLocalDiagnostics, 458Dictionary<SyntaxTree, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? localDiagnostics, 464Dictionary<AdditionalText, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? localDiagnostics, 470Dictionary<TKey, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? localDiagnostics, 472ImmutableArray<DiagnosticAnalyzer> analyzers, 476Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>? diagnosticsForTree; 484Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder> diagnostics, 485ImmutableArray<DiagnosticAnalyzer> analyzers, 490foreach (var analyzer in analyzers) 500internal AnalysisResult ToAnalysisResult(ImmutableArray<DiagnosticAnalyzer> analyzers, AnalysisScope analysisScope, CancellationToken cancellationToken) 504ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSyntaxDiagnostics; 505ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSemanticDiagnostics; 506ImmutableDictionary<AdditionalText, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localAdditionalFileDiagnostics; 507ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> nonLocalDiagnostics; 524private static ImmutableDictionary<TKey, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> GetImmutable<TKey>( 525ImmutableHashSet<DiagnosticAnalyzer> analyzers, 527Dictionary<TKey, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? localDiagnosticsOpt) 532return ImmutableDictionary<TKey, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>>.Empty; 535var builder = ImmutableDictionary.CreateBuilder<TKey, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>>(); 536var perTreeBuilder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>(); 560private static ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> GetImmutable( 561ImmutableHashSet<DiagnosticAnalyzer> analyzers, 563Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>? nonLocalDiagnosticsOpt) 567return ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>.Empty; 570var builder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>(); 586private ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo> GetTelemetryInfo( 587ImmutableArray<DiagnosticAnalyzer> analyzers) 589var builder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, AnalyzerTelemetryInfo>(); 593foreach (var analyzer in analyzers)
DiagnosticAnalyzer\AnalysisScope.cs (9)
23private readonly Lazy<ImmutableHashSet<DiagnosticAnalyzer>> _lazyAnalyzersSet; 28public ImmutableArray<DiagnosticAnalyzer> Analyzers { get; } 70public AnalysisScope(Compilation compilation, AnalyzerOptions? analyzerOptions, ImmutableArray<DiagnosticAnalyzer> analyzers, bool hasAllAnalyzers, bool concurrentAnalysis, bool categorizeDiagnostics) 76public AnalysisScope(ImmutableArray<DiagnosticAnalyzer> analyzers, SourceOrAdditionalFile filterFile, TextSpan? filterSpan, bool isSyntacticSingleFileAnalysis, bool concurrentAnalysis, bool categorizeDiagnostics) 83private AnalysisScope(IEnumerable<SyntaxTree> trees, IEnumerable<AdditionalText> additionalFiles, ImmutableArray<DiagnosticAnalyzer> analyzers, bool isPartialAnalysis, SourceOrAdditionalFile? filterFile, TextSpan? filterSpanOpt, bool isSyntacticSingleFileAnalysis, bool concurrentAnalysis, bool categorizeDiagnostics) 114_lazyAnalyzersSet = new Lazy<ImmutableHashSet<DiagnosticAnalyzer>>(CreateAnalyzersSet); 117private ImmutableHashSet<DiagnosticAnalyzer> CreateAnalyzersSet() => Analyzers.ToImmutableHashSet(); 119public bool Contains(DiagnosticAnalyzer analyzer) 130public AnalysisScope WithAnalyzers(ImmutableArray<DiagnosticAnalyzer> analyzers, bool hasAllAnalyzers)
DiagnosticAnalyzer\AnalyzerDriver.cs (117)
35private static readonly Func<DiagnosticAnalyzer, bool> s_IsCompilerAnalyzerFunc = IsCompilerAnalyzer; 62protected ImmutableArray<DiagnosticAnalyzer> Analyzers { get; } 92private ImmutableHashSet<DiagnosticAnalyzer>? _lazyUnsuppressedAnalyzers; 97protected ImmutableHashSet<DiagnosticAnalyzer> UnsuppressedAnalyzers 106private ConcurrentDictionary<(INamespaceOrTypeSymbol, DiagnosticAnalyzer), IGroupedAnalyzerActions>? _lazyPerSymbolAnalyzerActionsCache; 114private ConcurrentDictionary<(INamespaceOrTypeSymbol, DiagnosticAnalyzer), IGroupedAnalyzerActions> PerSymbolAnalyzerActionsCache 123private ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<ImmutableArray<SymbolAnalyzerAction>>)> _lazySymbolActionsByKind; 124private ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<SemanticModelAnalyzerAction>)> _lazySemanticModelActions; 125private ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<SyntaxTreeAnalyzerAction>)> _lazySyntaxTreeActions; 126private ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<AdditionalFileAnalyzerAction>)> _lazyAdditionalFileActions; 129private ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<CompilationAnalyzerAction>)> _lazyCompilationActions; 130private ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<CompilationAnalyzerAction>)> _lazyCompilationEndActions; 132private ImmutableHashSet<DiagnosticAnalyzer>? _lazyCompilationEndAnalyzers; 133private ImmutableHashSet<DiagnosticAnalyzer> CompilationEndAnalyzers 154private ImmutableSegmentedDictionary<DiagnosticAnalyzer, SemaphoreSlim> _lazyAnalyzerGateMap; 155private ImmutableSegmentedDictionary<DiagnosticAnalyzer, SemaphoreSlim> AnalyzerGateMap 164private ImmutableSegmentedDictionary<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags> _lazyGeneratedCodeAnalysisFlagsMap; 169private ImmutableSegmentedDictionary<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags> GeneratedCodeAnalysisFlagsMap 184private ImmutableHashSet<DiagnosticAnalyzer>? _lazyNonConfigurableAnalyzers; 189private ImmutableHashSet<DiagnosticAnalyzer> NonConfigurableAnalyzers 198private ImmutableHashSet<DiagnosticAnalyzer>? _lazySymbolStartAnalyzers; 203private ImmutableHashSet<DiagnosticAnalyzer> SymbolStartAnalyzers 259private ConcurrentDictionary<SyntaxTree, ImmutableHashSet<DiagnosticAnalyzer>>? _lazySuppressedAnalyzersForTreeMap; 264private ConcurrentDictionary<SyntaxTree, ImmutableHashSet<DiagnosticAnalyzer>> SuppressedAnalyzersForTreeMap 369protected AnalyzerDriver(ImmutableArray<DiagnosticAnalyzer> analyzers, AnalyzerManager analyzerManager, SeverityFilter severityFilter, Func<SyntaxTrivia, bool> isComment) 381_lazyAnalyzerGateMap = ImmutableSegmentedDictionary<DiagnosticAnalyzer, SemaphoreSlim>.Empty; 414_lazySuppressedAnalyzersForTreeMap = new ConcurrentDictionary<SyntaxTree, ImmutableHashSet<DiagnosticAnalyzer>>(); 427_lazyPerSymbolAnalyzerActionsCache = new ConcurrentDictionary<(INamespaceOrTypeSymbol, DiagnosticAnalyzer), IGroupedAnalyzerActions>(); 468Action<Diagnostic, DiagnosticAnalyzer, bool, CancellationToken>? addCategorizedLocalDiagnostic = null; 469Action<Diagnostic, DiagnosticAnalyzer, CancellationToken>? addCategorizedNonLocalDiagnostic = null; 481Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> newOnAnalyzerException = (ex, analyzer, diagnostic, cancellationToken) => 510private SemaphoreSlim? GetAnalyzerGate(DiagnosticAnalyzer analyzer) 522private ImmutableHashSet<DiagnosticAnalyzer> ComputeNonConfigurableAnalyzers(ImmutableHashSet<DiagnosticAnalyzer> unsuppressedAnalyzers) 524var builder = ImmutableHashSet.CreateBuilder<DiagnosticAnalyzer>(); 525foreach (var analyzer in unsuppressedAnalyzers) 541private ImmutableHashSet<DiagnosticAnalyzer> ComputeSymbolStartAnalyzers(ImmutableHashSet<DiagnosticAnalyzer> unsuppressedAnalyzers) 543var builder = ImmutableHashSet.CreateBuilder<DiagnosticAnalyzer>(); 556ImmutableHashSet<DiagnosticAnalyzer> analyzers, 557ImmutableSegmentedDictionary<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags> generatedCodeAnalysisFlagsMap, 560foreach (var analyzer in analyzers) 574private static bool ComputeShouldTreatAllCodeAsNonGeneratedCode(ImmutableHashSet<DiagnosticAnalyzer> analyzers, ImmutableSegmentedDictionary<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags> generatedCodeAnalysisFlagsMap) 576foreach (var analyzer in analyzers) 590private bool ShouldSkipAnalysisOnGeneratedCode(DiagnosticAnalyzer analyzer) 594DiagnosticAnalyzer analyzer, 595ImmutableSegmentedDictionary<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags> generatedCodeAnalysisFlagsMap, 607private bool ShouldSuppressGeneratedCodeDiagnostic(Diagnostic diagnostic, DiagnosticAnalyzer analyzer, Compilation compilation, CancellationToken cancellationToken) 712private static void OnDriverException(Task faultedTask, AnalyzerExecutor analyzerExecutor, ImmutableArray<DiagnosticAnalyzer> analyzers) 726var analyzer = analyzers[0]; 810ImmutableArray<DiagnosticAnalyzer> analyzers, 820Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = 830ImmutableArray<DiagnosticAnalyzer> analyzers, 833Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException, 902foreach (var analyzer in Analyzers) 1100public ImmutableArray<Diagnostic> DequeueLocalDiagnosticsAndApplySuppressions(DiagnosticAnalyzer analyzer, bool syntax, Compilation compilation) 1106public ImmutableArray<Diagnostic> DequeueNonLocalDiagnosticsAndApplySuppressions(DiagnosticAnalyzer analyzer, Compilation compilation) 1273private bool IsAnalyzerSuppressedForTree(DiagnosticAnalyzer analyzer, SyntaxTree tree, SyntaxTreeOptionsProvider? options) 1283private ImmutableHashSet<DiagnosticAnalyzer> ComputeSuppressedAnalyzersForTree(SyntaxTree tree, SyntaxTreeOptionsProvider? options) 1287return ImmutableHashSet<DiagnosticAnalyzer>.Empty; 1290ImmutableHashSet<DiagnosticAnalyzer>.Builder? suppressedAnalyzersBuilder = null; 1291foreach (var analyzer in UnsuppressedAnalyzers) 1334suppressedAnalyzersBuilder ??= ImmutableHashSet.CreateBuilder<DiagnosticAnalyzer>(); 1339return suppressedAnalyzersBuilder != null ? suppressedAnalyzersBuilder.ToImmutable() : ImmutableHashSet<DiagnosticAnalyzer>.Empty; 1368internal ImmutableDictionary<DiagnosticAnalyzer, TimeSpan> AnalyzerExecutionTimes => AnalyzerExecutor.AnalyzerExecutionTimes; 1369internal TimeSpan ResetAnalyzerExecutionTime(DiagnosticAnalyzer analyzer) => AnalyzerExecutor.ResetAnalyzerExecutionTime(analyzer); 1371private static ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<ImmutableArray<SymbolAnalyzerAction>>)> MakeSymbolActionsByKind(in AnalyzerActions analyzerActions) 1373var builder = ArrayBuilder<(DiagnosticAnalyzer, ImmutableArray<ImmutableArray<SymbolAnalyzerAction>>)>.GetInstance(); 1402private static ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<TAnalyzerAction>)> MakeActionsByAnalyzer<TAnalyzerAction>(in ImmutableArray<TAnalyzerAction> analyzerActions) 1405var builder = ArrayBuilder<(DiagnosticAnalyzer, ImmutableArray<TAnalyzerAction>)>.GetInstance(); 1415private static ImmutableHashSet<DiagnosticAnalyzer> MakeCompilationEndAnalyzers(ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<CompilationAnalyzerAction>)> compilationEndActionsByAnalyzer) 1417var builder = ImmutableHashSet.CreateBuilder<DiagnosticAnalyzer>(); 1549ImmutableArray<DiagnosticAnalyzer> processedAnalyzers; 1567private async Task OnEventProcessedCoreAsync(CompilationEvent compilationEvent, ImmutableArray<DiagnosticAnalyzer> processedAnalyzers, CancellationToken cancellationToken) 1574foreach (var analyzer in processedAnalyzers) 1596async Task onSymbolAndMembersProcessedAsync(ISymbol symbol, DiagnosticAnalyzer analyzer) 1612async Task processContainerOnMemberCompletedAsync(INamespaceOrTypeSymbol containerSymbol, ISymbol processedMemberSymbol, DiagnosticAnalyzer analyzer) 1723out ImmutableArray<DiagnosticAnalyzer> subsetProcessedAnalyzers) 1731subsetProcessedAnalyzers = ImmutableArray<DiagnosticAnalyzer>.Empty; 1736var completedAnalyzers = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(); 1737var processedAnalyzers = PooledHashSet<DiagnosticAnalyzer>.GetInstance(); 1742var analyzer = groupedActions.Key; 1764foreach (var analyzer in analysisScope.Analyzers) 1782subsetProcessedAnalyzers = ImmutableArray<DiagnosticAnalyzer>.Empty; 1847ImmutableArray<(DiagnosticAnalyzer, ImmutableArray<CompilationAnalyzerAction>)> compilationActionsMap, 1876internal static Action<Diagnostic, DiagnosticAnalyzer, bool, CancellationToken> GetDiagnosticSink(Action<Diagnostic, DiagnosticAnalyzer, bool> addLocalDiagnosticCore, Compilation compilation, AnalyzerOptions? analyzerOptions, SeverityFilter severityFilter, ConcurrentSet<string>? suppressedDiagnosticIds) 1888internal static Action<Diagnostic, DiagnosticAnalyzer, CancellationToken> GetDiagnosticSink(Action<Diagnostic, DiagnosticAnalyzer> addDiagnosticCore, Compilation compilation, AnalyzerOptions? analyzerOptions, SeverityFilter severityFilter, ConcurrentSet<string>? suppressedDiagnosticIds) 1930private static async Task<(AnalyzerActions actions, ImmutableHashSet<DiagnosticAnalyzer> unsuppressedAnalyzers)> GetAnalyzerActionsAsync( 1931ImmutableArray<DiagnosticAnalyzer> analyzers, 1937var unsuppressedAnalyzersBuilder = PooledHashSet<DiagnosticAnalyzer>.GetInstance(); 1938foreach (var analyzer in analyzers) 1971var analyzer = analysisScope.Analyzers[0]; 1984var symbolStartAnalyzers = PooledHashSet<DiagnosticAnalyzer>.GetInstance(); 1992foreach (var analyzer in analysisScope.Analyzers) 2022foreach (var analyzer in analysisScope.Analyzers) 2044DiagnosticAnalyzer analyzer, 2070async ValueTask<IGroupedAnalyzerActions> getAllActionsAsync(AnalyzerDriver driver, ISymbol symbol, DiagnosticAnalyzer analyzer, CancellationToken cancellationToken) 2086async ValueTask<IGroupedAnalyzerActions> getInheritedActionsAsync(AnalyzerDriver driver, ISymbol symbol, DiagnosticAnalyzer analyzer, CancellationToken cancellationToken) 2110static async ValueTask<AnalyzerActions> getSymbolActionsCoreAsync(AnalyzerDriver driver, ISymbol symbol, DiagnosticAnalyzer analyzer) 2127private static async Task<ImmutableSegmentedDictionary<DiagnosticAnalyzer, SemaphoreSlim>> CreateAnalyzerGateMapAsync( 2128ImmutableHashSet<DiagnosticAnalyzer> analyzers, 2133var builder = ImmutableSegmentedDictionary.CreateBuilder<DiagnosticAnalyzer, SemaphoreSlim>(); 2134foreach (var analyzer in analyzers) 2150private static async Task<ImmutableSegmentedDictionary<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags>> CreateGeneratedCodeAnalysisFlagsMapAsync( 2151ImmutableHashSet<DiagnosticAnalyzer> analyzers, 2156var builder = ImmutableSegmentedDictionary.CreateBuilder<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags>(); 2157foreach (var analyzer in analyzers) 2257internal async Task<AnalyzerActionCounts> GetAnalyzerActionCountsAsync(DiagnosticAnalyzer analyzer, CompilationOptions compilationOptions, CancellationToken cancellationToken) 2278DiagnosticAnalyzer analyzer, 2287private static bool IsCompilerAnalyzer(DiagnosticAnalyzer analyzer) => analyzer is CompilerDiagnosticAnalyzer; 2314internal AnalyzerDriver(ImmutableArray<DiagnosticAnalyzer> analyzers, Func<SyntaxNode, TLanguageKindEnum> getKind, AnalyzerManager analyzerManager, SeverityFilter severityFilter, Func<SyntaxTrivia, bool> isComment) 2386protected override IGroupedAnalyzerActions CreateGroupedActions(DiagnosticAnalyzer analyzer, in AnalyzerActions analyzerActions) 2601var 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, 71private DiagnosticAnalyzer _analyzer; 74private Action<Diagnostic, DiagnosticAnalyzer, bool, CancellationToken>? _addCategorizedLocalDiagnostic; 75private Action<Diagnostic, DiagnosticAnalyzer, CancellationToken>? _addCategorizedNonLocalDiagnostic; 76private Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> _shouldSuppressGeneratedCodeDiagnostic;
DiagnosticAnalyzer\AnalyzerExecutor.cs (69)
37private readonly Action<Diagnostic, DiagnosticAnalyzer, bool, CancellationToken>? _addCategorizedLocalDiagnostic; 38private readonly Action<Diagnostic, DiagnosticAnalyzer, CancellationToken>? _addCategorizedNonLocalDiagnostic; 40private readonly Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> _onAnalyzerException; 43private readonly Func<DiagnosticAnalyzer, bool>? _isCompilerAnalyzer; 44private readonly Func<DiagnosticAnalyzer, object?>? _getAnalyzerGate; 46private readonly Func<DiagnosticAnalyzer, bool> _shouldSkipAnalysisOnGeneratedCode; 47private readonly Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> _shouldSuppressGeneratedCodeDiagnostic; 49private readonly Func<DiagnosticAnalyzer, SyntaxTree, SyntaxTreeOptionsProvider?, bool>? _isAnalyzerSuppressedForTree; 54private readonly ConcurrentDictionary<DiagnosticAnalyzer, StrongBox<long>>? _analyzerExecutionTimeMap; 65private bool IsAnalyzerSuppressedForTree(DiagnosticAnalyzer analyzer, SyntaxTree tree) 107Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> onAnalyzerException, 109Func<DiagnosticAnalyzer, bool> isCompilerAnalyzer, 111Func<DiagnosticAnalyzer, bool> shouldSkipAnalysisOnGeneratedCode, 112Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> shouldSuppressGeneratedCodeDiagnostic, 114Func<DiagnosticAnalyzer, SyntaxTree, SyntaxTreeOptionsProvider?, bool> isAnalyzerSuppressedForTree, 115Func<DiagnosticAnalyzer, object?> getAnalyzerGate, 118Action<Diagnostic, DiagnosticAnalyzer, bool, CancellationToken>? addCategorizedLocalDiagnostic = null, 119Action<Diagnostic, DiagnosticAnalyzer, CancellationToken>? addCategorizedNonLocalDiagnostic = null, 127var analyzerExecutionTimeMap = logExecutionTime ? new ConcurrentDictionary<DiagnosticAnalyzer, StrongBox<long>>() : null; 136/// Creates <see cref="AnalyzerExecutor"/> to fetch <see cref="DiagnosticAnalyzer.SupportedDiagnostics"/>. 145Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken>? onAnalyzerException, 175Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> onAnalyzerException, 177Func<DiagnosticAnalyzer, bool>? isCompilerAnalyzer, 179Func<DiagnosticAnalyzer, bool> shouldSkipAnalysisOnGeneratedCode, 180Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> shouldSuppressGeneratedCodeDiagnostic, 182Func<DiagnosticAnalyzer, SyntaxTree, SyntaxTreeOptionsProvider?, bool>? isAnalyzerSuppressedForTree, 183Func<DiagnosticAnalyzer, object?>? getAnalyzerGate, 185ConcurrentDictionary<DiagnosticAnalyzer, StrongBox<long>>? analyzerExecutionTimeMap, 186Action<Diagnostic, DiagnosticAnalyzer, bool, CancellationToken>? addCategorizedLocalDiagnostic, 187Action<Diagnostic, DiagnosticAnalyzer, CancellationToken>? addCategorizedNonLocalDiagnostic, 253internal Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> OnAnalyzerException => _onAnalyzerException; 254internal ImmutableDictionary<DiagnosticAnalyzer, TimeSpan> AnalyzerExecutionTimes 264/// Executes the <see cref="DiagnosticAnalyzer.Initialize(AnalysisContext)"/> for the given analyzer. 273public void ExecuteInitializeMethod(DiagnosticAnalyzer analyzer, HostSessionStartAnalysisScope sessionScope) 316DiagnosticAnalyzer analyzer, 381DiagnosticAnalyzer analyzer, 416DiagnosticAnalyzer analyzer, 466DiagnosticAnalyzer analyzer, 497DiagnosticAnalyzer analyzer, 511DiagnosticAnalyzer analyzer, 554DiagnosticAnalyzer analyzer, 596DiagnosticAnalyzer analyzer, 638DiagnosticAnalyzer analyzer, 715DiagnosticAnalyzer analyzer, 750DiagnosticAnalyzer analyzer, 768DiagnosticAnalyzer analyzer, 890DiagnosticAnalyzer analyzer, 966DiagnosticAnalyzer analyzer, 990DiagnosticAnalyzer analyzer, 1056DiagnosticAnalyzer analyzer, 1078DiagnosticAnalyzer analyzer, 1129internal void ExecuteAndCatchIfThrows<TArg>(DiagnosticAnalyzer analyzer, Action<TArg> analyze, TArg argument, AnalysisContextInfo? info = null) 1161private void ExecuteAndCatchIfThrows_NoLock<TArg>(DiagnosticAnalyzer analyzer, Action<TArg> analyze, TArg argument, AnalysisContextInfo? info) 1198internal static Diagnostic CreateAnalyzerExceptionDiagnostic(DiagnosticAnalyzer analyzer, Exception e, AnalysisContextInfo? info = null) 1221private static string CreateDisablingMessage(DiagnosticAnalyzer analyzer, string analyzerName) 1316private bool IsSupportedDiagnostic(DiagnosticAnalyzer analyzer, Diagnostic diagnostic) 1329private Action<Diagnostic> GetAddDiagnostic(ISymbol contextSymbol, ImmutableArray<SyntaxReference> cachedDeclaringReferences, DiagnosticAnalyzer analyzer, Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis) 1339DiagnosticAnalyzer analyzer, 1341Action<Diagnostic, DiagnosticAnalyzer, bool, CancellationToken>? addCategorizedLocalDiagnostic, 1342Action<Diagnostic, DiagnosticAnalyzer, CancellationToken>? addCategorizedNonLocalDiagnostic, 1344Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> shouldSuppressGeneratedCodeDiagnostic, 1384private Action<Diagnostic> GetAddCompilationDiagnostic(DiagnosticAnalyzer analyzer) 1404private AnalyzerDiagnosticReporter GetAddSemanticDiagnostic(SyntaxTree tree, DiagnosticAnalyzer analyzer) 1411private AnalyzerDiagnosticReporter GetAddSemanticDiagnostic(SyntaxTree tree, TextSpan? span, DiagnosticAnalyzer analyzer) 1418private AnalyzerDiagnosticReporter GetAddSyntaxDiagnostic(SourceOrAdditionalFile file, DiagnosticAnalyzer analyzer) 1425private bool ShouldExecuteNode(SyntaxNode node, DiagnosticAnalyzer analyzer) 1437private bool ShouldExecuteOperation(IOperation operation, DiagnosticAnalyzer analyzer) 1449internal TimeSpan ResetAnalyzerExecutionTime(DiagnosticAnalyzer analyzer) 1472private bool IsAnalyzerSuppressedForSymbol(DiagnosticAnalyzer analyzer, ISymbol symbol)
DiagnosticAnalyzer\AnalyzerFileReference.cs (6)
38private readonly Extensions<DiagnosticAnalyzer> _diagnosticAnalyzers; 108public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzersForAllLanguages() 115public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzers(string language) 184/// Adds the <see cref="ImmutableArray{T}"/> of <see cref="DiagnosticAnalyzer"/> defined in this assembly reference of given <paramref name="language"/>. 186internal 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 (10)
20private readonly DiagnosticAnalyzer _analyzer; 59public AnalyzerExecutionContext(DiagnosticAnalyzer analyzer) 240public ImmutableArray<DiagnosticDescriptor> GetOrComputeDiagnosticDescriptors(DiagnosticAnalyzer analyzer, AnalyzerExecutor analyzerExecutor) 248Func<DiagnosticAnalyzer, AnalyzerExecutor, ImmutableArray<TDescriptor>> computeDescriptorsNoLock, 249DiagnosticAnalyzer analyzer, 275/// Compute <see cref="DiagnosticAnalyzer.SupportedDiagnostics"/> and exception handler for the given <paramref name="analyzer"/>. 278DiagnosticAnalyzer analyzer, 296throw new ArgumentException(string.Format(CodeAnalysisResources.SupportedDiagnosticsHasNullDescriptor, analyzer.ToString()), nameof(DiagnosticAnalyzer.SupportedDiagnostics)); 306Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> onAnalyzerException = analyzerExecutor.OnAnalyzerException; 327DiagnosticAnalyzer analyzer,
DiagnosticAnalyzer\AnalyzerManager.cs (28)
21/// 1) <see cref="DiagnosticAnalyzer.Initialize(AnalysisContext)"/> is invoked only once per-analyzer. 22/// 2) <see cref="DiagnosticAnalyzer.SupportedDiagnostics"/> is invoked only once per-analyzer. 28private readonly ImmutableDictionary<DiagnosticAnalyzer, AnalyzerExecutionContext> _analyzerExecutionContextMap; 30public AnalyzerManager(ImmutableArray<DiagnosticAnalyzer> analyzers) 35public AnalyzerManager(DiagnosticAnalyzer analyzer) 40private ImmutableDictionary<DiagnosticAnalyzer, AnalyzerExecutionContext> CreateAnalyzerExecutionContextMap(IEnumerable<DiagnosticAnalyzer> analyzers) 42var builder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, AnalyzerExecutionContext>(); 43foreach (var analyzer in analyzers) 51private AnalyzerExecutionContext GetAnalyzerExecutionContext(DiagnosticAnalyzer analyzer) => _analyzerExecutionContextMap[analyzer]; 57DiagnosticAnalyzer analyzer, 91DiagnosticAnalyzer analyzer, 123DiagnosticAnalyzer analyzer, 153/// The returned actions include the actions registered during <see cref="DiagnosticAnalyzer.Initialize(AnalysisContext)"/> method as well as 157public async ValueTask<AnalyzerActions> GetAnalyzerActionsAsync(DiagnosticAnalyzer analyzer, AnalyzerExecutor analyzerExecutor) 177DiagnosticAnalyzer analyzer, 219public async Task<bool> IsConcurrentAnalyzerAsync(DiagnosticAnalyzer analyzer, AnalyzerExecutor analyzerExecutor) 229public async Task<GeneratedCodeAnalysisFlags> GetGeneratedCodeAnalysisFlagsAsync(DiagnosticAnalyzer analyzer, AnalyzerExecutor analyzerExecutor) 246/// Return <see cref="DiagnosticAnalyzer.SupportedDiagnostics"/> of given <paramref name="analyzer"/>. 249DiagnosticAnalyzer analyzer, 267internal bool IsSupportedDiagnostic(DiagnosticAnalyzer analyzer, Diagnostic diagnostic, Func<DiagnosticAnalyzer, bool> isCompilerAnalyzer, AnalyzerExecutor analyzerExecutor) 293DiagnosticAnalyzer analyzer, 295Func<DiagnosticAnalyzer, bool> isCompilerAnalyzer, 431DiagnosticAnalyzer analyzer, 437public bool TryStartExecuteSymbolEndActions(ImmutableArray<SymbolEndAnalyzerAction> symbolEndActions, DiagnosticAnalyzer analyzer, SymbolDeclaredCompilationEvent symbolDeclaredEvent) 444DiagnosticAnalyzer analyzer, 451public 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 (49)
26private readonly ImmutableArray<DiagnosticAnalyzer> _analyzers; 62public ImmutableArray<DiagnosticAnalyzer> Analyzers => _analyzers; 82public CompilationWithAnalyzers(Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, AnalyzerOptions? options, CancellationToken cancellationToken) 93public CompilationWithAnalyzers(Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, CompilationWithAnalyzersOptions analysisOptions) 98private CompilationWithAnalyzers(Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, CompilationWithAnalyzersOptions analysisOptions, CancellationToken cancellationToken) 119private static void VerifyArguments(Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, CompilationWithAnalyzersOptions analysisOptions) 134private static void VerifyAnalyzersArgumentForStaticApis(ImmutableArray<DiagnosticAnalyzer> analyzers, bool allowDefaultOrEmpty = false) 158private void VerifyAnalyzerArgument(DiagnosticAnalyzer analyzer) 168private static void VerifyAnalyzerArgumentForStaticApis(DiagnosticAnalyzer analyzer) 176private void VerifyExistingAnalyzersArgument(ImmutableArray<DiagnosticAnalyzer> analyzers) 256public async Task<ImmutableArray<Diagnostic>> GetAnalyzerDiagnosticsAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 276public async Task<AnalysisResult> GetAnalysisResultAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 304async Task<ImmutableArray<Diagnostic>> getAllDiagnosticsWithoutStateTrackingAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 352public async Task<ImmutableArray<Diagnostic>> GetAnalyzerCompilationDiagnosticsAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 359private async Task<ImmutableArray<Diagnostic>> GetAnalyzerCompilationDiagnosticsCoreAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 367private async Task<AnalysisResult> GetAnalysisResultCoreAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 375private async Task<ImmutableArray<Diagnostic>> GetAnalyzerDiagnosticsCoreAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 383private static AnalyzerDriver CreateDriverForComputingDiagnosticsWithoutStateTracking(Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers) 418public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsAsync(SyntaxTree tree, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 446public Task<AnalysisResult> GetAnalysisResultAsync(SyntaxTree tree, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 476public async Task<AnalysisResult> GetAnalysisResultAsync(AdditionalText file, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 484private async Task<AnalysisResult> GetAnalysisResultCoreAsync(SourceOrAdditionalFile file, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 491private async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsCoreAsync(SyntaxTree tree, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 520public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSemanticDiagnosticsAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 550public Task<AnalysisResult> GetAnalysisResultAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 558private async Task<AnalysisResult> GetAnalysisResultCoreAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 565private async Task<ImmutableArray<Diagnostic>> GetAnalyzerSemanticDiagnosticsCoreAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 639Func<DiagnosticAnalyzer, AnalyzerActionCounts> getAnalyzerActionCounts = analyzer => analyzerActionCounts[analyzer]; 784static async Task<(ImmutableDictionary<DiagnosticAnalyzer, AnalyzerActionCounts> analyzerActionCounts, bool hasAnyActionsRequiringCompilationEvents)> getAnalyzerActionCountsAsync( 785ImmutableArray<DiagnosticAnalyzer> analyzers, 793var builder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, AnalyzerActionCounts>(); 795foreach (var analyzer in analyzers) 807static (ImmutableArray<DiagnosticAnalyzer> symbolStartAnalyzers, ImmutableArray<DiagnosticAnalyzer> otherAnalyzers) getSymbolStartAnalyzers( 808ImmutableArray<DiagnosticAnalyzer> analyzers, 809ImmutableDictionary<DiagnosticAnalyzer, AnalyzerActionCounts> analyzerActionCounts) 811var symbolStartAnalyzersBuilder = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(); 812var otherAnalyzersBuilder = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(); 814foreach (var analyzer in analyzers) 832ImmutableArray<DiagnosticAnalyzer> symbolStartAnalyzers, 1167/// Given a set of compiler or <see cref="DiagnosticAnalyzer"/> generated <paramref name="diagnostics"/>, returns the effective diagnostics after applying the below filters: 1177/// Given a set of compiler or <see cref="DiagnosticAnalyzer"/> generated <paramref name="diagnostics"/>, returns the effective diagnostics after applying the below filters: 1234DiagnosticAnalyzer analyzer, 1236Action<Exception, DiagnosticAnalyzer, Diagnostic>? onAnalyzerException = null) 1247Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken>? wrappedOnAnalyzerException = 1259public static void ClearAnalyzerState(ImmutableArray<DiagnosticAnalyzer> analyzers) 1266public async Task<AnalyzerTelemetryInfo> GetAnalyzerTelemetryInfoAsync(DiagnosticAnalyzer analyzer, CancellationToken cancellationToken) 1286private async Task<AnalyzerActionCounts> GetAnalyzerActionCountsAsync(DiagnosticAnalyzer analyzer, CancellationToken cancellationToken) 1304private 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 (2)
19public static CompilationWithAnalyzers WithAnalyzers(this Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, AnalyzerOptions? options = null, CancellationToken cancellationToken = default) 30public 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 (45)
21private readonly DiagnosticAnalyzer _analyzer; 24public AnalyzerAnalysisContext(DiagnosticAnalyzer analyzer, HostSessionStartAnalysisScope scope) 124private readonly DiagnosticAnalyzer _analyzer; 129DiagnosticAnalyzer analyzer, 226private readonly DiagnosticAnalyzer _analyzer; 229internal AnalyzerSymbolStartAnalysisContext(DiagnosticAnalyzer analyzer, 290private readonly DiagnosticAnalyzer _analyzer; 293internal AnalyzerCodeBlockStartAnalysisContext(DiagnosticAnalyzer analyzer, 325private readonly DiagnosticAnalyzer _analyzer; 328internal AnalyzerOperationBlockStartAnalysisContext(DiagnosticAnalyzer analyzer, 361private ImmutableHashSet<DiagnosticAnalyzer> _concurrentAnalyzers = ImmutableHashSet<DiagnosticAnalyzer>.Empty; 362private readonly ConcurrentDictionary<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags> _generatedCodeConfigurationMap = new ConcurrentDictionary<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags>(); 364public bool IsConcurrentAnalyzer(DiagnosticAnalyzer analyzer) 369public GeneratedCodeAnalysisFlags GetGeneratedCodeAnalysisFlags(DiagnosticAnalyzer analyzer) 375public void RegisterCompilationStartAction(DiagnosticAnalyzer analyzer, Action<CompilationStartAnalysisContext> action) 381public void EnableConcurrentExecution(DiagnosticAnalyzer analyzer) 387public void ConfigureGeneratedCodeAnalysis(DiagnosticAnalyzer analyzer, GeneratedCodeAnalysisFlags mode) 405public override AnalyzerActions GetAnalyzerActions(DiagnosticAnalyzer analyzer) 456public void RegisterCodeBlockEndAction(DiagnosticAnalyzer analyzer, Action<CodeBlockAnalysisContext> action) 461public void RegisterSyntaxNodeAction(DiagnosticAnalyzer analyzer, Action<SyntaxNodeAnalysisContext> action, ImmutableArray<TLanguageKindEnum> syntaxKinds) 480public void RegisterOperationBlockEndAction(DiagnosticAnalyzer analyzer, Action<OperationBlockAnalysisContext> action) 485public void RegisterOperationAction(DiagnosticAnalyzer analyzer, Action<OperationAnalysisContext> action, ImmutableArray<OperationKind> operationKinds) 493private readonly ConcurrentDictionary<DiagnosticAnalyzer, StrongBox<AnalyzerActions>> _analyzerActions = new ConcurrentDictionary<DiagnosticAnalyzer, StrongBox<AnalyzerActions>>(); 495public virtual AnalyzerActions GetAnalyzerActions(DiagnosticAnalyzer analyzer) 500public void RegisterCompilationAction(DiagnosticAnalyzer analyzer, Action<CompilationAnalysisContext> action) 506public void RegisterCompilationEndAction(DiagnosticAnalyzer analyzer, Action<CompilationAnalysisContext> action) 512public void RegisterSemanticModelAction(DiagnosticAnalyzer analyzer, Action<SemanticModelAnalysisContext> action) 518public void RegisterSyntaxTreeAction(DiagnosticAnalyzer analyzer, Action<SyntaxTreeAnalysisContext> action) 524public void RegisterAdditionalFileAction(DiagnosticAnalyzer analyzer, Action<AdditionalFileAnalysisContext> action) 530public void RegisterSymbolAction(DiagnosticAnalyzer analyzer, Action<SymbolAnalysisContext> action, ImmutableArray<SymbolKind> symbolKinds) 584public void RegisterSymbolStartAction(DiagnosticAnalyzer analyzer, Action<SymbolStartAnalysisContext> action, SymbolKind symbolKind) 590public void RegisterSymbolEndAction(DiagnosticAnalyzer analyzer, Action<SymbolAnalysisContext> action) 596public void RegisterCodeBlockStartAction<TLanguageKindEnum>(DiagnosticAnalyzer analyzer, Action<CodeBlockStartAnalysisContext<TLanguageKindEnum>> action) where TLanguageKindEnum : struct 602public void RegisterCodeBlockEndAction(DiagnosticAnalyzer analyzer, Action<CodeBlockAnalysisContext> action) 608public void RegisterCodeBlockAction(DiagnosticAnalyzer analyzer, Action<CodeBlockAnalysisContext> action) 614public void RegisterSyntaxNodeAction<TLanguageKindEnum>(DiagnosticAnalyzer analyzer, Action<SyntaxNodeAnalysisContext> action, ImmutableArray<TLanguageKindEnum> syntaxKinds) where TLanguageKindEnum : struct 620public void RegisterOperationBlockStartAction(DiagnosticAnalyzer analyzer, Action<OperationBlockStartAnalysisContext> action) 626public void RegisterOperationBlockEndAction(DiagnosticAnalyzer analyzer, Action<OperationBlockAnalysisContext> action) 632public void RegisterOperationBlockAction(DiagnosticAnalyzer analyzer, Action<OperationBlockAnalysisContext> action) 638public void RegisterOperationAction(DiagnosticAnalyzer analyzer, Action<OperationAnalysisContext> action, ImmutableArray<OperationKind> operationKinds) 644protected StrongBox<AnalyzerActions> GetOrCreateAnalyzerActions(DiagnosticAnalyzer analyzer) 832internal readonly ImmutableArray<SyntaxNodeAnalyzerAction<TLanguageKindEnum>> GetSyntaxNodeActions<TLanguageKindEnum>(DiagnosticAnalyzer analyzer) where TLanguageKindEnum : struct
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 (11)
AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (5)
86Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnostics, 392Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnostics, 396using var _1 = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(out var analyzersBuilder); 402foreach (var analyzer in compilationWithAnalyzers.Analyzers) 481static void AddAllDiagnostics(ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> diagnostics, ArrayBuilder<Diagnostic> reportedDiagnostics)
CodeActionRequestPriority.cs (3)
29/// <see cref="T:CodeFixProvider.RequestPriority"/> is <see cref="Low"/>. <see cref="DiagnosticAnalyzer"/>s 37/// <see cref="T:CodeFixProvider.RequestPriority"/> is <see cref="Normal"/>. <see cref="DiagnosticAnalyzer"/>s 46/// The <see cref="DiagnosticAnalyzerExtensions.IsCompilerAnalyzer"/> <see cref="DiagnosticAnalyzer"/>
DiagnosticAnalyzerCategory.cs (1)
19/// Note: an <see cref="DiagnosticAnalyzer"/> that uses this will not work properly if
DiagnosticAnalyzerExtensions.cs (1)
15public static bool IsCompilerAnalyzer(this DiagnosticAnalyzer analyzer)
IPragmaSuppressionsAnalyzer.cs (1)
26Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnostics,
Microsoft.CodeAnalysis.CodeStyle.LegacyTestFramework.UnitTestUtilities (8)
AbstractDiagnosticProviderBasedUserDiagnosticTest.cs (7)
33private readonly ConcurrentDictionary<Workspace, (DiagnosticAnalyzer, CodeFixProvider)> _analyzerAndFixerMap = new(); 40internal abstract (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace); 42internal virtual (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace, TestParameters parameters) 45private (DiagnosticAnalyzer, CodeFixProvider) GetOrCreateDiagnosticProviderAndFixer( 72var diagnosticAnalyzer = CreateDiagnosticProviderAndFixer(workspace).Item1; 96var diagnosticAnalyzer = CreateDiagnosticProviderAndFixer(workspace).Item1; 119var diagnosticAnalyzer = CreateDiagnosticProviderAndFixer(workspace).Item1;
AbstractUserDiagnosticTest.cs (1)
88protected static void AddAnalyzerToWorkspace(Workspace workspace, DiagnosticAnalyzer analyzer, TestParameters parameters)
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (8)
CodeFixVerifierHelper.cs (4)
24public static void VerifyStandardProperty(DiagnosticAnalyzer analyzer, AnalyzerProperty property) 45private static void VerifyMessageTitle(DiagnosticAnalyzer analyzer) 59private static void VerifyMessageDescription(DiagnosticAnalyzer analyzer) 89private static void VerifyMessageHelpLinkUri(DiagnosticAnalyzer analyzer)
CSharpCodeFixVerifier`2.cs (1)
15where TAnalyzer : DiagnosticAnalyzer, new()
CSharpCodeFixVerifier`2+Test.cs (1)
29where TAnalyzer : DiagnosticAnalyzer, new()
VisualBasicCodeFixVerifier`2.cs (1)
15where TAnalyzer : DiagnosticAnalyzer, new()
VisualBasicCodeFixVerifier`2+Test.cs (1)
26where TAnalyzer : DiagnosticAnalyzer, new()
Microsoft.CodeAnalysis.CSharp (2)
CommandLine\CSharpCompiler.cs (1)
337out ImmutableArray<DiagnosticAnalyzer> analyzers,
Compilation\CSharpCompilation.cs (1)
4439internal override AnalyzerDriver CreateAnalyzerDriver(ImmutableArray<DiagnosticAnalyzer> analyzers, AnalyzerManager analyzerManager, SeverityFilter severityFilter)
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
UseExpressionBodyHelper`1.cs (1)
22/// requirements with <see cref="DiagnosticAnalyzer"/> and "CodeRefactoringProvider".
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (60)
AddAnonymousTypeMemberNameTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
AddBracesTests.cs (1)
27internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
AddDocCommentNodesCodeFixProviderTests.cs (1)
25internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
AddExplicitCastTests.cs (1)
26internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
AddParameterTests.cs (1)
30internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
AddRequiredExpressionParenthesesTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
AddRequiredPatternParenthesesTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
AliasAmbiguousTypeTests.cs (1)
29internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
ChangeToIEnumerableTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProviderTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
CSharpAsAndNullCheckTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
CSharpDeclareAsNullableCodeFixTests.cs (1)
25internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
CSharpInlineDeclarationTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
CSharpIsAndCastCheckDiagnosticAnalyzerTests.cs (1)
30internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
HideBaseTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
InvokeDelegateWithConditionalAccessTests.cs (1)
25internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
MakeFieldReadonlyTests.cs (1)
30internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
MakeLocalFunctionStaticTests.cs (1)
27internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
MakeMethodAsynchronousTests.cs (1)
26internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
MakeRefStructTests.cs (1)
44internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
MakeTypeAbstractTests.cs (1)
25internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
MisplacedUsingDirectivesTests.cs (1)
29internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
NamingStylesTests.cs (1)
33internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
OrderModifiersCompilerErrorTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
OrderModifiersTests.cs (1)
25internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
PopulateSwitchExpressionTests.cs (1)
25internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
PopulateSwitchStatementTests.cs (1)
24internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
QualifyMemberAccessTests.cs (1)
27internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
RemoveDocCommentNodeCodeFixProviderTests.cs (1)
25internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
RemoveInKeywordCodeFixProviderTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
RemoveNewModifierCodeFixProviderTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
RemoveUnnecessaryCastTests_FixAllTests.cs (1)
23internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
RemoveUnnecessaryExpressionParenthesesTests.cs (1)
30internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
RemoveUnnecessaryImportsTests_FixAllTests.cs (1)
25internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
RemoveUnnecessaryPatternParenthesesTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
RemoveUnusedLocalFunctionTests.cs (1)
26internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
RemoveUnusedParametersTests.cs (1)
31internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
RemoveUnusedValuesTestsBase.cs (1)
24internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
ReplaceDefaultLiteralTests.cs (1)
26internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
SimplifyConditionalTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
SimplifyInterpolationTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UpdateProjectToAllowUnsafeTests.cs (1)
27internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UpgradeProjectTests.cs (1)
31internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseAutoPropertyTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseCoalesceExpressionForNullableTernaryConditionalCheckTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseCoalesceExpressionForTernaryConditionalCheckTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseConditionalExpressionForReturnTests.cs (1)
29internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseExplicitTypeForConstTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseExplicitTypeTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseExpressionBodyForLambdasAnalyzerTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseImplicitTypeTests.cs (1)
29internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseInferredMemberNameTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseInterpolatedVerbatimStringCodeFixTests.cs (1)
25internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseIsNullCheckForCastAndEqualityOperatorTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseIsNullCheckForReferenceEqualsTests.cs (1)
30internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseLocalFunctionTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseSimpleUsingStatementTests.cs (1)
29internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseSystemHashCodeTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseThrowExpressionTests.cs (1)
29internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
ValidateFormatStringTests.cs (1)
25internal override (DiagnosticAnalyzer, CodeFixProvider?) CreateDiagnosticProviderAndFixer(Workspace workspace)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (11)
CommandLineTestBase.cs (2)
56internal MockCSharpCompiler CreateCSharpCompiler(string[] args, DiagnosticAnalyzer[]? analyzers = null, ISourceGenerator[]? generators = null, AnalyzerAssemblyLoader? loader = null, GeneratorDriverCache? driverCache = null) 61internal MockCSharpCompiler CreateCSharpCompiler(string? responseFile, string workingDirectory, string[] args, DiagnosticAnalyzer[]? analyzers = null, ISourceGenerator[]? generators = null, AnalyzerAssemblyLoader? loader = null, GeneratorDriverCache? driverCache = null)
CommandLineTests.cs (8)
9311? Array.Empty<DiagnosticAnalyzer>() 9312: new DiagnosticAnalyzer[] { new HiddenDiagnosticAnalyzer(), new WarningDiagnosticAnalyzer() }; 10293DiagnosticAnalyzer[] analyzers = null, 12452var analyzerAndSuppressor = new DiagnosticAnalyzer[] { analyzer, suppressor }; 12482analyzerAndSuppressor = new DiagnosticAnalyzer[] { analyzer, suppressor }; 12510var analyzerAndSuppressor = new DiagnosticAnalyzer[] { analyzer, suppressor }; 12992private void TestAnalyzerConfigRespectedCore(DiagnosticAnalyzer analyzer, DiagnosticDescriptor descriptor, ReportDiagnostic analyzerConfigSeverity, bool noWarn, bool errorlog) 14408params DiagnosticAnalyzer[] analyzers)
SarifV2ErrorLoggerTests.cs (1)
524analyzers: new DiagnosticAnalyzer[] { new AnalyzerForErrorLogTest(), new SuppressorForErrorLogTest() });
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (175)
AddAnonymousTypeMemberNameTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
AddBracesTests.cs (1)
27internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
AddDocCommentNodesCodeFixProviderTests.cs (1)
25internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
AddExplicitCastTests.cs (1)
26internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
AddParameterTests.cs (1)
30internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
AddRequiredExpressionParenthesesTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
AddRequiredPatternParenthesesTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
AddUsing\AbstractAddUsingTests.cs (1)
27internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
AddUsing\AddUsingNuGetTests.cs (1)
43internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(
AddUsing\AddUsingTestsWithAddImportDiagnosticProvider.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
AliasAmbiguousTypeTests.cs (1)
29internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
ChangeToIEnumerableTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProviderTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
CSharpAsAndNullCheckTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
CSharpDeclareAsNullableCodeFixTests.cs (1)
25internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
CSharpInlineDeclarationTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
CSharpIsAndCastCheckDiagnosticAnalyzerTests.cs (1)
30internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
Diagnostics\Configuration\ConfigureCodeStyle\BooleanCodeStyleOptionConfigurationTests.cs (2)
27internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 29return 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)
38internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 45return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>(
Diagnostics\Configuration\ConfigureSeverity\AllAnalyzersSeverityConfigurationTests.cs (2)
48internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 50return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>(
Diagnostics\Configuration\ConfigureSeverity\CategoryBasedSeverityConfigurationTests.cs (2)
48internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 50return 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)
48internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 50return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>(
Diagnostics\Configuration\ConfigureSeverity\MultipleCodeStyleOptionBasedSeverityConfigurationTests.cs (2)
27internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 29return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>(
Diagnostics\Configuration\ConfigureSeverity\VarForBuiltInTypesSeverityConfigurationTests.cs (1)
26internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (14)
57var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer)); 88var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(ideEngineAnalyzer)); 136analyzer.ThrowOn(typeof(DiagnosticAnalyzer).GetProperties().Single().Name); 144analyzer.ThrowOn(typeof(DiagnosticAnalyzer).GetProperties().Single().Name); 167var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer)); 178private static void AccessSupportedDiagnostics(DiagnosticAnalyzer analyzer) 202var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer)); 258var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer)); 772var vsixAnalyzerReferences = new List<DiagnosticAnalyzer>(vsixAnalyzers.CastArray<DiagnosticAnalyzer>()); 773vsixAnalyzerReferences.AddRange(vsixSuppressors.CastArray<DiagnosticAnalyzer>()); 782var nugetAnalyzerReferences = new List<DiagnosticAnalyzer>(); 785nugetAnalyzerReferences.AddRange(nugetAnalyzers.As<DiagnosticAnalyzer>()); 790nugetAnalyzerReferences.AddRange(nugetSuppressors.As<DiagnosticAnalyzer>());
Diagnostics\FixAllProvider\BatchFixerTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
Diagnostics\GenerateEnumMember\GenerateEnumMemberTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
Diagnostics\GenerateMethod\GenerateConversionTests.cs (1)
27internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
Diagnostics\GenerateMethod\GenerateDeconstructMethodTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
Diagnostics\GenerateMethod\GenerateMethodTests.cs (1)
26internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
Diagnostics\GenerateType\GenerateTypeTests.cs (1)
34internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
Diagnostics\GenerateType\GenerateTypeWithUnboundAnalyzerTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
Diagnostics\MockDiagnosticAnalyzerTests.cs (1)
50internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
Diagnostics\PreferFrameworkType\PreferFrameworkTypeTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
Diagnostics\SpellCheck\SpellCheckTests.cs (1)
29internal override (DiagnosticAnalyzer, CodeFixProvider) 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)
146internal override ImmutableArray<DiagnosticAnalyzer> OtherAnalyzers 147=> ImmutableArray.Create<DiagnosticAnalyzer>(new CSharpCompilerDiagnosticAnalyzer()); 185internal override ImmutableArray<DiagnosticAnalyzer> OtherAnalyzers 186=> ImmutableArray.Create<DiagnosticAnalyzer>(new UserDiagnosticAnalyzer(), new CompilationEndDiagnosticAnalyzer()); 1020internal override ImmutableArray<DiagnosticAnalyzer> OtherAnalyzers 1021=> ImmutableArray.Create<DiagnosticAnalyzer>(new CSharpCompilerDiagnosticAnalyzer(), new UserDiagnosticAnalyzer()); 1317internal override ImmutableArray<DiagnosticAnalyzer> OtherAnalyzers 1318=> ImmutableArray.Create<DiagnosticAnalyzer>(new NonLocalDiagnosticsAnalyzer()); 1343internal override ImmutableArray<DiagnosticAnalyzer> OtherAnalyzers 1344=> 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 (27)
51internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 52=> Tuple.Create<DiagnosticAnalyzer, IConfigurationFixProvider>(null, new CSharpSuppressionCodeFixProvider()); 448var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(new CSharpCompilerDiagnosticAnalyzer())); 667internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 669return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>( 716internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 718return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>( 753internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 755return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>( 826internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 828return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>( 889internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 891return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>( 939internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 941return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>( 974internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 975=> Tuple.Create<DiagnosticAnalyzer, IConfigurationFixProvider>(null, new CSharpSuppressionCodeFixProvider()); 995internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 997return Tuple.Create<DiagnosticAnalyzer, IConfigurationFixProvider>( 1032internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 1034return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>( 1119internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 1121return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>( 2089internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 2091return new Tuple<DiagnosticAnalyzer, IConfigurationFixProvider>( 2467internal override Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace) 2469return 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)
Formatting\CodeCleanupTests.cs (6)
706where TAnalyzer : DiagnosticAnalyzer, new() 713where TAnalyzer : DiagnosticAnalyzer, new() 720where TAnalyzer : DiagnosticAnalyzer, new() 729var analyzer = (DiagnosticAnalyzer)new TAnalyzer(); 738var map = new Dictionary<string, ImmutableArray<DiagnosticAnalyzer>>{
FullyQualify\FullyQualifyTests.cs (1)
29internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
FullyQualify\FullyQualifyUnboundIdentifierTests.cs (1)
29internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
GenerateConstructor\GenerateConstructorTests.cs (1)
29internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
GenerateVariable\GenerateVariableTests.cs (1)
38internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
HideBaseTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
ImplementAbstractClass\ImplementAbstractClassTests.cs (1)
35internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
ImplementAbstractClass\ImplementAbstractClassTests_ThroughMember.cs (1)
29internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
InvokeDelegateWithConditionalAccessTests.cs (1)
25internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
MakeFieldReadonlyTests.cs (1)
30internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
MakeLocalFunctionStatic\PassInCapturedVariablesAsArgumentsCodeFixProviderTests.cs (1)
26internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
MakeLocalFunctionStaticTests.cs (1)
27internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
MakeMethodAsynchronousTests.cs (1)
26internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
MakeRefStructTests.cs (1)
44internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
MakeTypeAbstractTests.cs (1)
25internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
MisplacedUsingDirectivesTests.cs (1)
29internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
NamingStylesTests.cs (1)
33internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
OrderModifiersCompilerErrorTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
OrderModifiersTests.cs (1)
25internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
PopulateSwitchExpressionTests.cs (1)
25internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
PopulateSwitchStatementTests.cs (1)
24internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
QualifyMemberAccessTests.cs (1)
27internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
QuickInfo\DiagnosticAnalyzerQuickInfoSourceTests.cs (1)
214var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(
RemoveDocCommentNodeCodeFixProviderTests.cs (1)
25internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
RemoveInKeywordCodeFixProviderTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
RemoveNewModifierCodeFixProviderTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
RemoveUnnecessaryCast\RemoveUnnecessaryCastTests_AsTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
RemoveUnnecessaryCastTests_FixAllTests.cs (1)
23internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
RemoveUnnecessaryExpressionParenthesesTests.cs (1)
30internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
RemoveUnnecessaryImportsTests_FixAllTests.cs (1)
25internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
RemoveUnnecessaryPatternParenthesesTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
RemoveUnusedLocalFunctionTests.cs (1)
26internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
RemoveUnusedParametersTests.cs (1)
31internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
RemoveUnusedValuesTestsBase.cs (1)
24internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
RemoveUnusedVariable\RemoveUnusedVariableTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
ReplaceDefaultLiteralTests.cs (1)
26internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
SimplifyConditionalTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
SimplifyInterpolationTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
SimplifyThisOrMe\SimplifyThisOrMeTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
SimplifyTypeNames\SimplifyTypeNamesTests.cs (1)
32internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
Squiggles\ErrorSquiggleProducerTests.cs (2)
126var analyzerMap = new Dictionary<string, ImmutableArray<DiagnosticAnalyzer>> 130ImmutableArray.Create<DiagnosticAnalyzer>(
SuggestionTags\SuggestionTagProducerTests.cs (2)
49var analyzerMap = new Dictionary<string, ImmutableArray<DiagnosticAnalyzer>>() 51{ LanguageNames.CSharp, ImmutableArray.Create<DiagnosticAnalyzer>(new CSharpUseObjectInitializerDiagnosticAnalyzer()) }
UpdateProjectToAllowUnsafeTests.cs (1)
27internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UpgradeProjectTests.cs (1)
31internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseAutoPropertyTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseCoalesceExpressionForNullableTernaryConditionalCheckTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseCoalesceExpressionForTernaryConditionalCheckTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseConditionalExpressionForReturnTests.cs (1)
29internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseExplicitTypeForConstTests.cs (1)
24internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseExplicitTypeTests.cs (1)
28internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseExpressionBodyForLambdasAnalyzerTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseImplicitTypeTests.cs (1)
29internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseInferredMemberNameTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseInterpolatedVerbatimStringCodeFixTests.cs (1)
25internal override (DiagnosticAnalyzer?, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseIsNullCheckForCastAndEqualityOperatorTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseIsNullCheckForReferenceEqualsTests.cs (1)
30internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseLocalFunctionTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzerTests.cs (1)
37internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzerTests.cs (1)
27internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseSimpleUsingStatementTests.cs (1)
29internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseSystemHashCodeTests.cs (1)
26internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
UseThrowExpressionTests.cs (1)
29internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
ValidateFormatStringTests.cs (1)
25internal override (DiagnosticAnalyzer, CodeFixProvider?) CreateDiagnosticProviderAndFixer(Workspace workspace)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (187)
Diagnostics\DiagnosticAnalyzerTests.cs (108)
81.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new ComplainAboutX() }, null, null, 113.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new ComplainAboutX() }, null, null, 173.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new ComplainAboutX() }, null, null, 206.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new ComplainAboutX() }, null, null, 228.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new ImplicitlyDeclaredSymbolAnalyzer() }); 289.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new SyntaxAndSymbolAnalyzer() }, null, null, 554var analyzers = new DiagnosticAnalyzer[] { new CodeBlockOrSyntaxNodeAnalyzer(isCodeBlockAnalyzer: true) }; 574var analyzers = new DiagnosticAnalyzer[] { new CodeBlockOrSyntaxNodeAnalyzer(isCodeBlockAnalyzer: true) }; 594var analyzers = new DiagnosticAnalyzer[] { new CodeBlockOrSyntaxNodeAnalyzer(isCodeBlockAnalyzer: true) }; 617var analyzers = new DiagnosticAnalyzer[] { new CodeBlockOrSyntaxNodeAnalyzer(isCodeBlockAnalyzer: false) }; 637var analyzers = new DiagnosticAnalyzer[] { new MethodSymbolAnalyzer() }; 680var analyzers = new DiagnosticAnalyzer[] { new FieldDeclarationAnalyzer() }; 698var analyzers = new DiagnosticAnalyzer[] { new FieldDeclarationAnalyzer() }; 852var analyzers = new DiagnosticAnalyzer[] { analyzer }; 910var analyzers = new DiagnosticAnalyzer[] { new AnalyzerWithInvalidDiagnosticId() }; 949var analyzers = new DiagnosticAnalyzer[] { new AnalyzerWithNullDescriptor() }; 985var analyzers = new DiagnosticAnalyzer[] { new AnalyzerWithCSharpCompilerDiagnosticId() }; 996var analyzers = new DiagnosticAnalyzer[] { new AnalyzerWithBasicCompilerDiagnosticId() }; 1019var analyzers = new DiagnosticAnalyzer[] { analyzer }; 1118var analyzers = new DiagnosticAnalyzer[] { analyzer }; 1131var analyzers = new DiagnosticAnalyzer[] { new NotConfigurableDiagnosticAnalyzer() }; 1165var analyzers = new DiagnosticAnalyzer[] { new CodeBlockActionAnalyzer() }; 1184var analyzers = new DiagnosticAnalyzer[] { new CodeBlockActionAnalyzer(onlyStatelessAction: true) }; 1214private void TestGenericNameCore(string source, params DiagnosticAnalyzer[] analyzers) 1228var analyzers = new DiagnosticAnalyzer[] { new CSharpNamespaceDeclarationAnalyzer() }; 1268var analyzers = new DiagnosticAnalyzer[] { new AnalyzerWithNoSupportedDiagnostics() }; 1361var analyzers = new DiagnosticAnalyzer[] { new CSharpCodeBlockObjectCreationAnalyzer() }; 1394var analyzers = new DiagnosticAnalyzer[] { new NonConcurrentAnalyzer() }; 1426var analyzers = new DiagnosticAnalyzer[] { new ConcurrentAnalyzer(typeNames) }; 1439analyzers = new DiagnosticAnalyzer[] { new ConcurrentAnalyzer(typeNames), new NonConcurrentAnalyzer() }; 1616var analyzers = new DiagnosticAnalyzer[] { new GeneratedCodeAnalyzer2() }; 1686.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new OwningSymbolTestAnalyzer() }, null, null, 1700var analyzers = new DiagnosticAnalyzer[] { new GeneratedCodeAnalyzer(generatedCodeAnalysisFlagsOpt, testIsGeneratedCodeInCallbacks) }; 1706var analyzers = new DiagnosticAnalyzer[] { new GeneratedCodeAnalyzer(generatedCodeAnalysisFlagsOpt, testIsGeneratedCodeInCallbacks: true) }; 1888var analyzers = new DiagnosticAnalyzer[] { new EnsureNoMergedNamespaceSymbolAnalyzer() }; 1913var analyzers = new DiagnosticAnalyzer[] { new SharedStateAnalyzer() }; 1946var analyzers = new DiagnosticAnalyzer[] { new AnalyzerForParameters() }; 1967var analyzers = new DiagnosticAnalyzer[] { new AnalyzerForParameters() }; 1990var analyzers = new DiagnosticAnalyzer[] { new AnalyzerForParameters() }; 2011var analyzers = new DiagnosticAnalyzer[] { new AnalyzerForParameters() }; 2036var analyzers = new DiagnosticAnalyzer[] { new AnalyzerForParameters() }; 2056var analyzers = new DiagnosticAnalyzer[] { new AnalyzerForParameters() }; 2075var analyzers = new DiagnosticAnalyzer[] { new AnalyzerForParameters() }; 2098var analyzers = new DiagnosticAnalyzer[] { new AnalyzerForParameters() }; 2119var analyzers = new DiagnosticAnalyzer[] { new AnalyzerForParameters() }; 2145var analyzers = new DiagnosticAnalyzer[] { new AnalyzerForParameters() }; 2178var analyzers = new DiagnosticAnalyzer[] { new GeneratedCodeAnalyzer(GeneratedCodeAnalysisFlags.None) }; 2186analyzers = new DiagnosticAnalyzer[] { new GeneratedCodeAnalyzer(GeneratedCodeAnalysisFlags.Analyze) }; 2194analyzers = new DiagnosticAnalyzer[] { new GeneratedCodeAnalyzer(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics) }; 2246var analyzers = new DiagnosticAnalyzer[] { new GeneratedCodeSyntaxAndOperationAnalyzer(GeneratedCodeAnalysisFlags.None, syntaxKinds, operationKinds) }; 2254analyzers = new DiagnosticAnalyzer[] { new GeneratedCodeSyntaxAndOperationAnalyzer(GeneratedCodeAnalysisFlags.Analyze, syntaxKinds, operationKinds) }; 2262analyzers = new DiagnosticAnalyzer[] { new GeneratedCodeSyntaxAndOperationAnalyzer(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics, syntaxKinds, operationKinds) }; 2477var analyzers = new DiagnosticAnalyzer[] { new FieldReferenceOperationAnalyzer(doOperationBlockAnalysis) }; 2544var analyzers = new DiagnosticAnalyzer[] { new FieldReferenceOperationAnalyzer(doOperationBlockAnalysis) }; 2573var analyzers = new DiagnosticAnalyzer[] { new FieldReferenceOperationAnalyzer(doOperationBlockAnalysis) }; 2592var analyzers = new DiagnosticAnalyzer[] { new MethodOrConstructorBodyOperationAnalyzer() }; 2610var analyzers = new DiagnosticAnalyzer[] { new MethodOrConstructorBodyOperationAnalyzer() }; 2631var analyzers = new DiagnosticAnalyzer[] { new MethodOrConstructorBodyOperationAnalyzer() }; 2656var analyzers = new DiagnosticAnalyzer[] { new MethodOrConstructorBodyOperationAnalyzer() }; 2732compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { analyzer }, 2741compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { analyzer }, 2750compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { analyzer }, 2757compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { analyzer }, 2776TestSymbolStartAnalyzerCore(new DiagnosticAnalyzer[] { analyzer }, diagnostics); 2779private static void TestSymbolStartAnalyzerCore(DiagnosticAnalyzer[] analyzers, params DiagnosticDescription[] diagnostics) 2931TestSymbolStartAnalyzerCore(new DiagnosticAnalyzer[] { analyzer1, analyzer2 }, 2957TestSymbolStartAnalyzerCore(new DiagnosticAnalyzer[] { analyzer1, analyzer2 }, 2991var analyzers = new DiagnosticAnalyzer[symbolKinds.Length]; 3085var analyzers = new DiagnosticAnalyzer[symbolKinds.Length]; 3145var analyzers = new DiagnosticAnalyzer[symbolKinds.Length]; 3190var analyzers = new DiagnosticAnalyzer[] { new SymbolStartAnalyzer(topLevelAction: false, SymbolKind.NamedType, OperationKind.Invocation) }; 3222var analyzers = new DiagnosticAnalyzer[] { new SymbolStartAnalyzer(topLevelAction: true, SymbolKind.NamedType, OperationKind.FieldReference) }; 3256var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer1, analyzer2)); 3264var tree1SemanticDiagnostics = await compilationWithAnalyzers.GetAnalyzerSemanticDiagnosticsAsync(semanticModel1, filterSpan: null, ImmutableArray.Create<DiagnosticAnalyzer>(analyzer1), CancellationToken.None); 3283compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3298compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3307compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3326compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3342compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3351compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3360compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3379compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3394compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3403compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3412compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3430compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3445compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }); 3451compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3466compilation.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { namedTypeAnalyzer }, 3504var analyzers = new DiagnosticAnalyzer[] { new RegisterOperationBlockAndOperationActionAnalyzer() }; 3533var analyzers = new DiagnosticAnalyzer[] { new RegisterOperationBlockAndOperationActionAnalyzer() }; 3560var analyzers = new DiagnosticAnalyzer[] { new RegisterOperationBlockAndOperationActionAnalyzer() }; 3594var allAnalyzers = ImmutableArray.Create<DiagnosticAnalyzer>(analyzer1, analyzer2); 3602var analyzersToQuery = singleAnalyzer ? ImmutableArray.Create<DiagnosticAnalyzer>(analyzer1) : allAnalyzers; 3619var diagnostics = diagnosticsMap.TryGetValue(tree1, out var value) ? value : ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>.Empty; 3621foreach (var analyzer in allAnalyzers) 3661var allAnalyzers = ImmutableArray.Create<DiagnosticAnalyzer>(analyzer1, analyzer2); 3721var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(analyzer); 3795var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(analyzer); 3837var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(analyzer1, analyzer2); 3847var singleAnalyzerArray = ImmutableArray.Create<DiagnosticAnalyzer>(analyzer1); 3865ImmutableArray<DiagnosticAnalyzer> analyzers, 3906ImmutableArray<DiagnosticAnalyzer> analyzers, 3917foreach (var analyzer in analyzers) 3929static ImmutableArray<Diagnostic> getReportedDiagnostics(AnalysisResult analysisResult, DiagnosticAnalyzer analyzer, AdditionalText additionalFile) 4005var analyzers = new DiagnosticAnalyzer[] { new RecordDeclarationAnalyzer() }; 4051.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { analyzer }, null, null, 4075var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer));
Diagnostics\DiagnosticSuppressorTests.cs (28)
27DiagnosticAnalyzer[] analyzers, 33DiagnosticAnalyzer[] analyzers, 39DiagnosticAnalyzer[] analyzers) 64var analyzers = new DiagnosticAnalyzer[] { new DiagnosticSuppressorForId("CS1522") }; 89var analyzers = new DiagnosticAnalyzer[] { new DiagnosticSuppressorForId("CS0169") }; 112var analyzers = new DiagnosticAnalyzer[] { new DiagnosticSuppressorForId("CS1001") }; 133var analyzers = new DiagnosticAnalyzer[] { new DiagnosticSuppressorForId("CS0246") }; 150VerifyAnalyzerDiagnostics(compilation, new DiagnosticAnalyzer[] { analyzer }, expectedDiagnostics); 152var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, new DiagnosticSuppressorForId(analyzer.Descriptor.Id) }; 170VerifyAnalyzerDiagnostics(compilation, new DiagnosticAnalyzer[] { analyzer }, expectedDiagnostic); 174var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, new DiagnosticSuppressorForId(analyzer.Descriptor.Id), new DiagnosticSuppressorForId(analyzer.Descriptor.Id) }; 179analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, new DiagnosticSuppressorForId(analyzer.Descriptor.Id, suppressionId: "SPR0001"), new DiagnosticSuppressorForId(analyzer.Descriptor.Id, suppressionId: "SPR0002") }; 195VerifyAnalyzerDiagnostics(compilation, new DiagnosticAnalyzer[] { analyzer }, 201var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, suppressor1, suppressor2 }; 218VerifyAnalyzerDiagnostics(compilation, new DiagnosticAnalyzer[] { analyzer }, expectedDiagnostic); 221var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, new DiagnosticSuppressorForId(analyzer.Descriptor.Id, suppressionId) }; 268var analyzersWithoutSuppressor = new DiagnosticAnalyzer[] { analyzer }; 269var analyzersWithSuppressor = new DiagnosticAnalyzer[] { analyzer, suppressor }; 321var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, suppressor }; 365var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, suppressor }; 393var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, suppressor }; 446var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, suppressor }; 499var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, suppressor }; 548VerifyAnalyzerDiagnostics(compilation, new DiagnosticAnalyzer[] { analyzer }, expectedDiagnostic); 552var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, suppressor }; 561analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, suppressor, suppressor2 }; 584VerifyAnalyzerDiagnostics(compilation, new DiagnosticAnalyzer[] { analyzer }, expectedDiagnostic); 588var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, suppressor };
Diagnostics\GetDiagnosticsTests.cs (12)
465var analyzers = new DiagnosticAnalyzer[] { new CSharpCompilerDiagnosticAnalyzer() }; 491var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(new CSharpCompilerDiagnosticAnalyzer()); 538static async Task verifyDiagnosticsAsync(Compilation compilation, DiagnosticAnalyzer analyzer, (string key, string value)? options) 601var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(new CSharpCompilerDiagnosticAnalyzer()); 654var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(new SymbolStartAnalyzer(topLevelAction: false, SymbolKind.NamedType, OperationKind.VariableDeclaration)); 683var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(analyzer); 723var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(new CSharpCompilerDiagnosticAnalyzer()); 777var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer), AnalyzerOptions.Empty); 1003var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(compilerAnalyzer), AnalyzerOptions.Empty); 1050var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(new CSharpCompilerDiagnosticAnalyzer()); 1069analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(new CSharpCompilerDiagnosticAnalyzer(), suppressor); 1131var 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)
UseExpressionBodyHelper`1.cs (1)
22/// requirements with <see cref="DiagnosticAnalyzer"/> and "CodeRefactoringProvider".
Microsoft.CodeAnalysis.CSharp.Test.Utilities (5)
MockCSharpCompiler.cs (5)
19private readonly ImmutableArray<DiagnosticAnalyzer> _analyzers; 24public MockCSharpCompiler(string responseFile, string workingDirectory, string[] args, ImmutableArray<DiagnosticAnalyzer> analyzers = default, ImmutableArray<ISourceGenerator> generators = default, AnalyzerAssemblyLoader loader = null) 29public MockCSharpCompiler(string responseFile, BuildPaths buildPaths, string[] args, ImmutableArray<DiagnosticAnalyzer> analyzers = default, ImmutableArray<ISourceGenerator> generators = default, AnalyzerAssemblyLoader loader = null, GeneratorDriverCache driverCache = null) 42out ImmutableArray<DiagnosticAnalyzer> analyzers, 59out ImmutableArray<DiagnosticAnalyzer> analyzers,
Microsoft.CodeAnalysis.EditorFeatures (7)
EditorConfigSettings\DataProvider\Analyzer\AnalyzerSettingsProvider.cs (7)
42IEnumerable<DiagnosticAnalyzer> csharpAnalyzers = analyzerReference.GetAnalyzers(LanguageNames.CSharp); 43IEnumerable<DiagnosticAnalyzer> visualBasicAnalyzers = analyzerReference.GetAnalyzers(LanguageNames.VisualBasic); 52IEnumerable<AnalyzerSetting> ToAnalyzerSetting(IEnumerable<DiagnosticAnalyzer> analyzers, 70private class DiagnosticAnalyzerComparer : IEqualityComparer<DiagnosticAnalyzer> 74public bool Equals(DiagnosticAnalyzer? x, DiagnosticAnalyzer? y) 85public int GetHashCode(DiagnosticAnalyzer obj) => obj.GetAnalyzerIdAndVersion().GetHashCode();
Microsoft.CodeAnalysis.EditorFeatures.DiagnosticsTests.Utilities (19)
CodeActions\CodeFixVerifierHelper.cs (4)
24public static void VerifyStandardProperty(DiagnosticAnalyzer analyzer, AnalyzerProperty property) 45private static void VerifyMessageTitle(DiagnosticAnalyzer analyzer) 59private static void VerifyMessageDescription(DiagnosticAnalyzer analyzer) 89private static void VerifyMessageHelpLinkUri(DiagnosticAnalyzer analyzer)
CodeActions\CSharpCodeFixVerifier`2.cs (1)
15where TAnalyzer : DiagnosticAnalyzer, new()
CodeActions\CSharpCodeFixVerifier`2+Test.cs (1)
29where TAnalyzer : DiagnosticAnalyzer, new()
CodeActions\VisualBasicCodeFixVerifier`2.cs (1)
15where TAnalyzer : DiagnosticAnalyzer, new()
CodeActions\VisualBasicCodeFixVerifier`2+Test.cs (1)
26where TAnalyzer : DiagnosticAnalyzer, new()
Diagnostics\AbstractDiagnosticProviderBasedUserDiagnosticTest.cs (7)
33private readonly ConcurrentDictionary<Workspace, (DiagnosticAnalyzer, CodeFixProvider)> _analyzerAndFixerMap = new(); 40internal abstract (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace); 42internal virtual (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace, TestParameters parameters) 45private (DiagnosticAnalyzer, CodeFixProvider) GetOrCreateDiagnosticProviderAndFixer( 72var diagnosticAnalyzer = CreateDiagnosticProviderAndFixer(workspace).Item1; 96var diagnosticAnalyzer = CreateDiagnosticProviderAndFixer(workspace).Item1; 119var diagnosticAnalyzer = CreateDiagnosticProviderAndFixer(workspace).Item1;
Diagnostics\AbstractSuppressionAllCodeTests.cs (1)
74var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer));
Diagnostics\AbstractSuppressionDiagnosticTest.cs (1)
40internal abstract Tuple<DiagnosticAnalyzer, IConfigurationFixProvider> CreateDiagnosticProviderAndFixer(Workspace workspace);
Diagnostics\AbstractUnncessarySuppressionDiagnosticTest.cs (1)
30internal abstract ImmutableArray<DiagnosticAnalyzer> OtherAnalyzers { get; }
Diagnostics\AbstractUserDiagnosticTest.cs (1)
88protected static void AddAnalyzerToWorkspace(Workspace workspace, DiagnosticAnalyzer analyzer, TestParameters parameters)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (9)
Diagnostics\DiagnosticTaggerWrapper.cs (1)
38IReadOnlyDictionary<string, ImmutableArray<DiagnosticAnalyzer>>? analyzerMap = null,
Diagnostics\TestAnalyzerReferenceByLanguage.cs (5)
13private readonly IReadOnlyDictionary<string, ImmutableArray<DiagnosticAnalyzer>> _analyzersMap; 15public TestAnalyzerReferenceByLanguage(IReadOnlyDictionary<string, ImmutableArray<DiagnosticAnalyzer>> analyzersMap, string? fullPath = null) 25public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzersForAllLanguages() 28public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzers(string language) 35return ImmutableArray<DiagnosticAnalyzer>.Empty;
Squiggles\SquiggleUtilities.cs (1)
33IReadOnlyDictionary<string, ImmutableArray<DiagnosticAnalyzer>> analyzerMap = null)
Squiggles\TestDiagnosticTagProducer.cs (1)
30IReadOnlyDictionary<string, ImmutableArray<DiagnosticAnalyzer>> analyzerMap = null)
Workspaces\TestWorkspace_XmlConsumption.cs (1)
1027ImmutableArray<DiagnosticAnalyzer>.Empty,
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (50)
CodeFixes\CodeFixServiceTests.cs (15)
84ImmutableArray.Create<DiagnosticAnalyzer>( 108ImmutableArray.Create<DiagnosticAnalyzer>( 138var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(analyzerWithFix, analyzerWithoutFix); 174var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(documentDiagnosticAnalyzer); 254private static async Task<ImmutableArray<CodeFixCollection>> GetAddedFixesAsync(CodeFixProvider codefix, DiagnosticAnalyzer diagnosticAnalyzer, bool exception = false, bool throwExceptionInFixerCreation = false) 404public readonly ImmutableArray<DiagnosticAnalyzer> Analyzers; 407private static readonly ImmutableArray<DiagnosticAnalyzer> s_defaultAnalyzers = ImmutableArray.Create<DiagnosticAnalyzer>(new MockDiagnosticAnalyzer()); 409public MockAnalyzerReference(ImmutableArray<CodeFixProvider> fixers, ImmutableArray<DiagnosticAnalyzer> analyzers) 415public MockAnalyzerReference(CodeFixProvider? fixer, ImmutableArray<DiagnosticAnalyzer> analyzers) 455public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzers(string language) 458public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzersForAllLanguages() 459=> ImmutableArray<DiagnosticAnalyzer>.Empty; 709var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(diagnosticAnalyzer); 810var analyzerReference = new MockAnalyzerReference(fixers, ImmutableArray.Create<DiagnosticAnalyzer>(analyzer));
CodeRefactorings\CodeRefactoringServiceTest.cs (4)
153public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzers(string language) 154=> ImmutableArray<DiagnosticAnalyzer>.Empty; 156public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzersForAllLanguages() 157=> ImmutableArray<DiagnosticAnalyzer>.Empty;
Completion\CompletionServiceTests.cs (4)
86public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzers(string language) 87=> ImmutableArray<DiagnosticAnalyzer>.Empty; 89public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzersForAllLanguages() 90=> ImmutableArray<DiagnosticAnalyzer>.Empty;
Diagnostics\DiagnosticAnalyzerServiceTests.cs (17)
71var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(new Analyzer())); 102var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(new Analyzer())); 120var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(new Analyzer())); 135var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(new CSharpCompilerDiagnosticAnalyzer())); 151var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(new CSharpCompilerDiagnosticAnalyzer())); 170var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(new DisabledByDefaultAnalyzer())); 288var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(new OpenFileOnlyAnalyzer())); 347var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(new NoNameAnalyzer())); 421var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>( 468var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>( 562private static AdhocWorkspace CreateWorkspaceWithProjectAndAnalyzer(DiagnosticAnalyzer analyzer) 637var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(analyzer); 739var analyzers = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(); 819var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>( 986var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer)); 1062var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer1, analyzer2)); 1108var analyzerReference = new AnalyzerImageReference(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer));
Diagnostics\DiagnosticsClassificationTaggerProviderTests.cs (4)
36var analyzerMap = new Dictionary<string, ImmutableArray<DiagnosticAnalyzer>> 38{ LanguageNames.CSharp, ImmutableArray.Create<DiagnosticAnalyzer>(analyzer) } 128var analyzerMap = new Dictionary<string, ImmutableArray<DiagnosticAnalyzer>> 130{ LanguageNames.CSharp, ImmutableArray.Create<DiagnosticAnalyzer>(analyzer) }
Diagnostics\DiagnosticsSquiggleTaggerProviderTests.cs (2)
43var analyzerMap = new Dictionary<string, ImmutableArray<DiagnosticAnalyzer>> 45{ LanguageNames.CSharp, ImmutableArray.Create<DiagnosticAnalyzer>(analyzer) }
Diagnostics\IDEDiagnosticIDConfigurationTests.cs (1)
36foreach (var analyzer in analyzerReference.GetAnalyzers(languageName))
Diagnostics\SuppressMessageAttributeWorkspaceTests.cs (1)
58protected override async Task VerifyAsync(string source, string language, DiagnosticAnalyzer[] analyzers, DiagnosticDescription[] expectedDiagnostics, string rootNamespace = null)
Preview\PreviewWorkspaceTests.cs (2)
239var analyzers = ImmutableArray.Create<DiagnosticAnalyzer>(new CommonDiagnosticAnalyzers.NotConfigurableDiagnosticAnalyzer()); 264private static void ExecuteAnalyzers(PreviewWorkspace previewWorkspace, ImmutableArray<DiagnosticAnalyzer> analyzers)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (60)
CodeFixes\CodeFixServiceTests.vb (2)
52Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(workspaceDiagnosticAnalyzer)) 131Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(workspaceDiagnosticAnalyzer))
Diagnostics\AbstractCrossLanguageUserDiagnosticTest.vb (2)
37Friend MustOverride Function CreateDiagnosticProviderAndFixer(workspace As Workspace, language As String) As (DiagnosticAnalyzer, CodeFixProvider) 136Public 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)
23Friend 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)
290NoCompilationConstants.LanguageName, ImmutableArray.Create(Of DiagnosticAnalyzer)(New NoCompilationDocumentDiagnosticAnalyzer()))
Diagnostics\DiagnosticServiceTests.vb (46)
75Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(workspaceDiagnosticAnalyzer)) 99Dim projectAnalyzers1 = ImmutableArray.Create(Of DiagnosticAnalyzer)(projectDiagnosticAnalyzer1) 115Dim projectAnalyzers2 = ImmutableArray.Create(Of DiagnosticAnalyzer)(projectDiagnosticAnalyzer2) 181Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(workspaceDiagnosticAnalyzer)) 192Dim projectAnalyzersEmpty = ImmutableArray(Of DiagnosticAnalyzer).Empty 222ImmutableArray.Create(Of DiagnosticAnalyzer)(New TestDiagnosticAnalyzer1(0)), display:=referenceName) 231ImmutableArray.Create(Of DiagnosticAnalyzer)(New TestDiagnosticAnalyzer1(1)), display:=referenceName) 263Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(workspaceDiagnosticAnalyzer)) 327Dim analyzer1 As DiagnosticAnalyzer = New TestDiagnosticAnalyzer1(1) 328Dim analyzer2 As DiagnosticAnalyzer = New TestDiagnosticAnalyzer2(2) 375Dim analyzersMap = New Dictionary(Of String, ImmutableArray(Of DiagnosticAnalyzer)) From 377{LanguageNames.CSharp, ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer1)}, 378{LanguageNames.VisualBasic, ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer2)} 460Dim analyzerReference1 = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 461Dim analyzerReference2 = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 484Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 520Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 594Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 630Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 661Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 696Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 773Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 810Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 869Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 894Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 933Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 968Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 1006Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 1030Await TestDiagnosticsReportedOnAllPartialDefinitionsCoreAsync(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 1042Await TestDiagnosticsReportedOnAllPartialDefinitionsCoreAsync(ImmutableArray.Create(Of DiagnosticAnalyzer)(dummyAnalyzer, analyzer)) 1046Private Shared Async Function TestDiagnosticsReportedOnAllPartialDefinitionsCoreAsync(analyzers As ImmutableArray(Of DiagnosticAnalyzer)) As Task 1113Dim analyzer As DiagnosticAnalyzer = New CodeBlockOrSyntaxNodeAnalyzer(isCodeBlockAnalyzer:=True) 1157Dim analyzer As DiagnosticAnalyzer = New CodeBlockOrSyntaxNodeAnalyzer(isCodeBlockAnalyzer:=False) 1201Dim analyzer As DiagnosticAnalyzer = New MethodSymbolAnalyzer 1255Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 1319Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 1367Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 1434Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 1990Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 2045Private Shared Async Function TestGenericNameCoreAsync(test As XElement, expectedMessage As String, expectedId As String, ParamArray analyzers As DiagnosticAnalyzer()) As Task 2119Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 2159Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 2262Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 2303Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 2361Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(compilerAnalyzer, syntaxAnalyzer, semanticAnalyzer)) 2432Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(compilerAnalyzer, syntaxAnalyzer, semanticAnalyzer))
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 (34)
AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (5)
86Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnostics, 392Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnostics, 396using var _1 = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(out var analyzersBuilder); 402foreach (var analyzer in compilationWithAnalyzers.Analyzers) 481static void AddAllDiagnostics(ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> diagnostics, ArrayBuilder<Diagnostic> reportedDiagnostics)
Diagnostics\AbstractHostDiagnosticUpdateSource.cs (12)
21private ImmutableDictionary<DiagnosticAnalyzer, ImmutableHashSet<DiagnosticData>> _analyzerHostDiagnosticsMap = 22ImmutableDictionary<DiagnosticAnalyzer, ImmutableHashSet<DiagnosticData>>.Empty; 37public void ReportAnalyzerDiagnostic(DiagnosticAnalyzer analyzer, Diagnostic diagnostic, ProjectId? projectId) 54public void ReportAnalyzerDiagnostic(DiagnosticAnalyzer analyzer, DiagnosticData diagnosticData, Project? project) 85public void ClearAnalyzerDiagnostics(ImmutableArray<DiagnosticAnalyzer> analyzers, ProjectId projectId) 87foreach (var analyzer in analyzers) 101private void ClearAnalyzerDiagnostics(DiagnosticAnalyzer analyzer, ProjectId projectId) 132private DiagnosticsUpdatedArgs MakeCreatedArgs(DiagnosticAnalyzer analyzer, ImmutableHashSet<DiagnosticData> items, Project? project) 138private DiagnosticsUpdatedArgs MakeRemovedArgs(DiagnosticAnalyzer analyzer, Project? project) 144private HostArgsId CreateId(DiagnosticAnalyzer analyzer, Project? project) => new(this, analyzer, project?.Id); 159internal ImmutableHashSet<DiagnosticData> GetReportedDiagnostics(DiagnosticAnalyzer analyzer) 175public HostArgsId(AbstractHostDiagnosticUpdateSource source, DiagnosticAnalyzer analyzer, ProjectId? projectId) : base(analyzer)
Diagnostics\AnalyzerUpdateArgsId.cs (3)
12internal class AnalyzerUpdateArgsId : BuildToolId.Base<DiagnosticAnalyzer>, ISupportLiveUpdate 14public DiagnosticAnalyzer Analyzer => _Field1!; 16protected AnalyzerUpdateArgsId(DiagnosticAnalyzer analyzer)
Diagnostics\DiagnosticAnalyzerExtensions.cs (9)
18public static bool IsWorkspaceDiagnosticAnalyzer(this DiagnosticAnalyzer analyzer) 24public static bool IsBuiltInAnalyzer(this DiagnosticAnalyzer analyzer) 27public static bool IsOpenFileOnly(this DiagnosticAnalyzer analyzer, SimplifierOptions? options) 37public static (string analyzerId, VersionStamp version) GetAnalyzerIdAndVersion(this DiagnosticAnalyzer analyzer) 55public static string GetAnalyzerAssemblyName(this DiagnosticAnalyzer analyzer) 58public static void AppendAnalyzerMap(this Dictionary<string, DiagnosticAnalyzer> analyzerMap, IEnumerable<DiagnosticAnalyzer> analyzers) 60foreach (var analyzer in analyzers) 67public static IEnumerable<AnalyzerPerformanceInfo> ToAnalyzerPerformanceInfo(this IDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo> analysisResult, DiagnosticAnalyzerInfoCache analyzerInfo)
Diagnostics\DiagnosticAnalyzerTelemetry.cs (1)
76public void UpdateAnalyzerActionsTelemetry(DiagnosticAnalyzer analyzer, AnalyzerTelemetryInfo analyzerTelemetryInfo, bool isTelemetryCollectionAllowed)
Diagnostics\LiveDiagnosticUpdateArgsId.cs (1)
16public LiveDiagnosticUpdateArgsId(DiagnosticAnalyzer analyzer, object projectOrDocumentId, AnalysisKind kind, string analyzerPackageName)
SyncNamespaces\AbstractSyncNamespacesService.cs (3)
40var diagnosticAnalyzers = ImmutableArray.Create<DiagnosticAnalyzer>(DiagnosticAnalyzer); 58ImmutableArray<DiagnosticAnalyzer> diagnosticAnalyzers, 74ImmutableArray<DiagnosticAnalyzer> diagnosticAnalyzers,
Microsoft.CodeAnalysis.LanguageServer.Protocol (133)
Features\Diagnostics\DefaultDiagnosticAnalyzerService.cs (3)
170foreach (var analyzer in analyzers) 176private static ImmutableArray<DiagnosticAnalyzer> GetAnalyzers(HostDiagnosticAnalyzers hostAnalyzers, Project project) 179var compilerAnalyzer = hostAnalyzers.GetCompilerDiagnosticAnalyzer(project.Language);
Features\Diagnostics\DocumentAnalysisExecutor.cs (9)
33private readonly ImmutableArray<DiagnosticAnalyzer> _compilationBasedAnalyzersInAnalysisScope; 35private ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>? _lazySyntaxDiagnostics; 36private ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>? _lazySemanticDiagnostics; 54: ImmutableArray<DiagnosticAnalyzer>.Empty; 65public async Task<IEnumerable<DiagnosticData>> ComputeDiagnosticsAsync(DiagnosticAnalyzer analyzer, CancellationToken cancellationToken) 178private async Task<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>> GetAnalysisResultAsync(DocumentAnalysisScope analysisScope, CancellationToken cancellationToken) 195private async Task<ImmutableArray<DiagnosticData>> GetCompilerAnalyzerDiagnosticsAsync(DiagnosticAnalyzer analyzer, TextSpan? span, CancellationToken cancellationToken) 212private async Task<ImmutableArray<DiagnosticData>> GetSyntaxDiagnosticsAsync(DiagnosticAnalyzer analyzer, bool isCompilerAnalyzer, CancellationToken cancellationToken) 245private async Task<ImmutableArray<DiagnosticData>> GetSemanticDiagnosticsAsync(DiagnosticAnalyzer analyzer, bool isCompilerAnalyzer, CancellationToken cancellationToken)
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (3)
55internal static Diagnostic CreateAnalyzerExceptionDiagnostic(DiagnosticAnalyzer analyzer, Exception e) 133IEnumerable<DiagnosticAnalyzer> analyzers, 200public static bool IsAnalyzerEnabledForProject(DiagnosticAnalyzer analyzer, Project project, IGlobalOptionService globalOptions)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.AnalysisData.cs (9)
83public readonly ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> Result; 88public readonly ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>? OldResult; 90public ProjectAnalysisData(ProjectId projectId, VersionStamp version, ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> result) 102ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> oldResult, 103ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> newResult) 109public DiagnosticAnalysisResult GetResult(DiagnosticAnalyzer analyzer) 112public bool TryGetResult(DiagnosticAnalyzer analyzer, out DiagnosticAnalysisResult result) 119var builder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, DiagnosticAnalysisResult>(); 144return new ProjectAnalysisData(project.Id, VersionStamp.Default, ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>.Empty);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.cs (4)
227private static DiagnosticAnalysisResult GetResultOrEmpty(ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> map, DiagnosticAnalyzer analyzer, ProjectId projectId, VersionStamp version) 245internal IEnumerable<DiagnosticAnalyzer> GetAnalyzersTestOnly(Project project) 248private static string GetDocumentLogMessage(string title, TextDocument document, DiagnosticAnalyzer analyzer)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.Executor.cs (25)
71DiagnosticAnalyzer analyzer, 219var results = ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>.Empty; 268foreach (var analyzer in compilationWithAnalyzers.Analyzers) 279private static async Task<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>> RemoveCompilerSemanticErrorsIfProjectNotLoadedAsync( 280ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> result, Project project, CancellationToken cancellationToken) 289var compilerAnalyzer = project.Solution.State.Analyzers.GetCompilerDiagnosticAnalyzer(project.Language); 314private async Task<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>> ComputeDiagnosticsAsync( 315CompilationWithAnalyzers? compilationWithAnalyzers, Project project, ImmutableArray<DiagnosticAnalyzer> ideAnalyzers, bool forcedAnalysis, CancellationToken cancellationToken) 319var result = ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>.Empty; 343private async Task<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>> ComputeDiagnosticsAsync( 345ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> existing, CancellationToken cancellationToken) 384private static ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> MergeExistingDiagnostics( 385VersionStamp version, ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> existing, ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> result) 408ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> existing, IdeAnalyzerOptions ideOptions, 409out ImmutableArray<DiagnosticAnalyzer> analyzers) 414var builder = ImmutableArray.CreateBuilder<DiagnosticAnalyzer>(); 415foreach (var analyzer in existingAnalyzers) 440private static async Task<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>> MergeProjectDiagnosticAnalyzerDiagnosticsAsync( 442ImmutableArray<DiagnosticAnalyzer> ideAnalyzers, 444ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> result, 453foreach (var analyzer in ideAnalyzers) 500private static async Task<(ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> results, ImmutableHashSet<Document>? failedDocuments)> UpdateWithDocumentLoadAndGeneratorFailuresAsync( 501ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> results, 549private void UpdateAnalyzerTelemetryData(ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo> telemetry)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.IncrementalMemberEditAnalyzer.cs (17)
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, 78using var _1 = ArrayBuilder<(DiagnosticAnalyzer, DocumentAnalysisData)>.GetInstance(out var spanBasedAnalyzers); 79using var _2 = ArrayBuilder<(DiagnosticAnalyzer, DocumentAnalysisData)>.GetInstance(out var documentBasedAnalyzers); 80(DiagnosticAnalyzer analyzer, DocumentAnalysisData existingData, bool spanBased)? compilerAnalyzerData = null; 115using var _ = PooledDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>>.GetInstance(out var builder); 129(DiagnosticAnalyzer analyzer, DocumentAnalysisData existingData, bool spanBased)? compilerAnalyzerData, 131PooledDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>> builder) 144ArrayBuilder<(DiagnosticAnalyzer, DocumentAnalysisData)> analyzersAndExistingData, 146PooledDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>> builder) 156ArrayBuilder<(DiagnosticAnalyzer, DocumentAnalysisData)> analyzersAndExistingData, 158PooledDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>> builder) 169IEnumerable<(DiagnosticAnalyzer, DocumentAnalysisData)> analyzersAndExistingData, 171PooledDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>> builder) 236DiagnosticAnalyzer analyzer, 241Func<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) 33public static void Cache(DiagnosticAnalyzer analyzer, (object key, string stateKey) key, CacheEntry entry) 42public static void Remove(DiagnosticAnalyzer analyzer, (object key, string stateKey) key) 59public static void DropCache(DiagnosticAnalyzer analyzer)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.InProcOrRemoteHostAnalyzerRunner.cs (11)
39public Task<DiagnosticAnalysisResultMap<DiagnosticAnalyzer, DiagnosticAnalysisResult>> AnalyzeDocumentAsync( 48public Task<DiagnosticAnalysisResultMap<DiagnosticAnalyzer, DiagnosticAnalysisResult>> AnalyzeProjectAsync( 58private async Task<DiagnosticAnalysisResultMap<DiagnosticAnalyzer, DiagnosticAnalysisResult>> AnalyzeAsync( 71async Task<DiagnosticAnalysisResultMap<DiagnosticAnalyzer, DiagnosticAnalysisResult>> AnalyzeCoreAsync() 87private async Task<DiagnosticAnalysisResultMap<DiagnosticAnalyzer, DiagnosticAnalysisResult>> AnalyzeInProcAsync( 120: ImmutableDictionary<DiagnosticAnalyzer, AnalyzerTelemetryInfo>.Empty; 154private static async Task<DiagnosticAnalysisResultMap<DiagnosticAnalyzer, DiagnosticAnalysisResult>> AnalyzeOutOfProcAsync( 164using var pooledObject = SharedPools.Default<Dictionary<string, DiagnosticAnalyzer>>().GetPooledObject(); 176return DiagnosticAnalysisResultMap<DiagnosticAnalyzer, DiagnosticAnalysisResult>.Empty; 197return DiagnosticAnalysisResultMap<DiagnosticAnalyzer, DiagnosticAnalysisResult>.Empty; 205return new DiagnosticAnalysisResultMap<DiagnosticAnalyzer, DiagnosticAnalysisResult>(
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.cs (8)
108/// Return <see cref="StateSet"/> for the given <see cref="DiagnosticAnalyzer"/> in the context of <see cref="Project"/>. 113public StateSet? GetOrCreateStateSet(Project project, DiagnosticAnalyzer analyzer) 160var compilerAnalyzer = hostAnalyzers.GetCompilerDiagnosticAnalyzer(project.Language); 182foreach (var analyzer in analyzers) 255private static ImmutableDictionary<DiagnosticAnalyzer, StateSet> CreateStateSetMap( 257IEnumerable<ImmutableArray<DiagnosticAnalyzer>> analyzerCollection, 260var builder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, StateSet>(); 270foreach (var analyzer in analyzers)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.HostStates.cs (4)
60public readonly ImmutableDictionary<DiagnosticAnalyzer, StateSet> StateSetMap; 62private HostAnalyzerStateSets(ImmutableDictionary<DiagnosticAnalyzer, StateSet> stateSetMap, ImmutableArray<StateSet> orderedStateSets) 68public HostAnalyzerStateSets(ImmutableDictionary<DiagnosticAnalyzer, StateSet> analyzerMap) 78public HostAnalyzerStateSets WithExcludedAnalyzers(ImmutableHashSet<DiagnosticAnalyzer> excludedAnalyzers)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.ProjectStates.cs (11)
21ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>>.Empty, 22ImmutableDictionary<DiagnosticAnalyzer, StateSet>.Empty, 28public readonly ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> MapPerReferences; 30public readonly ImmutableDictionary<DiagnosticAnalyzer, StateSet> StateSetMap; 36ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> mapPerReferences, 37ImmutableDictionary<DiagnosticAnalyzer, StateSet> stateSetMap, 117ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> newMapPerReference, 118ImmutableDictionary<DiagnosticAnalyzer, StateSet> newMap) 152ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> mapPerReference, 153ImmutableDictionary<DiagnosticAnalyzer, StateSet> map) 171foreach (var analyzer in analyzers)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateSet.cs (4)
20/// this contains all states regarding a <see cref="DiagnosticAnalyzer"/> 25public readonly DiagnosticAnalyzer Analyzer; 33public StateSet(string language, DiagnosticAnalyzer analyzer, string errorSourceName) 248public static PersistentNames Create(DiagnosticAnalyzer diagnosticAnalyzer)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_BuildSynchronization.cs (2)
113private ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> CreateAnalysisResults( 120var builder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, DiagnosticAnalysisResult>();
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnostics.cs (1)
164public async Task<ImmutableArray<DiagnosticData>> GetSpecificDiagnosticsAsync(DiagnosticAnalyzer analyzer, AnalysisKind analysisKind, CancellationToken cancellationToken)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs (9)
83private delegate Task<IEnumerable<DiagnosticData>> DiagnosticsGetterAsync(DiagnosticAnalyzer analyzer, DocumentAnalysisExecutor executor, CancellationToken cancellationToken); 194var analyzer = stateSet.Analyzer; 247DiagnosticAnalyzer analyzer, 340ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>> diagnosticsMap; 374private async Task<ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>>> ComputeDocumentDiagnosticsCoreAsync( 378using var _ = PooledDictionary<DiagnosticAnalyzer, ImmutableArray<DiagnosticData>>.GetInstance(out var builder); 379foreach (var analyzer in executor.AnalysisScope.Analyzers) 389DiagnosticAnalyzer analyzer, 406private bool MatchesPriority(DiagnosticAnalyzer analyzer)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_IncrementalAnalyzer.cs (7)
173var oldResult = result.OldResult ?? ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>.Empty; 406private bool IsCandidateForFullSolutionAnalysis(DiagnosticAnalyzer analyzer, Project project) 446ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> result) 448RaiseProjectDiagnosticsIfNeeded(project, stateSets, ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>.Empty, result); 454ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> oldResult, 455ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> newResult) 467var analyzer = stateSet.Analyzer;
Features\Options\SolutionCrawlerOptionsStorage.cs (1)
91public static bool IsFullSolutionAnalysisEnabled(this DiagnosticAnalyzer analyzer, IGlobalOptionService globalOptions, string language)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (4)
Diagnostics\AbstractPullDiagnosticTestsBase.cs (2)
42var builder = ImmutableDictionary.CreateBuilder<string, ImmutableArray<DiagnosticAnalyzer>>(); 49builder.Add(InternalLanguageNames.TypeScript, ImmutableArray.Create<DiagnosticAnalyzer>(new MockTypescriptDiagnosticAnalyzer()));
Diagnostics\AdditionalFileDiagnosticsTests.cs (1)
131=> new(ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>>.Empty.Add(LanguageNames.CSharp, ImmutableArray.Create(
Diagnostics\WorkspaceProjectDiagnosticsTests.cs (1)
72=> 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 (23)
Services\DiagnosticAnalyzer\DiagnosticComputer.cs (22)
28/// Cache of <see cref="CompilationWithAnalyzers"/> and a map from analyzer IDs to <see cref="DiagnosticAnalyzer"/>s 148BidirectionalMap<string, DiagnosticAnalyzer> analyzerToIdMap, 149ImmutableArray<DiagnosticAnalyzer> analyzers, 192ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResultBuilder> builderMap, 193BidirectionalMap<string, DiagnosticAnalyzer> analyzerToIdMap) 214ImmutableArray<DiagnosticAnalyzer> analyzers, 215BidirectionalMap<string, DiagnosticAnalyzer> analyzerToIdMap) 217Func<DiagnosticAnalyzer, bool> shouldInclude; 221using var _1 = PooledHashSet<DiagnosticAnalyzer>.GetInstance(out var analyzersSet); 244private static string GetAnalyzerId(BidirectionalMap<string, DiagnosticAnalyzer> analyzerMap, DiagnosticAnalyzer analyzer) 252private static ImmutableArray<DiagnosticAnalyzer> GetAnalyzers(BidirectionalMap<string, DiagnosticAnalyzer> analyzerMap, IEnumerable<string> analyzerIds) 255var builder = ImmutableArray.CreateBuilder<DiagnosticAnalyzer>(); 259if (analyzerMap.TryGetValue(analyzerId, out var analyzer)) 268private async Task<(CompilationWithAnalyzers compilationWithAnalyzers, BidirectionalMap<string, DiagnosticAnalyzer> analyzerToIdMap)> GetOrCreateCompilationWithAnalyzersAsync(CancellationToken cancellationToken) 305using var pooledMap = SharedPools.Default<Dictionary<string, DiagnosticAnalyzer>>().GetPooledObject(); 310using var _ = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(out var analyzerBuilder); 324var analyzerToIdMap = new BidirectionalMap<string, DiagnosticAnalyzer>(analyzerMapBuilder); 329private async Task<CompilationWithAnalyzers> CreateCompilationWithAnalyzerAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 362public BidirectionalMap<string, DiagnosticAnalyzer> AnalyzerToIdMap { get; } 364public CompilationWithAnalyzersCacheEntry(Checksum solutionChecksum, Project project, CompilationWithAnalyzers compilationWithAnalyzers, BidirectionalMap<string, DiagnosticAnalyzer> analyzerToIdMap)
Services\DiagnosticAnalyzer\PerformanceQueue.cs (1)
204public int GetUniqueNumber(DiagnosticAnalyzer analyzer)
Microsoft.CodeAnalysis.Test.Utilities (38)
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: 347public static bool IsDiagnosticAnalyzerSuppressed(this DiagnosticAnalyzer analyzer, CompilationOptions options) 393public static DiagnosticAnalyzer GetCompilerDiagnosticAnalyzer(string languageName) 396(DiagnosticAnalyzer)new Diagnostics.CSharp.CSharpCompilerDiagnosticAnalyzer() : 400public static ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>> GetCompilerDiagnosticAnalyzersMap() 402var builder = ImmutableDictionary.CreateBuilder<string, ImmutableArray<DiagnosticAnalyzer>>(); 410var 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();
Microsoft.CodeAnalysis.UnitTests (10)
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)
260ByRef analyzers As ImmutableArray(Of DiagnosticAnalyzer),
Compilation\VisualBasicCompilation.vb (1)
2307Friend Overrides Function CreateAnalyzerDriver(analyzers As ImmutableArray(Of DiagnosticAnalyzer), analyzerManager As AnalyzerManager, severityFilter As SeverityFilter) As AnalyzerDriver
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.UnitTests (35)
AddAnonymousTypeMemberNameTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(Workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
AddExplicitCastTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
AddObsoleteAttributeTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
AddParameterTests.vb (1)
17Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
AliasAmbiguousTypeTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
ConvertToAsyncTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
MakeFieldReadonlyTests.vb (1)
17Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
MakeMethodAsynchronousTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
MakeTypeAbstractTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
NamingStylesTests.vb (1)
19Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
OrderModifiersTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
PopulateSwitchStatementTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
QualifyMemberAccessTests.vb (1)
17Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
RemoveDocCommentNodeCodeFixProviderTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
RemoveUnnecessaryCastTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
RemoveUnnecessaryImportsTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
RemoveUnnecessaryParenthesesTests.vb (1)
25Friend Overrides Function CreateDiagnosticProviderAndFixer(Workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
RemoveUnusedMembersTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
RemoveUnusedParametersTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
RemoveUnusedValuesTestsBase.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
SimplifyConditionalTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
SimplifyInterpolationTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
UnsealClassTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
UseAutoPropertyTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
UseCoalesceExpressionForNullableTernaryConditionalCheckTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
UseCoalesceExpressionForTernaryConditionalCheckTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
UseCollectionInitializerTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
UseCompoundAssignmentTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(Workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
UseConditionalExpressionForAssignmentTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(Workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
UseConditionalExpressionForReturnTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
UseInferredMemberNameTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
UseIsNullCheckForReferenceEqualsTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
UseNullPropagationTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
UseSystemHashCodeTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
ValidateFormatStringTests.vb (1)
16workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (6)
CommandLineTests.vb (6)
7814Optional analyzers As DiagnosticAnalyzer() = Nothing, 9796Dim analyzerAndSuppressor As DiagnosticAnalyzer() = {analyzer, suppressor} 9852Dim analyzerAndSuppressor As DiagnosticAnalyzer() = {analyzer, suppressor} 10031Dim analyzer As DiagnosticAnalyzer = New WarningDiagnosticAnalyzer() ' Reports 2 warnings for each named type. 10273Dim analyzer As DiagnosticAnalyzer = New AdditionalFileAnalyzer(registerFromInitialize, diagnosticSpan) 10341ParamArray analyzers As DiagnosticAnalyzer())
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests (105)
AddAnonymousTypeMemberNameTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(Workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
AddExplicitCastTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
AddObsoleteAttributeTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
AddParameterTests.vb (1)
17Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
AliasAmbiguousTypeTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
ConvertToAsyncTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
Diagnostics\AddImport\AddImportTests.vb (1)
17Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
Diagnostics\AddImport\AddImportTests_NuGet.vb (2)
33Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider) 39Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace, parameters As TestParameters) As (DiagnosticAnalyzer, CodeFixProvider)
Diagnostics\AddImport\AddImportTestsWithAddImportDiagnosticProvider.vb (1)
16Friend 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\CorrectNextControlVariable\CorrectNextControlVariableTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.vb (5)
26Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) 54Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(ideEngineAnalyzer)) 96analyzer.ThrowOn(GetType(DiagnosticAnalyzer).GetProperties().Single().Name) 100Private Shared Sub AccessSupportedDiagnostics(analyzer As DiagnosticAnalyzer) 115Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer))
Diagnostics\ExitContinue\ExitContinueCodeActionTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
Diagnostics\FixIncorrectFunctionReturnType\FixIncorrectFunctionReturnTypeTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
Diagnostics\FullyQualify\FullyQualifyTests.vb (2)
18Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider) 835Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
Diagnostics\GenerateEndConstruct\GenerateEndConstructTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
Diagnostics\GenerateEnumMember\GenerateEnumMemberTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
Diagnostics\GenerateEvent\GenerateEventTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
Diagnostics\GenerateMethod\GenerateConversionTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
Diagnostics\GenerateMethod\GenerateMethodTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
Diagnostics\GenerateType\GenerateTypeTests.vb (2)
29Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider) 1862Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
Diagnostics\GenerateVariable\GenerateVariableTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
Diagnostics\MoveToTopOfFile\MoveToTopOfFileTests.vb (1)
13Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
Diagnostics\PreferFrameworkType\PreferFrameworkTypeTests.vb (1)
22Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
Diagnostics\Spellcheck\SpellcheckTests.vb (2)
18Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider) 500Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
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()) 788Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider) 789Return New Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider)(New UserDiagnosticAnalyzer(), New VisualBasicSuppressionCodeFixProvider()) 832Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider) 833Return New Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider)(New UserDiagnosticAnalyzer(), New VisualBasicSuppressionCodeFixProvider()) 896Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider) 897Return New Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider)(New UserDiagnosticAnalyzer(), New VisualBasicSuppressionCodeFixProvider()) 951Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider) 952Return Tuple.Create(Of DiagnosticAnalyzer, IConfigurationFixProvider)(Nothing, New VisualBasicSuppressionCodeFixProvider()) 972Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider) 973Return New Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider)(New VisualBasicSimplifyTypeNamesDiagnosticAnalyzer(), New VisualBasicSuppressionCodeFixProvider()) 1043Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider) 1044Return New Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider)(New UserDiagnosticAnalyzer(), New VisualBasicSuppressionCodeFixProvider()) 1759Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As Tuple(Of DiagnosticAnalyzer, IConfigurationFixProvider) 1760Return 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)
Formatting\CodeCleanUpTests.vb (4)
510Private Shared Async Function TestThirdPartyCodeFixer(Of TCodefix As {CodeFixProvider, New}, TAnalyzer As {DiagnosticAnalyzer, New})(expected As String, code As String, Optional severity As DiagnosticSeverity = DiagnosticSeverity.Warning) As Task 514Dim map = New Dictionary(Of String, ImmutableArray(Of DiagnosticAnalyzer)) From 516{LanguageNames.VisualBasic, ImmutableArray.Create(Of DiagnosticAnalyzer)(New TAnalyzer())} 518Dim analyzer As DiagnosticAnalyzer = New TAnalyzer()
GenerateConstructor\GenerateConstructorTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
ImplementAbstractClass\ImplementAbstractClassTests.vb (1)
17Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
ImplementInterface\ImplementInterfaceTests.vb (1)
18Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
MakeFieldReadonlyTests.vb (1)
17Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
MakeMethodAsynchronousTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
MakeTypeAbstractTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
NamingStylesTests.vb (1)
19Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
OrderModifiersTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
PopulateSwitchStatementTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
QualifyMemberAccessTests.vb (1)
17Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
RemoveDocCommentNodeCodeFixProviderTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
RemoveUnnecessaryCastTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
RemoveUnnecessaryImportsTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
RemoveUnnecessaryParenthesesTests.vb (1)
25Friend Overrides Function CreateDiagnosticProviderAndFixer(Workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
RemoveUnusedMembersTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
RemoveUnusedParametersTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
RemoveUnusedValuesTestsBase.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
RemoveUnusedVariable\RemoveUnusedVariableTest.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
SimplifyConditionalTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
SimplifyInterpolationTests.vb (1)
15Friend 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)
21Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
Squiggles\ErrorSquiggleProducerTests.vb (2)
108Dim analyzerMap = New Dictionary(Of String, ImmutableArray(Of DiagnosticAnalyzer)) From 112ImmutableArray.Create(Of DiagnosticAnalyzer)(
UnsealClassTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
UseAutoPropertyTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
UseCoalesceExpressionForNullableTernaryConditionalCheckTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
UseCoalesceExpressionForTernaryConditionalCheckTests.vb (1)
16Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
UseCollectionInitializerTests.vb (1)
14Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
UseCompoundAssignmentTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(Workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
UseConditionalExpressionForAssignmentTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(Workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
UseConditionalExpressionForReturnTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
UseInferredMemberNameTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
UseIsNullCheckForReferenceEqualsTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
UseNullPropagationTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
UseSystemHashCodeTests.vb (1)
15Friend Overrides Function CreateDiagnosticProviderAndFixer(workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
ValidateFormatStringTests.vb (1)
16workspace As Workspace) As (DiagnosticAnalyzer, CodeFixProvider)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (6)
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 (1)
524Dim compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer), AnalyzerOptions.Empty)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (7)
MockVisualBasicCompiler.vb (7)
14Private ReadOnly _analyzers As ImmutableArray(Of DiagnosticAnalyzer) 19Public Sub New(baseDirectory As String, args As String(), Optional analyzer As DiagnosticAnalyzer = Nothing) 23Public Sub New(responseFile As String, baseDirectory As String, args As String(), analyzer As DiagnosticAnalyzer) 27Public Sub New(responseFile As String, buildPaths As BuildPaths, args As String(), analyzer As DiagnosticAnalyzer) 31Public Sub New(responseFile As String, workingDirectory As String, args As String(), Optional analyzers As DiagnosticAnalyzer() = Nothing, Optional generators As ISourceGenerator() = Nothing) 35Public Sub New(responseFile As String, buildPaths As BuildPaths, args As String(), Optional analyzers As DiagnosticAnalyzer() = Nothing, Optional generators As ISourceGenerator() = Nothing) 50ByRef analyzers As ImmutableArray(Of DiagnosticAnalyzer),
Microsoft.CodeAnalysis.Workspaces (84)
CodeActionRequestPriority.cs (3)
29/// <see cref="T:CodeFixProvider.RequestPriority"/> is <see cref="Low"/>. <see cref="DiagnosticAnalyzer"/>s 37/// <see cref="T:CodeFixProvider.RequestPriority"/> is <see cref="Normal"/>. <see cref="DiagnosticAnalyzer"/>s 46/// The <see cref="DiagnosticAnalyzerExtensions.IsCompilerAnalyzer"/> <see cref="DiagnosticAnalyzer"/>
DiagnosticAnalyzerCategory.cs (1)
19/// Note: an <see cref="DiagnosticAnalyzer"/> that uses this will not work properly if
DiagnosticAnalyzerExtensions.cs (1)
15public static bool IsCompilerAnalyzer(this DiagnosticAnalyzer analyzer)
Diagnostics\DiagnosticAnalyzerExtensions.cs (6)
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) 52public static bool SupportsProjectDiagnosticAnalysis(this DiagnosticAnalyzer analyzer)
Diagnostics\DiagnosticAnalyzerInfoCache.cs (15)
24/// <see cref="DiagnosticAnalyzer"/> instance, <see cref="DiagnosticDescriptor"/>s. 30/// Supported descriptors of each <see cref="DiagnosticAnalyzer"/>. 33/// Holds on <see cref="DiagnosticAnalyzer"/> instances weakly so that we don't keep analyzers coming from package references alive. 36/// The purpose of this map is to avoid multiple calls to <see cref="DiagnosticAnalyzer.SupportedDiagnostics"/> that might return different values 39private readonly ConditionalWeakTable<DiagnosticAnalyzer, DiagnosticDescriptorsInfo> _descriptorsInfo; 75_descriptorsInfo = new ConditionalWeakTable<DiagnosticAnalyzer, DiagnosticDescriptorsInfo>(); 80/// Returns <see cref="DiagnosticAnalyzer.SupportedDiagnostics"/> of given <paramref name="analyzer"/>. 82public ImmutableArray<DiagnosticDescriptor> GetDiagnosticDescriptors(DiagnosticAnalyzer analyzer) 86/// Returns <see cref="DiagnosticAnalyzer.SupportedDiagnostics"/> of given <paramref name="analyzer"/> 89public ImmutableArray<DiagnosticDescriptor> GetNonCompilationEndDiagnosticDescriptors(DiagnosticAnalyzer analyzer) 101public bool IsCompilationEndAnalyzer(DiagnosticAnalyzer analyzer) 107public bool IsTelemetryCollectionAllowed(DiagnosticAnalyzer analyzer) 113private DiagnosticDescriptorsInfo GetOrCreateDescriptorsInfo(DiagnosticAnalyzer analyzer) 116private DiagnosticDescriptorsInfo CalculateDescriptorsInfo(DiagnosticAnalyzer analyzer) 136private static bool IsTelemetryCollectionAllowed(DiagnosticAnalyzer analyzer, ImmutableArray<DiagnosticDescriptor> descriptors)
Diagnostics\DocumentAnalysisScope.cs (3)
24ImmutableArray<DiagnosticAnalyzer> analyzers, 40public ImmutableArray<DiagnosticAnalyzer> Analyzers { get; } 60public DocumentAnalysisScope WithAnalyzers(ImmutableArray<DiagnosticAnalyzer> analyzers)
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)
70public static string GetAnalyzerId(this DiagnosticAnalyzer analyzer) 84public static async Task<ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResultBuilder>> ToResultBuilderMapAsync( 91IEnumerable<DiagnosticAnalyzer> analyzers, 110var builder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, DiagnosticAnalysisResultBuilder>(); 111foreach (var analyzer in analyzers) 131ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>? diagnosticsByAnalyzerMap; 221DiagnosticAnalyzer analyzer, 222ImmutableDictionary<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)
25/// Key is the language the <see cref="DiagnosticAnalyzer"/> supports and key for the second map is analyzer reference identity and 26/// <see cref="DiagnosticAnalyzer"/> for that assembly reference. 30private readonly ConcurrentDictionary<string, ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>>> _hostDiagnosticAnalyzersPerLanguageMap; 35/// Value is set of <see cref="DiagnosticAnalyzer"/> that belong to the <see cref="AnalyzerReference"/>. 39private readonly Lazy<ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>>> _lazyHostDiagnosticAnalyzersPerReferenceMap; 44private ImmutableDictionary<string, DiagnosticAnalyzer> _compilerDiagnosticAnalyzerMap; 60_hostDiagnosticAnalyzersPerLanguageMap = new ConcurrentDictionary<string, ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>>>(concurrencyLevel: 2, capacity: 2); 61_lazyHostDiagnosticAnalyzersPerReferenceMap = new Lazy<ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>>>(() => CreateDiagnosticAnalyzersPerReferenceMap(_hostAnalyzerReferencesMap), isThreadSafe: true); 63_compilerDiagnosticAnalyzerMap = ImmutableDictionary<string, DiagnosticAnalyzer>.Empty; 72/// Get <see cref="AnalyzerReference"/> identity and <see cref="DiagnosticAnalyzer"/>s map for given <paramref name="language"/> 74public ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> GetOrCreateHostDiagnosticAnalyzersPerReference(string language) 120/// Create <see cref="AnalyzerReference"/> identity and <see cref="DiagnosticAnalyzer"/>s map for given <paramref name="project"/> that 123public ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> CreateDiagnosticAnalyzersPerReference(Project project) 132/// Create <see cref="AnalyzerReference"/> identity and <see cref="DiagnosticAnalyzer"/>s map for given <paramref name="project"/> that 135public ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> CreateProjectDiagnosticAnalyzersPerReference(Project project) 138public ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> CreateProjectDiagnosticAnalyzersPerReference(IReadOnlyList<AnalyzerReference> projectAnalyzerReferences, string language) 142/// Return compiler <see cref="DiagnosticAnalyzer"/> for the given language. 144public DiagnosticAnalyzer? GetCompilerDiagnosticAnalyzer(string language) 147if (_compilerDiagnosticAnalyzerMap.TryGetValue(language, out var compilerAnalyzer)) 160ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> analyzersMap) 166foreach (var analyzer in analyzers) 179private ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> CreateHostDiagnosticAnalyzersAndBuildMap(string language) 183var builder = ImmutableDictionary.CreateBuilder<object, ImmutableArray<DiagnosticAnalyzer>>(); 201private void UpdateCompilerAnalyzerMapIfNeeded(string language, ImmutableArray<DiagnosticAnalyzer> analyzers) 208foreach (var analyzer in analyzers) 218private static ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> CreateDiagnosticAnalyzersPerReferenceMap( 221var builder = ImmutableDictionary.CreateBuilder<object, ImmutableArray<DiagnosticAnalyzer>>(); 257private static ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> MergeDiagnosticAnalyzerMap( 258ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> map1, 259ImmutableDictionary<object, ImmutableArray<DiagnosticAnalyzer>> map2) 262var 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 (11)
22ImmutableHashSet<DiagnosticAnalyzer>.Empty, 23ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<string>>.Empty); 29public ImmutableHashSet<DiagnosticAnalyzer> SkippedAnalyzers { get; } 37public ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<string>> FilteredDiagnosticIdsForAnalyzers { get; } 40ImmutableHashSet<DiagnosticAnalyzer> skippedHostAnalyzers, 41ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<string>> filteredDiagnosticIdsForAnalyzers) 61foreach (var analyzer in analyzers) 83var fullySkippedHostAnalyzersBuilder = ImmutableHashSet.CreateBuilder<DiagnosticAnalyzer>(); 84var partiallySkippedHostAnalyzersBuilder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, ImmutableArray<string>>(); 88foreach (var hostAnalyzer in analyzers) 120DiagnosticAnalyzer hostAnalyzer,
IPragmaSuppressionsAnalyzer.cs (1)
26Func<DiagnosticAnalyzer, ImmutableArray<DiagnosticDescriptor>> getSupportedDiagnostics,
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (4)
TestGeneratorReference.cs (4)
49public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzers(string language) => ImmutableArray<DiagnosticAnalyzer>.Empty; 50public override ImmutableArray<DiagnosticAnalyzer> GetAnalyzersForAllLanguages() => ImmutableArray<DiagnosticAnalyzer>.Empty;
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
BatchFixAllProviderTests.cs (1)
167protected override IEnumerable<DiagnosticAnalyzer> GetDiagnosticAnalyzers()
SolutionTests\SolutionTests.cs (2)
2338DiagnosticAnalyzer analyzer = new MockDiagnosticAnalyzer(); 2365DiagnosticAnalyzer secondAnalyzer = new MockDiagnosticAnalyzer();
Microsoft.VisualStudio.LanguageServices (3)
TableDataSource\VisualStudioBaseDiagnosticListTable.cs (2)
59public readonly DiagnosticAnalyzer Analyzer; 62public AggregatedKey(ImmutableArray<DocumentId> documentIds, DiagnosticAnalyzer analyzer, AnalysisKind kind)
TaskList\ExternalErrorDiagnosticUpdateSource.cs (1)
873foreach (var analyzer in analyzersPerReference.Value)
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 (11)
Diagnostics\DefaultDiagnosticUpdateSourceTests.vb (2)
301Dim analyzerMap = ImmutableDictionary(Of String, ImmutableArray(Of DiagnosticAnalyzer)).Empty.Add( 302NoCompilationConstants.LanguageName, ImmutableArray.Create(Of DiagnosticAnalyzer)(New DiagnosticAnalyzerWithSemanticError()))
Diagnostics\ExternalDiagnosticUpdateSourceTests.vb (7)
84ImmutableDictionary(Of String, ImmutableArray(Of DiagnosticAnalyzer)).Empty.Add(LanguageNames.CSharp, ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer))) 278Dim analyzerReference = New AnalyzerImageReference(New DiagnosticAnalyzer() {compiler, analyzer}.ToImmutableArray()) 330Dim analyzerReference = New AnalyzerImageReference(New DiagnosticAnalyzer() {compiler, analyzer}.ToImmutableArray()) 370Dim analyzerReference = New AnalyzerImageReference(New DiagnosticAnalyzer() {compiler, analyzer}.ToImmutableArray()) 444Dim analyzerReference = New AnalyzerImageReference(New DiagnosticAnalyzer() {compiler, analyzer}.ToImmutableArray()) 498Dim analyzerReference = New AnalyzerImageReference(New DiagnosticAnalyzer() {compiler, analyzer}.ToImmutableArray())
SolutionExplorer\CpsDiagnosticItemSourceTests.vb (2)
29Dim analyzers = New Dictionary(Of String, ImmutableArray(Of DiagnosticAnalyzer)) 33analyzers.Add(LanguageNames.VisualBasic, ImmutableArray.Create(Of DiagnosticAnalyzer)(New Microsoft.CodeAnalysis.VisualBasic.UseAutoProperty.VisualBasicUseAutoPropertyAnalyzer()))