1 instantiation of OperationAnalysisContext
Microsoft.CodeAnalysis (1)
DiagnosticAnalyzer\AnalyzerExecutor.cs (1)
675var operationContext = new OperationAnalysisContext(operation, containingSymbol, semanticModel.Compilation,
240 references to OperationAnalysisContext
Aspire.Hosting.Analyzers (1)
AppHostAnalyzer.cs (1)
55void DoOperationAnalysis(OperationAnalysisContext context, ConcurrentDictionary<ModelNameOperation, byte> modelNameOperations)
ILLink.RoslynAnalyzer (1)
RequiresAnalyzerBase.cs (1)
194 protected static ISymbol FindContainingSymbol (OperationAnalysisContext operationContext, DiagnosticTargets targets)
Microsoft.Analyzers.Extra (32)
AsyncCallInsideUsingBlockAnalyzer.cs (1)
71void ValidateDisposable(OperationAnalysisContext analysisContext,
CallAnalysis\Arrays.cs (3)
101static void HandleMethod(OperationAnalysisContext context, IInvocationOperation op) => HandleSuspectType(context, (INamedTypeSymbol)op.TargetMethod.ReturnType, op.Syntax.GetLocation()); 103static void HandleConstructor(OperationAnalysisContext context, IObjectCreationOperation op) => HandleSuspectType(context, (INamedTypeSymbol)op.Type!, op.Syntax.GetLocation()); 105static void HandleSuspectType(OperationAnalysisContext context, INamedTypeSymbol type, Location loc)
CallAnalysis\CallAnalyzer.Handlers.cs (3)
21public void HandleInvocation(OperationAnalysisContext context) 82public void HandleObjectCreation(OperationAnalysisContext context) 100public void HandlePropertyReference(OperationAnalysisContext context)
CallAnalysis\CallAnalyzer.Registrar.cs (11)
33public void RegisterMethod(IMethodSymbol method, Action<OperationAnalysisContext, IInvocationOperation> action) 50public void RegisterMethods(string typeName, string methodName, Action<OperationAnalysisContext, IInvocationOperation> action) 66public void RegisterMethods(Dictionary<string, string[]> methods, Action<OperationAnalysisContext, IInvocationOperation> action) 87public void RegisterConstructor(IMethodSymbol ctor, Action<OperationAnalysisContext, IObjectCreationOperation> action) 101public void RegisterConstructors(string typeName, Action<OperationAnalysisContext, IObjectCreationOperation> action) 109public void RegisterConstructors(string[] typeNames, Action<OperationAnalysisContext, IObjectCreationOperation> action) 127public void RegisterProperty(IPropertySymbol prop, Action<OperationAnalysisContext, IPropertyReferenceOperation> action) 144public void RegisterProperties(Dictionary<string, string[]> props, Action<OperationAnalysisContext, IPropertyReferenceOperation> action) 165public void RegisterInterfaceMethod(IMethodSymbol method, Action<OperationAnalysisContext, IInvocationOperation> action) 200public void RegisterInterfaceMethods(Dictionary<string, string[]> methods, Action<OperationAnalysisContext, IInvocationOperation> action) 221public void RegisterExceptionTypes(string[] exceptionTypes, Action<OperationAnalysisContext, IThrowOperation> action)
CallAnalysis\CallAnalyzer.State.cs (5)
16public readonly Dictionary<IMethodSymbol, List<Action<OperationAnalysisContext, IInvocationOperation>>> Methods = new(SymbolEqualityComparer.Default); 17public readonly Dictionary<IMethodSymbol, List<Action<OperationAnalysisContext, IObjectCreationOperation>>> Ctors = new(SymbolEqualityComparer.Default); 18public readonly Dictionary<IPropertySymbol, List<Action<OperationAnalysisContext, IPropertyReferenceOperation>>> Props = new(SymbolEqualityComparer.Default); 19public readonly Dictionary<ITypeSymbol, List<Action<OperationAnalysisContext, IThrowOperation>>> ExceptionTypes = new(SymbolEqualityComparer.Default); 32public List<Action<OperationAnalysisContext, IInvocationOperation>> Actions { get; } = [];
CallAnalysis\LegacyCollection.cs (1)
31static void HandleConstructor(OperationAnalysisContext context, IObjectCreationOperation op)
CallAnalysis\LegacyLogging.cs (1)
36static void Handle(OperationAnalysisContext context, IInvocationOperation op)
CallAnalysis\Split.cs (1)
26static void Handle(OperationAnalysisContext context, IInvocationOperation op)
CallAnalysis\StartsEndsWith.cs (1)
44static void Handle(OperationAnalysisContext context, IInvocationOperation op)
CallAnalysis\StaticTime.cs (2)
50static void HandleMethod(OperationAnalysisContext context, IInvocationOperation op) 56static void HandleProperty(OperationAnalysisContext context, IPropertyReferenceOperation op)
CallAnalysis\ValueTuple.cs (2)
40static void HandleMethod(OperationAnalysisContext context, IInvocationOperation op) 46static void HandleConstructor(OperationAnalysisContext context, IObjectCreationOperation op)
UsingToStringInLoggersAnalyzer.cs (1)
38private static void AnalyzeInvocation(OperationAnalysisContext context)
Microsoft.Analyzers.Local (22)
CallAnalysis\CallAnalyzer.Handlers.cs (4)
21public void HandleInvocation(OperationAnalysisContext context) 82public void HandleObjectCreation(OperationAnalysisContext context) 100public void HandlePropertyReference(OperationAnalysisContext context) 112public void HandleThrow(OperationAnalysisContext context)
CallAnalysis\CallAnalyzer.Registrar.cs (11)
33public void RegisterMethod(IMethodSymbol method, Action<OperationAnalysisContext, IInvocationOperation> action) 50public void RegisterMethods(string typeName, string methodName, Action<OperationAnalysisContext, IInvocationOperation> action) 66public void RegisterMethods(Dictionary<string, string[]> methods, Action<OperationAnalysisContext, IInvocationOperation> action) 87public void RegisterConstructor(IMethodSymbol ctor, Action<OperationAnalysisContext, IObjectCreationOperation> action) 101public void RegisterConstructors(string typeName, Action<OperationAnalysisContext, IObjectCreationOperation> action) 109public void RegisterConstructors(string[] typeNames, Action<OperationAnalysisContext, IObjectCreationOperation> action) 127public void RegisterProperty(IPropertySymbol prop, Action<OperationAnalysisContext, IPropertyReferenceOperation> action) 144public void RegisterProperties(Dictionary<string, string[]> props, Action<OperationAnalysisContext, IPropertyReferenceOperation> action) 165public void RegisterInterfaceMethod(IMethodSymbol method, Action<OperationAnalysisContext, IInvocationOperation> action) 200public void RegisterInterfaceMethods(Dictionary<string, string[]> methods, Action<OperationAnalysisContext, IInvocationOperation> action) 221public void RegisterExceptionTypes(string[] exceptionTypes, Action<OperationAnalysisContext, IThrowOperation> action)
CallAnalysis\CallAnalyzer.State.cs (5)
16public readonly Dictionary<IMethodSymbol, List<Action<OperationAnalysisContext, IInvocationOperation>>> Methods = new(SymbolEqualityComparer.Default); 17public readonly Dictionary<IMethodSymbol, List<Action<OperationAnalysisContext, IObjectCreationOperation>>> Ctors = new(SymbolEqualityComparer.Default); 18public readonly Dictionary<IPropertySymbol, List<Action<OperationAnalysisContext, IPropertyReferenceOperation>>> Props = new(SymbolEqualityComparer.Default); 19public readonly Dictionary<ITypeSymbol, List<Action<OperationAnalysisContext, IThrowOperation>>> ExceptionTypes = new(SymbolEqualityComparer.Default); 32public List<Action<OperationAnalysisContext, IInvocationOperation>> Actions { get; } = [];
CallAnalysis\Throws.cs (1)
28static void Handle(OperationAnalysisContext context, IThrowOperation op)
CallAnalysis\ToInvariantString.cs (1)
39static void Handle(OperationAnalysisContext context, IInvocationOperation op)
Microsoft.AspNetCore.App.Analyzers (15)
Authorization\AddAuthorizationBuilderAnalyzer.cs (1)
228private static void AddDiagnosticInformation(OperationAnalysisContext context, Location location)
Http\HeaderDictionaryAddAnalyzer.cs (1)
72private static void AddDiagnosticWarning(OperationAnalysisContext context, Location location)
Http\HeaderDictionaryIndexerAnalyzer.cs (1)
169private static void AddDiagnosticWarning(OperationAnalysisContext context, Location location, string headerName, string propertyName)
Http\RequestDelegateReturnTypeAnalyzer.cs (1)
76private static void AddDiagnosticWarning(OperationAnalysisContext context, Location location, ITypeSymbol returnType)
RouteHandlers\AtMostOneFromBodyAttribute.cs (2)
18in OperationAnalysisContext context, 46static void ReportDiagnostics(OperationAnalysisContext context, IEnumerable<ISymbol> symbols)
RouteHandlers\DetectMismatchedParameterOptionality.cs (1)
14in OperationAnalysisContext context,
RouteHandlers\DetectMisplacedLambdaAttribute.cs (1)
15in OperationAnalysisContext context,
RouteHandlers\DisallowMvcBindArgumentsOnParameters.cs (1)
17in OperationAnalysisContext context,
RouteHandlers\DisallowNonParsableComplexTypesOnParameters.cs (2)
19in OperationAnalysisContext context, 97static bool ReportFromAttributeDiagnostic(OperationAnalysisContext context, WellKnownType fromMetadataInterfaceType, WellKnownTypes wellKnownTypes, IParameterSymbol parameter, INamedTypeSymbol parameterTypeSymbol, Location location)
RouteHandlers\DisallowReturningActionResultFromMapMethods.cs (2)
17in OperationAnalysisContext context, 27in OperationAnalysisContext context,
RouteHandlers\RouteHandlerAnalyzer.cs (1)
68void DoOperationAnalysis(OperationAnalysisContext context, ConcurrentDictionary<MapOperation, byte> mapOperations)
WebApplicationBuilder\WebApplicationBuilderAnalyzer.cs (1)
312in OperationAnalysisContext context,
Microsoft.AspNetCore.Components.Analyzers (2)
InternalUsageAnalyzer.cs (2)
59private void AnalyzeOperation(OperationAnalysisContext context) 127private void VisitOperationSymbol(OperationAnalysisContext context, ISymbol symbol)
Microsoft.AspNetCore.Components.SdkAnalyzers (2)
InternalUsageAnalyzer.cs (2)
59private void AnalyzeOperation(OperationAnalysisContext context) 127private void VisitOperationSymbol(OperationAnalysisContext context, ISymbol symbol)
Microsoft.CodeAnalysis (17)
DiagnosticAnalyzer\AnalyzerExecutor.cs (1)
675var operationContext = new OperationAnalysisContext(operation, containingSymbol, semanticModel.Compilation,
DiagnosticAnalyzer\DiagnosticAnalysisContext.cs (10)
183public void RegisterOperationAction(Action<OperationAnalysisContext> action, params OperationKind[] operationKinds) 195public virtual void RegisterOperationAction(Action<OperationAnalysisContext> action, ImmutableArray<OperationKind> operationKinds) 478public void RegisterOperationAction(Action<OperationAnalysisContext> action, params OperationKind[] operationKinds) 490public virtual void RegisterOperationAction(Action<OperationAnalysisContext> action, ImmutableArray<OperationKind> operationKinds) 990public void RegisterOperationAction(Action<OperationAnalysisContext> action, params OperationKind[] operationKinds) 1002public abstract void RegisterOperationAction(Action<OperationAnalysisContext> action, ImmutableArray<OperationKind> operationKinds); 1336public void RegisterOperationAction(Action<OperationAnalysisContext> action, params OperationKind[] operationKinds) 1348public abstract void RegisterOperationAction(Action<OperationAnalysisContext> action, ImmutableArray<OperationKind> operationKinds); 1372/// An operation block action or operation block end action can use an <see cref="OperationAnalysisContext"/> to report <see cref="Diagnostic"/>s about an operation block. 1766/// An operation action can use an <see cref="OperationAnalysisContext"/> to report <see cref="Diagnostic"/>s for an <see cref="IOperation"/>.
DiagnosticAnalyzer\DiagnosticAnalyzerAction.cs (2)
95public Action<OperationAnalysisContext> Action { get; } 98public OperationAnalyzerAction(Action<OperationAnalysisContext> action, ImmutableArray<OperationKind> kinds, DiagnosticAnalyzer analyzer)
DiagnosticAnalyzer\DiagnosticStartAnalysisScope.cs (4)
90public override void RegisterOperationAction(Action<OperationAnalysisContext> action, ImmutableArray<OperationKind> operationKinds) 207public override void RegisterOperationAction(Action<OperationAnalysisContext> action, ImmutableArray<OperationKind> operationKinds) 277public override void RegisterOperationAction(Action<OperationAnalysisContext> action, ImmutableArray<OperationKind> operationKinds) 347public override void RegisterOperationAction(Action<OperationAnalysisContext> action, ImmutableArray<OperationKind> operationKinds)
Microsoft.CodeAnalysis.CodeStyle (32)
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (1)
102protected bool ShouldSkipAnalysis(OperationAnalysisContext context, NotificationOption2? notification)
src\Analyzers\Core\Analyzers\ConvertTypeofToNameof\AbstractConvertTypeOfToNameOfDiagnosticAnalyzer.cs (2)
24protected abstract bool IsValidTypeofAction(OperationAnalysisContext context); 31protected void AnalyzeAction(OperationAnalysisContext context)
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
99void AnalyzeOperation(OperationAnalysisContext operationContext)
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
47private void AnalyzeOperation(OperationAnalysisContext context)
src\Analyzers\Core\Analyzers\QualifyMemberAccess\AbstractQualifyMemberAccessDiagnosticAnalyzer.cs (2)
57private void AnalyzeOperation(OperationAnalysisContext context) 77private void AnalyzeOperation(OperationAnalysisContext context, IOperation operation, IOperation? instanceOperation)
src\Analyzers\Core\Analyzers\RemoveRedundantEquality\AbstractRemoveRedundantEqualityDiagnosticAnalyzer.cs (3)
29private void AnalyzeIsPatternOperator(OperationAnalysisContext context) 51private void AnalyzeBinaryOperator(OperationAnalysisContext context) 79OperationAnalysisContext context,
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (5)
264private void AnalyzeFieldInitializer(OperationAnalysisContext operationContext) 315private void AnalyzeMemberReferenceOperation(OperationAnalysisContext operationContext) 372private void AnalyzeInvocationOperation(OperationAnalysisContext operationContext) 388private void AnalyzeNameOfOperation(OperationAnalysisContext operationContext) 421private void AnalyzeObjectCreationOperation(OperationAnalysisContext operationContext)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (3)
162private void AnalyzeExpressionStatement(OperationAnalysisContext context) 224private void AnalyzeDelegateCreationOrAnonymousFunction(OperationAnalysisContext operationAnalysisContext) 233private void AnalyzeLocalOrParameterReference(OperationAnalysisContext operationAnalysisContext)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
103private void OnMethodReference(OperationAnalysisContext context)
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationDiagnosticAnalyzer.cs (1)
42private void AnalyzeInterpolation(OperationAnalysisContext context)
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
113public void AnalyzeInvocationOperation(OperationAnalysisContext context, INamedTypeSymbol enumerableType, IMethodSymbol whereMethod, ImmutableArray<IMethodSymbol> linqMethods)
src\Analyzers\Core\Analyzers\UseConditionalExpression\AbstractUseConditionalExpressionDiagnosticAnalyzer.cs (2)
36protected abstract CodeStyleOption2<bool> GetStylePreference(OperationAnalysisContext context); 41private void AnalyzeOperation(OperationAnalysisContext context)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentDiagnosticAnalyzer.cs (1)
25protected sealed override CodeStyleOption2<bool> GetStylePreference(OperationAnalysisContext context)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnDiagnosticAnalyzer.cs (1)
25protected sealed override CodeStyleOption2<bool> GetStylePreference(OperationAnalysisContext context)
src\Analyzers\Core\Analyzers\UseExplicitTupleName\UseExplicitTupleNameDiagnosticAnalyzer.cs (1)
33private void AnalyzeOperation(OperationAnalysisContext context)
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (2)
50protected abstract CodeStyleOption2<bool> PreferThrowExpressionStyle(OperationAnalysisContext context); 70private void AnalyzeOperation(OperationAnalysisContext context, INamedTypeSymbol? expressionType)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalysisContextExtensions.cs (4)
110/// - <see cref="OperationAnalysisContext.FilterSpan"/> is <see langword="null"/> (we are analyzing the entire tree) 112/// - <paramref name="span"/> intersects with <see cref="OperationAnalysisContext.FilterSpan"/>. 114public static bool ShouldAnalyzeSpan(this OperationAnalysisContext context, TextSpan span) 198public static SyntaxNode GetAnalysisRoot(this OperationAnalysisContext context, bool findInTrivia, bool getInnermostNodeForTie = false)
Microsoft.CodeAnalysis.CSharp.CodeStyle (16)
src\Analyzers\CSharp\Analyzers\ConvertTypeofToNameof\CSharpConvertTypeOfToNameOfDiagnosticAnalyzer.cs (1)
24protected override bool IsValidTypeofAction(OperationAnalysisContext context)
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
100private void AnalyzeAssignment(OperationAnalysisContext context)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (4)
99OperationAnalysisContext context, InfoCache infoCache) 117OperationAnalysisContext context, InfoCache infoCache) 139OperationAnalysisContext context, InfoCache infoCache, IPropertySymbol arrayLengthProperty) 158OperationAnalysisContext context,
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.cs (1)
76private void AnalyzeInvocation(OperationAnalysisContext context, InfoCache infoCache)
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckDiagnosticAnalyzer.cs (3)
45private bool ShouldAnalyze(OperationAnalysisContext context, out NotificationOption2 notificationOption) 58private void AnalyzeNegatedPatternOperation(OperationAnalysisContext context) 85private void AnalyzeIsTypeOperation(OperationAnalysisContext context, INamedTypeSymbol? expressionType)
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
543private void AnalyzeFieldOrPropertyReference(OperationAnalysisContext context)
src\Analyzers\CSharp\Analyzers\UseThrowExpression\CSharpUseThrowExpressionDiagnosticAnalyzer.cs (1)
21protected override CodeStyleOption2<bool> PreferThrowExpressionStyle(OperationAnalysisContext context)
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (4)
60private void AnalyzeOperation(OperationAnalysisContext context, INamedTypeSymbol? expressionType) 118private void ReportParameterArrayDiagnostic(OperationAnalysisContext context, SyntaxNode syntaxNode, ImmutableArray<IOperation> elements, NotificationOption2 notificationOption, ArrayCreationOperationLocation operationLocation) 130private void ReportArrayCreationDiagnostic(OperationAnalysisContext context, SyntaxNode syntaxNode, NotificationOption2 notificationOption) 138private void ReportDiagnostic(OperationAnalysisContext context, SyntaxNode syntaxNode, NotificationOption2 notificationOption, Location location, ArrayCreationOperationLocation operationLocation)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (15)
Semantics\PrimaryConstructorTests.cs (10)
4322protected void Handle1(OperationAnalysisContext context) 4344protected void Handle2(OperationAnalysisContext context) 4384protected void Handle3(OperationAnalysisContext context) 4430protected void Handle4(OperationAnalysisContext context) 4452protected void Handle5(OperationAnalysisContext context) 5690protected void HandleConstructorBody(OperationAnalysisContext context) 5706protected void HandleInvocation(OperationAnalysisContext context) 5711protected void HandleLiteral(OperationAnalysisContext context) 5729protected void HandleParameterInitializer(OperationAnalysisContext context) 5743protected void Fail(OperationAnalysisContext context)
Semantics\RecordTests.cs (5)
26785protected void Handle1(OperationAnalysisContext context) 26807protected void Handle2(OperationAnalysisContext context) 26847protected void Handle3(OperationAnalysisContext context) 26893protected void Handle4(OperationAnalysisContext context) 26915protected void Handle5(OperationAnalysisContext context)
Microsoft.CodeAnalysis.CSharp.Features (16)
src\Analyzers\CSharp\Analyzers\ConvertTypeofToNameof\CSharpConvertTypeOfToNameOfDiagnosticAnalyzer.cs (1)
24protected override bool IsValidTypeofAction(OperationAnalysisContext context)
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
100private void AnalyzeAssignment(OperationAnalysisContext context)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (4)
99OperationAnalysisContext context, InfoCache infoCache) 117OperationAnalysisContext context, InfoCache infoCache) 139OperationAnalysisContext context, InfoCache infoCache, IPropertySymbol arrayLengthProperty) 158OperationAnalysisContext context,
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.cs (1)
76private void AnalyzeInvocation(OperationAnalysisContext context, InfoCache infoCache)
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckDiagnosticAnalyzer.cs (3)
45private bool ShouldAnalyze(OperationAnalysisContext context, out NotificationOption2 notificationOption) 58private void AnalyzeNegatedPatternOperation(OperationAnalysisContext context) 85private void AnalyzeIsTypeOperation(OperationAnalysisContext context, INamedTypeSymbol? expressionType)
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
543private void AnalyzeFieldOrPropertyReference(OperationAnalysisContext context)
src\Analyzers\CSharp\Analyzers\UseThrowExpression\CSharpUseThrowExpressionDiagnosticAnalyzer.cs (1)
21protected override CodeStyleOption2<bool> PreferThrowExpressionStyle(OperationAnalysisContext context)
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (4)
60private void AnalyzeOperation(OperationAnalysisContext context, INamedTypeSymbol? expressionType) 118private void ReportParameterArrayDiagnostic(OperationAnalysisContext context, SyntaxNode syntaxNode, ImmutableArray<IOperation> elements, NotificationOption2 notificationOption, ArrayCreationOperationLocation operationLocation) 130private void ReportArrayCreationDiagnostic(OperationAnalysisContext context, SyntaxNode syntaxNode, NotificationOption2 notificationOption) 138private void ReportDiagnostic(OperationAnalysisContext context, SyntaxNode syntaxNode, NotificationOption2 notificationOption, Location location, ArrayCreationOperationLocation operationLocation)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (8)
Semantics\RecordStructTests.cs (5)
6416protected void HandleConstructorBody(OperationAnalysisContext context) 6432protected void HandleInvocation(OperationAnalysisContext context) 6437protected void HandleLiteral(OperationAnalysisContext context) 6455protected void HandleParameterInitializer(OperationAnalysisContext context) 6469protected void Fail(OperationAnalysisContext context)
Semantics\TopLevelStatementsTests.cs (3)
6718private void Handle1(OperationAnalysisContext context) 6739private void Handle2(OperationAnalysisContext context) 7417private void Handle2(OperationAnalysisContext context)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (1)
Diagnostics\DiagnosticServiceTests.vb (1)
2401context.RegisterOperationAction(Sub(operationContext As OperationAnalysisContext)
Microsoft.CodeAnalysis.Features (28)
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (1)
102protected bool ShouldSkipAnalysis(OperationAnalysisContext context, NotificationOption2? notification)
src\Analyzers\Core\Analyzers\ConvertTypeofToNameof\AbstractConvertTypeOfToNameOfDiagnosticAnalyzer.cs (2)
24protected abstract bool IsValidTypeofAction(OperationAnalysisContext context); 31protected void AnalyzeAction(OperationAnalysisContext context)
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
99void AnalyzeOperation(OperationAnalysisContext operationContext)
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
47private void AnalyzeOperation(OperationAnalysisContext context)
src\Analyzers\Core\Analyzers\QualifyMemberAccess\AbstractQualifyMemberAccessDiagnosticAnalyzer.cs (2)
57private void AnalyzeOperation(OperationAnalysisContext context) 77private void AnalyzeOperation(OperationAnalysisContext context, IOperation operation, IOperation? instanceOperation)
src\Analyzers\Core\Analyzers\RemoveRedundantEquality\AbstractRemoveRedundantEqualityDiagnosticAnalyzer.cs (3)
29private void AnalyzeIsPatternOperator(OperationAnalysisContext context) 51private void AnalyzeBinaryOperator(OperationAnalysisContext context) 79OperationAnalysisContext context,
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (5)
264private void AnalyzeFieldInitializer(OperationAnalysisContext operationContext) 315private void AnalyzeMemberReferenceOperation(OperationAnalysisContext operationContext) 372private void AnalyzeInvocationOperation(OperationAnalysisContext operationContext) 388private void AnalyzeNameOfOperation(OperationAnalysisContext operationContext) 421private void AnalyzeObjectCreationOperation(OperationAnalysisContext operationContext)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (3)
162private void AnalyzeExpressionStatement(OperationAnalysisContext context) 224private void AnalyzeDelegateCreationOrAnonymousFunction(OperationAnalysisContext operationAnalysisContext) 233private void AnalyzeLocalOrParameterReference(OperationAnalysisContext operationAnalysisContext)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
103private void OnMethodReference(OperationAnalysisContext context)
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationDiagnosticAnalyzer.cs (1)
42private void AnalyzeInterpolation(OperationAnalysisContext context)
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
113public void AnalyzeInvocationOperation(OperationAnalysisContext context, INamedTypeSymbol enumerableType, IMethodSymbol whereMethod, ImmutableArray<IMethodSymbol> linqMethods)
src\Analyzers\Core\Analyzers\UseConditionalExpression\AbstractUseConditionalExpressionDiagnosticAnalyzer.cs (2)
36protected abstract CodeStyleOption2<bool> GetStylePreference(OperationAnalysisContext context); 41private void AnalyzeOperation(OperationAnalysisContext context)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentDiagnosticAnalyzer.cs (1)
25protected sealed override CodeStyleOption2<bool> GetStylePreference(OperationAnalysisContext context)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnDiagnosticAnalyzer.cs (1)
25protected sealed override CodeStyleOption2<bool> GetStylePreference(OperationAnalysisContext context)
src\Analyzers\Core\Analyzers\UseExplicitTupleName\UseExplicitTupleNameDiagnosticAnalyzer.cs (1)
33private void AnalyzeOperation(OperationAnalysisContext context)
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (2)
50protected abstract CodeStyleOption2<bool> PreferThrowExpressionStyle(OperationAnalysisContext context); 70private void AnalyzeOperation(OperationAnalysisContext context, INamedTypeSymbol? expressionType)
Microsoft.CodeAnalysis.Test.Utilities (18)
Diagnostics\BoxingOperationAnalyzer.cs (1)
77internal void Report(OperationAnalysisContext context, SyntaxNode boxingExpression)
Diagnostics\CommonDiagnosticAnalyzers.cs (5)
1304private void VerifyControlFlowGraph(OperationAnalysisContext operationContext, bool inBlockAnalysisContext) 1438private static void AnalyzerOperation(OperationAnalysisContext operationAnalysisContext) 1980var seenOperationContainers = new ConcurrentDictionary<OperationAnalysisContext, ISet<ISymbol>>(); 2067void performOperationActionVerification(OperationAnalysisContext operationContext, SymbolStartAnalysisContext symbolStartContext) 2143OperationAnalysisContext operationContext = kvp.Key;
Diagnostics\EmptyArrayAnalyzer.cs (1)
54internal void Report(OperationAnalysisContext context, SyntaxNode arrayCreationExpression)
Diagnostics\OperationTestAnalyzer.cs (11)
144private void AnalyzeOperation(OperationAnalysisContext operationContext) 286private void Report(OperationAnalysisContext context, SyntaxNode syntax, DiagnosticDescriptor descriptor) 482private void Report(OperationAnalysisContext context, SyntaxNode syntax, DiagnosticDescriptor descriptor) 584private static void TestAscendingArgument(OperationAnalysisContext operationContext, IOperation argument, ref long priorArgumentValue) 599private static void Report(OperationAnalysisContext context, SyntaxNode syntax, DiagnosticDescriptor descriptor) 676private static void Report(OperationAnalysisContext context, SyntaxNode syntax, DiagnosticDescriptor descriptor) 722private static void Report(OperationAnalysisContext context, SyntaxNode syntax, DiagnosticDescriptor descriptor) 763private static void Report(OperationAnalysisContext context, SyntaxNode syntax, DiagnosticDescriptor descriptor) 803private static void Report(OperationAnalysisContext context, SyntaxNode syntax, DiagnosticDescriptor descriptor) 860private static void Report(OperationAnalysisContext context, SyntaxNode syntax, DiagnosticDescriptor descriptor) 921private static void Report(OperationAnalysisContext context, SyntaxNode syntax, DiagnosticDescriptor descriptor)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
src\Analyzers\VisualBasic\Analyzers\ConvertTypeofToNameof\VisualBasicConvertTypeOfToNameOfDiagnosticAnalyzer.vb (1)
21Protected Overrides Function IsValidTypeofAction(context As OperationAnalysisContext) As Boolean
Microsoft.CodeAnalysis.VisualBasic.Features (1)
src\Analyzers\VisualBasic\Analyzers\ConvertTypeofToNameof\VisualBasicConvertTypeOfToNameOfDiagnosticAnalyzer.vb (1)
21Protected Overrides Function IsValidTypeofAction(context As OperationAnalysisContext) As Boolean
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
Diagnostics\GetDiagnosticsTests.vb (1)
640Private Sub AnalyzeOperationContext(context As OperationAnalysisContext)
Microsoft.CodeAnalysis.Workspaces (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalysisContextExtensions.cs (4)
110/// - <see cref="OperationAnalysisContext.FilterSpan"/> is <see langword="null"/> (we are analyzing the entire tree) 112/// - <paramref name="span"/> intersects with <see cref="OperationAnalysisContext.FilterSpan"/>. 114public static bool ShouldAnalyzeSpan(this OperationAnalysisContext context, TextSpan span) 198public static SyntaxNode GetAnalysisRoot(this OperationAnalysisContext context, bool findInTrivia, bool getInnermostNodeForTie = false)
Microsoft.Interop.LibraryImportGenerator (2)
Analyzers\CustomMarshallerAttributeAnalyzer.cs (1)
642public void AnalyzeAttribute(OperationAnalysisContext context)
Analyzers\NativeMarshallingAttributeAnalyzer.cs (1)
84public void AnalyzeAttribute(OperationAnalysisContext context)
System.Private.CoreLib.Generators (3)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (3)
273private static INamedTypeSymbol[][] DecomposePropertySymbolForIsSupportedGroups_Property(OperationAnalysisContext context, SemanticModel model, ExpressionSyntax expressionToDecompose) 309private static INamedTypeSymbol[][] DecomposeConditionForIsSupportedGroups(OperationAnalysisContext context, SemanticModel model, ExpressionSyntax expressionToDecompose) 451private static void AnalyzeOperation(IOperation operation, IMethodSymbol methodSymbol, OperationAnalysisContext context, IntrinsicsAnalyzerOnLoadData onLoadData)
System.Text.RegularExpressions.Generator (2)
UpgradeToGeneratedRegexAnalyzer.cs (2)
90private static void AnalyzeInvocation(OperationAnalysisContext context, INamedTypeSymbol regexTypeSymbol, HashSet<IMethodSymbol> staticMethodsToDetect) 122private static void AnalyzeObjectCreation(OperationAnalysisContext context, INamedTypeSymbol regexTypeSymbol)