1 implementation of IVariableDeclarationOperation
Microsoft.CodeAnalysis (1)
Generated\Operations.Generated.cs (1)
7831internal sealed partial class VariableDeclarationOperation : Operation, IVariableDeclarationOperation
44 references to IVariableDeclarationOperation
Microsoft.CodeAnalysis (24)
Generated\OperationKind.Generated.cs (1)
179/// <summary>Indicates an <see cref="IVariableDeclarationOperation"/>.</summary>
Generated\Operations.Generated.cs (10)
96/// In C#, this will always be a single declaration, with all variables in <see cref="IVariableDeclarationOperation.Declarators" />. 98ImmutableArray<IVariableDeclarationOperation> Declarations { get; } 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. 2482/// If this variable is in an <see cref="IVariableDeclarationOperation" />, the initializer may be located 2523/// All <see cref="IVariableDeclarationGroupOperation" /> will have at least 1 <see cref="IVariableDeclarationOperation" />, 4058internal VariableDeclarationGroupOperation(ImmutableArray<IVariableDeclarationOperation> declarations, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4063public ImmutableArray<IVariableDeclarationOperation> Declarations { get; } 11151public override IOperation VisitVariableDeclaration(IVariableDeclarationOperation operation, object? argument) 11492public virtual void VisitVariableDeclaration(IVariableDeclarationOperation operation) => DefaultVisit(operation); 11631public virtual TResult? VisitVariableDeclaration(IVariableDeclarationOperation operation, TArgument argument) => DefaultVisit(operation, argument);
Operations\ControlFlowGraphBuilder.cs (9)
3969var resourceQueue = ArrayBuilder<(IVariableDeclarationOperation, IVariableDeclaratorOperation)>.GetInstance(declarationGroup.Declarations.Length); 3971foreach (IVariableDeclarationOperation declaration in declarationGroup.Declarations) 4008void processQueue(ArrayBuilder<(IVariableDeclarationOperation, IVariableDeclaratorOperation)>? resourceQueueOpt) 4016(IVariableDeclarationOperation declaration, IVariableDeclaratorOperation declarator) = resourceQueueOpt.Pop(); 4030void processResource(IOperation resource, ArrayBuilder<(IVariableDeclarationOperation, IVariableDeclaratorOperation)>? resourceQueueOpt) 5803foreach (var declaration in operation.Declarations) 5809private void HandleVariableDeclaration(IVariableDeclarationOperation operation) 5817private void HandleVariableDeclarator(IVariableDeclarationOperation declaration, IVariableDeclaratorOperation declarator) 5889public override IOperation VisitVariableDeclaration(IVariableDeclarationOperation operation, int? captureIdForResult)
Operations\OperationExtensions.cs (4)
136foreach (IVariableDeclarationOperation group in declarationGroup.Declarations) 148public static ImmutableArray<ILocalSymbol> GetDeclaredVariables(this IVariableDeclarationOperation declaration) 160private static void GetDeclaredVariables(this IVariableDeclarationOperation declaration, ArrayBuilder<ILocalSymbol> arrayBuilder) 180return declarationOperation.Initializer ?? (declarationOperation.Parent as IVariableDeclarationOperation)?.Initializer;
Microsoft.CodeAnalysis.CodeStyle (1)
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.cs (1)
145var declaration = varDeclStatement.Declarations[0];
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
214var declaration = localDeclaration.Declarations[0];
Microsoft.CodeAnalysis.CSharp (2)
Operations\CSharpOperationFactory.cs (2)
2143IVariableDeclarationOperation multiVariableDeclaration = new VariableDeclarationOperation(declarators, initializer: null, ignoredDimensions, _semanticModel, varDeclaration, multiVariableImplicit); 2163IVariableDeclarationOperation multiVariableDeclaration = new VariableDeclarationOperation(declarators, initializer: null, ignoredDimensions, _semanticModel, declarationSyntax, declarationIsImplicit);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (1)
575Declarations: [IVariableDeclarationOperation
Microsoft.CodeAnalysis.CSharp.Features (1)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (1)
575Declarations: [IVariableDeclarationOperation
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (6)
IOperation\IOperationTests_IConversionExpression.cs (2)
5338((IVariableDeclarationOperation)operation).Initializer.Value; 5423case IVariableDeclarationOperation _:
IOperation\IOperationTests_IVariableDeclaration.cs (4)
850var declaration = (IVariableDeclarationOperation)operation; 872var declaration = (IVariableDeclarationOperation)operation;
Microsoft.CodeAnalysis.Features (4)
IntroduceUsingStatement\AbstractIntroduceUsingStatementCodeRefactoringProvider.cs (1)
113var localDeclaration = operation.Declarations[0];
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.cs (1)
145var declaration = varDeclStatement.Declarations[0];
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
214var declaration = localDeclaration.Declarations[0];
ValueTracking\ValueTracker.cs (1)
304IVariableDeclarationOperation variableDeclaration => variableDeclaration.Declarators,
Microsoft.CodeAnalysis.Test.Utilities (4)
Compilation\OperationTreeVerifier.cs (2)
502public override void VisitVariableDeclaration(IVariableDeclarationOperation operation) 505LogString($"{nameof(IVariableDeclarationOperation)} ({variableCount} declarators)");
Compilation\TestOperationVisitor.cs (1)
146public override void VisitVariableDeclaration(IVariableDeclarationOperation operation)
Diagnostics\CouldHaveMoreSpecificTypeAnalyzer.cs (1)
110else if (initializer.Parent is IVariableDeclarationOperation multiVariableDeclaration)