1 implementation of IVariableDeclaratorOperation
Microsoft.CodeAnalysis (1)
Generated\Operations.Generated.cs (1)
7763internal sealed partial class VariableDeclaratorOperation : Operation, IVariableDeclaratorOperation
92 references to IVariableDeclaratorOperation
ILLink.RoslynAnalyzer (1)
IOperationExtensions.cs (1)
161 if (variableInitializerOperation.Parent is IVariableDeclaratorOperation variableDeclaratorOperation) {
Microsoft.Analyzers.Extra (1)
AsyncCallInsideUsingBlockAnalyzer.cs (1)
102return IsTaskAwaited(block, (operation as IVariableDeclaratorOperation)!.Symbol);
Microsoft.CodeAnalysis (26)
Generated\OperationKind.Generated.cs (1)
177/// <summary>Indicates an <see cref="IVariableDeclaratorOperation"/>.</summary>
Generated\Operations.Generated.cs (8)
2252/// Represents a declaration expression operation. Unlike a regular variable declaration <see cref="IVariableDeclaratorOperation" /> and <see cref="IVariableDeclarationOperation" />, this operation represents an "expression" declaring a variable. 2483/// in the parent operation. Call <see cref="OperationExtensions.GetVariableInitializer(IVariableDeclaratorOperation)" /> 2526ImmutableArray<IVariableDeclaratorOperation> Declarators { get; } 7833internal VariableDeclarationOperation(ImmutableArray<IVariableDeclaratorOperation> declarators, IVariableInitializerOperation? initializer, ImmutableArray<IOperation> ignoredDimensions, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 7840public ImmutableArray<IVariableDeclaratorOperation> Declarators { get; } 11146public override IOperation VisitVariableDeclarator(IVariableDeclaratorOperation operation, object? argument) 11491public virtual void VisitVariableDeclarator(IVariableDeclaratorOperation operation) => DefaultVisit(operation); 11630public virtual TResult? VisitVariableDeclarator(IVariableDeclaratorOperation operation, TArgument argument) => DefaultVisit(operation, argument);
Operations\ControlFlowGraphBuilder.cs (15)
3793ILocalSymbol local = ((IVariableDeclaratorOperation)exceptionDeclarationOrExpression).Symbol; 3969var resourceQueue = ArrayBuilder<(IVariableDeclarationOperation, IVariableDeclaratorOperation)>.GetInstance(declarationGroup.Declarations.Length); 3973foreach (IVariableDeclaratorOperation declarator in declaration.Declarators) 4008void processQueue(ArrayBuilder<(IVariableDeclarationOperation, IVariableDeclaratorOperation)>? resourceQueueOpt) 4016(IVariableDeclarationOperation declaration, IVariableDeclaratorOperation declarator) = resourceQueueOpt.Pop(); 4030void processResource(IOperation resource, ArrayBuilder<(IVariableDeclarationOperation, IVariableDeclaratorOperation)>? resourceQueueOpt) 4475var declarator = (IVariableDeclaratorOperation)operation.LoopControlVariable; 4659var declarator = (IVariableDeclaratorOperation)operation.LoopControlVariable; 5428var declarator = (IVariableDeclaratorOperation)operation.LoopControlVariable; 5811foreach (IVariableDeclaratorOperation declarator in operation.Declarators) 5817private void HandleVariableDeclarator(IVariableDeclarationOperation declaration, IVariableDeclaratorOperation declarator) 5895public override IOperation VisitVariableDeclarator(IVariableDeclaratorOperation operation, int? captureIdForResult)
Operations\OperationExtensions.cs (2)
162foreach (var decl in declaration.Declarators) 173public static IVariableInitializerOperation? GetVariableInitializer(this IVariableDeclaratorOperation declarationOperation)
Microsoft.CodeAnalysis.CodeStyle (5)
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (1)
67if (loopOperation.LoopControlVariable is not IVariableDeclaratorOperation variableDeclarator ||
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.cs (1)
151var declarator = declaration.Declarators[0];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
214if (variableInitializerOperation.Parent is IVariableDeclaratorOperation variableDeclaratorOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (2)
268public override void VisitVariableDeclarator(IVariableDeclaratorOperation operation) 417if (write is IVariableDeclaratorOperation variableDeclarator)
Microsoft.CodeAnalysis.CodeStyle.Fixes (8)
src\Analyzers\Core\CodeFixes\ForEachCast\AbstractForEachCastCodeFixProvider.cs (2)
66var variableDeclarator = (IVariableDeclaratorOperation)loopOperation.LoopControlVariable;
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (3)
38protected abstract TVariableDeclaratorSyntax GetDeclaratorSyntax(IVariableDeclaratorOperation declarator); 127out var localDeclarationOperation, out var declarator)) 156[NotNullWhen(true)] out IVariableDeclaratorOperation? declarator)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (3)
108else if (operation is IVariableDeclaratorOperation variableDeclarator) 149IForEachLoopOperation { LoopControlVariable: IVariableDeclaratorOperation variableDeclarator } => variableDeclarator.Symbol.Equals(symbol), 152IVariableDeclaratorOperation variableDeclarator when includeDeclaration => variableDeclarator.GetVariableInitializer() != null && variableDeclarator.Symbol.Equals(symbol),
Microsoft.CodeAnalysis.CSharp (7)
Operations\CSharpOperationFactory.cs (5)
396internal ImmutableArray<IVariableDeclaratorOperation> CreateVariableDeclarator(BoundNode declaration, SyntaxNode declarationSyntax) 408var builder = ArrayBuilder<IVariableDeclaratorOperation>.GetInstance(multipleDeclaration.LocalDeclarations.Length); 411builder.Add((IVariableDeclaratorOperation)CreateVariableDeclaratorInternal(decl, decl.Syntax)); 2141ImmutableArray<IVariableDeclaratorOperation> declarators = CreateVariableDeclarator(boundLocalDeclaration, varDeclaration); 2161ImmutableArray<IVariableDeclaratorOperation> declarators = CreateVariableDeclarator(boundMultipleLocalDeclarations, declarationSyntax);
Operations\CSharpOperationFactory_Methods.cs (2)
81private IVariableDeclaratorOperation CreateVariableDeclaratorInternal(BoundLocalDeclaration boundLocalDeclaration, SyntaxNode syntax) 93internal IVariableDeclaratorOperation? CreateVariableDeclarator(BoundLocal? boundLocal)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (1)
577Declarators: [IVariableDeclaratorOperation
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
37protected override VariableDeclaratorSyntax GetDeclaratorSyntax(IVariableDeclaratorOperation declarator)
Microsoft.CodeAnalysis.CSharp.Features (2)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (1)
577Declarators: [IVariableDeclaratorOperation
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
37protected override VariableDeclaratorSyntax GetDeclaratorSyntax(IVariableDeclaratorOperation declarator)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (2)
Diagnostics\Suppression\RemoveUnnecessaryPragmaSuppressionsTests.cs (2)
73var declarator = (IVariableDeclaratorOperation)context.Operation;
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (10)
IOperation\IOperationTests_IConversionExpression.cs (4)
182var initializerOperation = ((IVariableDeclaratorOperation)operation).Initializer.Value; 380var initializer = ((IVariableDeclaratorOperation)operation).Initializer.Value; 5341((IVariableDeclaratorOperation)operation).Initializer.Value; 5425case IVariableDeclaratorOperation _:
IOperation\IOperationTests_IVariableDeclaration.cs (6)
612var declarator = (IVariableDeclaratorOperation)operation; 634var declarator = (IVariableDeclaratorOperation)operation; 655var declarator = (IVariableDeclaratorOperation)operation;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (4)
Semantics\DelegateTypeTests.cs (2)
14733var operation = (IVariableDeclaratorOperation)model.GetOperation(syntax)!;
Semantics\TopLevelStatementsTests.cs (2)
490Assert.IsAssignableFrom<IVariableDeclaratorOperation>(operation1); 582Assert.IsAssignableFrom<IVariableDeclaratorOperation>(operation1);
Microsoft.CodeAnalysis.Features (10)
InlineMethod\AbstractInlineMethodRefactoringProvider.InlineContext.cs (1)
409if (operation is IVariableDeclaratorOperation variableDeclarationOperation)
IntroduceUsingStatement\AbstractIntroduceUsingStatementCodeRefactoringProvider.cs (1)
117var declarator = localDeclaration.Declarators[0];
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (1)
67if (loopOperation.LoopControlVariable is not IVariableDeclaratorOperation variableDeclarator ||
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.cs (1)
151var declarator = declaration.Declarators[0];
src\Analyzers\Core\CodeFixes\ForEachCast\AbstractForEachCastCodeFixProvider.cs (2)
66var variableDeclarator = (IVariableDeclaratorOperation)loopOperation.LoopControlVariable;
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (3)
38protected abstract TVariableDeclaratorSyntax GetDeclaratorSyntax(IVariableDeclaratorOperation declarator); 127out var localDeclarationOperation, out var declarator)) 156[NotNullWhen(true)] out IVariableDeclaratorOperation? declarator)
ValueTracking\ValueTracker.cs (1)
303IVariableDeclaratorOperation variableDeclarator => [variableDeclarator],
Microsoft.CodeAnalysis.Test.Utilities (6)
Compilation\OperationTreeVerifier.cs (2)
488public override void VisitVariableDeclarator(IVariableDeclaratorOperation operation) 490LogString($"{nameof(IVariableDeclaratorOperation)} (");
Compilation\TestOperationVisitor.cs (1)
131public override void VisitVariableDeclarator(IVariableDeclaratorOperation operation)
Diagnostics\CouldHaveMoreSpecificTypeAnalyzer.cs (1)
105if (initializer.Parent is IVariableDeclaratorOperation singleVariableDeclaration)
Diagnostics\LocalCouldBeConstAnalyzer.cs (1)
83foreach (IVariableDeclaratorOperation variable in declaration.Declarations.SelectMany(decl => decl.Declarators))
Diagnostics\OperationTestAnalyzer.cs (1)
848foreach (var decl in declarationStatement.Declarations.SelectMany(multiDecl => multiDecl.Declarators))
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (1)
src\Analyzers\VisualBasic\CodeFixes\UseConditionalExpression\VisualBasicUseConditionalExpressionForAssignmentCodeFixProvider.vb (1)
46Protected Overrides Function GetDeclaratorSyntax(declarator As IVariableDeclaratorOperation) As VariableDeclaratorSyntax
Microsoft.CodeAnalysis.VisualBasic.Features (1)
src\Analyzers\VisualBasic\CodeFixes\UseConditionalExpression\VisualBasicUseConditionalExpressionForAssignmentCodeFixProvider.vb (1)
46Protected Overrides Function GetDeclaratorSyntax(declarator As IVariableDeclaratorOperation) As VariableDeclaratorSyntax
Microsoft.CodeAnalysis.Workspaces (6)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
214if (variableInitializerOperation.Parent is IVariableDeclaratorOperation variableDeclaratorOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (2)
268public override void VisitVariableDeclarator(IVariableDeclaratorOperation operation) 417if (write is IVariableDeclaratorOperation variableDeclarator)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (3)
108else if (operation is IVariableDeclaratorOperation variableDeclarator) 149IForEachLoopOperation { LoopControlVariable: IVariableDeclaratorOperation variableDeclarator } => variableDeclarator.Symbol.Equals(symbol), 152IVariableDeclaratorOperation variableDeclarator when includeDeclaration => variableDeclarator.GetVariableInitializer() != null && variableDeclarator.Symbol.Equals(symbol),