51 references to Declaration
Microsoft.CodeAnalysis.CSharp (18)
Binder\Binder_Statements.cs (1)
198VariableDeclarationSyntax declarationSyntax = node.Declaration;
Binder\FixedStatementBinder.cs (5)
31if (_syntax.Declaration != null) 33var locals = new ArrayBuilder<LocalSymbol>(_syntax.Declaration.Variables.Count); 35_syntax.Declaration.Type.VisitRankSpecifiers((rankSpecifier, args) => 46foreach (VariableDeclaratorSyntax declarator in _syntax.Declaration.Variables) 48locals.Add(MakeLocal(_syntax.Declaration, declarator, LocalDeclarationKind.FixedVariable, allowScoped: false));
Binder\LocalBinderFactory.cs (3)
699if (node.Declaration != null) 701VisitRankSpecifiers(node.Declaration.Type, binder); 703foreach (VariableDeclaratorSyntax declarator in node.Declaration.Variables)
Syntax.xml.Main.Generated.cs (1)
1903=> node.Update(VisitList(node.AttributeLists), VisitToken(node.FixedKeyword), VisitToken(node.OpenParenToken), (VariableDeclarationSyntax?)Visit(node.Declaration) ?? throw new ArgumentNullException("declaration"), VisitToken(node.CloseParenToken), (StatementSyntax?)Visit(node.Statement) ?? throw new ArgumentNullException("statement"));
Syntax.xml.Syntax.Generated.cs (8)
8068if (attributeLists != this.AttributeLists || fixedKeyword != this.FixedKeyword || openParenToken != this.OpenParenToken || declaration != this.Declaration || closeParenToken != this.CloseParenToken || statement != this.Statement) 8079public new FixedStatementSyntax WithAttributeLists(SyntaxList<AttributeListSyntax> attributeLists) => Update(attributeLists, this.FixedKeyword, this.OpenParenToken, this.Declaration, this.CloseParenToken, this.Statement); 8080public FixedStatementSyntax WithFixedKeyword(SyntaxToken fixedKeyword) => Update(this.AttributeLists, fixedKeyword, this.OpenParenToken, this.Declaration, this.CloseParenToken, this.Statement); 8081public FixedStatementSyntax WithOpenParenToken(SyntaxToken openParenToken) => Update(this.AttributeLists, this.FixedKeyword, openParenToken, this.Declaration, this.CloseParenToken, this.Statement); 8083public FixedStatementSyntax WithCloseParenToken(SyntaxToken closeParenToken) => Update(this.AttributeLists, this.FixedKeyword, this.OpenParenToken, this.Declaration, closeParenToken, this.Statement); 8084public FixedStatementSyntax WithStatement(StatementSyntax statement) => Update(this.AttributeLists, this.FixedKeyword, this.OpenParenToken, this.Declaration, this.CloseParenToken, statement); 8088public FixedStatementSyntax AddDeclarationVariables(params VariableDeclaratorSyntax[] items) => WithDeclaration(this.Declaration.WithVariables(this.Declaration.Variables.AddRange(items)));
Microsoft.CodeAnalysis.CSharp.Features (9)
EditAndContinue\BreakpointSpans.cs (1)
707return TryCreateSpanForNode(fixedStatement.Declaration, position);
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (5)
863=> AreEquivalentIgnoringLambdaBodies(oldNode.Declaration, newNode.Declaration); 3030getTypedNodes: static n => GetTypedNodes(n.Declaration), 3032areSimilar: static (n1, n2) => DeclareSameIdentifiers(n1.Declaration.Variables, n2.Declaration.Variables),
EditAndContinue\SyntaxComparer.cs (2)
864distance = ComputeWeightedDistance(leftFixed.Declaration, leftFixed.Statement, rightFixed.Declaration, rightFixed.Statement);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs (1)
196return node.WithDeclaration(VisitNode(node.Declaration))
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (24)
Generated\Syntax.Test.xml.Generated.cs (2)
12718Assert.NotNull(node.Declaration); 12721var newNode = node.WithAttributeLists(node.AttributeLists).WithFixedKeyword(node.FixedKeyword).WithOpenParenToken(node.OpenParenToken).WithDeclaration(node.Declaration).WithCloseParenToken(node.CloseParenToken).WithStatement(node.Statement);
Parsing\StatementParsingTests.cs (22)
880Assert.NotNull(fs.Declaration); 881Assert.Equal(SyntaxKind.VariableDeclaration, fs.Declaration.Kind()); 882Assert.NotNull(fs.Declaration.Type); 883Assert.Equal("T", fs.Declaration.Type.ToString()); 884Assert.Equal(1, fs.Declaration.Variables.Count); 885Assert.Equal("a = b", fs.Declaration.Variables[0].ToString()); 907Assert.NotNull(fs.Declaration); 908Assert.Equal(SyntaxKind.VariableDeclaration, fs.Declaration.Kind()); 909Assert.NotNull(fs.Declaration.Type); 910Assert.Equal("var", fs.Declaration.Type.ToString()); 911Assert.True(fs.Declaration.Type.IsVar); 912Assert.Equal(SyntaxKind.IdentifierName, fs.Declaration.Type.Kind()); 913Assert.Equal(SyntaxKind.IdentifierToken, ((IdentifierNameSyntax)fs.Declaration.Type).Identifier.Kind()); 914Assert.Equal(1, fs.Declaration.Variables.Count); 915Assert.Equal("a = b", fs.Declaration.Variables[0].ToString()); 937Assert.NotNull(fs.Declaration); 938Assert.Equal(SyntaxKind.VariableDeclaration, fs.Declaration.Kind()); 939Assert.NotNull(fs.Declaration.Type); 940Assert.Equal("T", fs.Declaration.Type.ToString()); 941Assert.Equal(2, fs.Declaration.Variables.Count); 942Assert.Equal("a = b", fs.Declaration.Variables[0].ToString()); 943Assert.Equal("c = d", fs.Declaration.Variables[1].ToString());