Base:
property
Body
Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax.Body
38 references to Body
Microsoft.CodeAnalysis.CSharp (18)
Binder\LocalBinderFactory.cs (1)
208
Visit(node.
Body
);
Symbols\Source\SourceUserDefinedOperatorSymbol.cs (3)
81
isIterator: SyntaxFacts.HasYieldOperations(syntax.
Body
),
86
syntax.
Body
, syntax.ExpressionBody, syntax, diagnostics);
90
CheckFeatureAvailabilityAndRuntimeSupport(syntax, location, hasBody: syntax.
Body
!= null || syntax.ExpressionBody != null, diagnostics: diagnostics);
Syntax.xml.Main.Generated.cs (1)
2062
=> node.Update(VisitList(node.AttributeLists), VisitList(node.Modifiers), (TypeSyntax?)Visit(node.ReturnType) ?? throw new ArgumentNullException("returnType"), (ExplicitInterfaceSpecifierSyntax?)Visit(node.ExplicitInterfaceSpecifier), VisitToken(node.OperatorKeyword), VisitToken(node.CheckedKeyword), VisitToken(node.OperatorToken), (ParameterListSyntax?)Visit(node.ParameterList) ?? throw new ArgumentNullException("parameterList"), (BlockSyntax?)Visit(node.
Body
), (ArrowExpressionClauseSyntax?)Visit(node.ExpressionBody), VisitToken(node.SemicolonToken));
Syntax.xml.Syntax.Generated.cs (13)
12518
if (attributeLists != this.AttributeLists || modifiers != this.Modifiers || returnType != this.ReturnType || explicitInterfaceSpecifier != this.ExplicitInterfaceSpecifier || operatorKeyword != this.OperatorKeyword || checkedKeyword != this.CheckedKeyword || operatorToken != this.OperatorToken || parameterList != this.ParameterList || body != this.
Body
|| expressionBody != this.ExpressionBody || semicolonToken != this.SemicolonToken)
12529
public new OperatorDeclarationSyntax WithAttributeLists(SyntaxList<AttributeListSyntax> attributeLists) => Update(attributeLists, this.Modifiers, this.ReturnType, this.ExplicitInterfaceSpecifier, this.OperatorKeyword, this.CheckedKeyword, this.OperatorToken, this.ParameterList, this.
Body
, this.ExpressionBody, this.SemicolonToken);
12531
public new OperatorDeclarationSyntax WithModifiers(SyntaxTokenList modifiers) => Update(this.AttributeLists, modifiers, this.ReturnType, this.ExplicitInterfaceSpecifier, this.OperatorKeyword, this.CheckedKeyword, this.OperatorToken, this.ParameterList, this.
Body
, this.ExpressionBody, this.SemicolonToken);
12532
public OperatorDeclarationSyntax WithReturnType(TypeSyntax returnType) => Update(this.AttributeLists, this.Modifiers, returnType, this.ExplicitInterfaceSpecifier, this.OperatorKeyword, this.CheckedKeyword, this.OperatorToken, this.ParameterList, this.
Body
, this.ExpressionBody, this.SemicolonToken);
12533
public OperatorDeclarationSyntax WithExplicitInterfaceSpecifier(ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, explicitInterfaceSpecifier, this.OperatorKeyword, this.CheckedKeyword, this.OperatorToken, this.ParameterList, this.
Body
, this.ExpressionBody, this.SemicolonToken);
12534
public OperatorDeclarationSyntax WithOperatorKeyword(SyntaxToken operatorKeyword) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.ExplicitInterfaceSpecifier, operatorKeyword, this.CheckedKeyword, this.OperatorToken, this.ParameterList, this.
Body
, this.ExpressionBody, this.SemicolonToken);
12535
public OperatorDeclarationSyntax WithCheckedKeyword(SyntaxToken checkedKeyword) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.ExplicitInterfaceSpecifier, this.OperatorKeyword, checkedKeyword, this.OperatorToken, this.ParameterList, this.
Body
, this.ExpressionBody, this.SemicolonToken);
12536
public OperatorDeclarationSyntax WithOperatorToken(SyntaxToken operatorToken) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.ExplicitInterfaceSpecifier, this.OperatorKeyword, this.CheckedKeyword, operatorToken, this.ParameterList, this.
Body
, this.ExpressionBody, this.SemicolonToken);
12538
public new OperatorDeclarationSyntax WithParameterList(ParameterListSyntax parameterList) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.ExplicitInterfaceSpecifier, this.OperatorKeyword, this.CheckedKeyword, this.OperatorToken, parameterList, this.
Body
, this.ExpressionBody, this.SemicolonToken);
12542
public new OperatorDeclarationSyntax WithExpressionBody(ArrowExpressionClauseSyntax? expressionBody) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.ExplicitInterfaceSpecifier, this.OperatorKeyword, this.CheckedKeyword, this.OperatorToken, this.ParameterList, this.
Body
, expressionBody, this.SemicolonToken);
12544
public new OperatorDeclarationSyntax WithSemicolonToken(SyntaxToken semicolonToken) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.ExplicitInterfaceSpecifier, this.OperatorKeyword, this.CheckedKeyword, this.OperatorToken, this.ParameterList, this.
Body
, this.ExpressionBody, semicolonToken);
12555
var body = this.
Body
?? SyntaxFactory.Block();
12561
var body = this.
Body
?? SyntaxFactory.Block();
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForOperatorsHelper.cs (1)
34
=> declaration.
Body
;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\OperatorGenerator.cs (1)
61
if (declaration.
Body
?.TryConvertToArrowExpressionBody(
Microsoft.CodeAnalysis.CSharp.Features (9)
EditAndContinue\SyntaxUtilities.cs (1)
26
OperatorDeclarationSyntax operatorDeclaration => CreateSimpleBody(BlockOrExpression(operatorDeclaration.
Body
, operatorDeclaration.ExpressionBody)),
LineSeparators\CSharpLineSeparatorService.cs (3)
193
if (operatorDecl.
Body
!= null &&
194
(operatorDecl.
Body
.OpenBraceToken.IsMissing ||
195
operatorDecl.
Body
.CloseBraceToken.IsMissing))
Organizing\Organizers\OperatorDeclarationOrganizer.cs (1)
35
syntax.
Body
,
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForOperatorsHelper.cs (1)
34
=> declaration.
Body
;
Structure\Providers\OperatorDeclarationStructureProvider.cs (3)
24
if (operatorDeclaration.
Body
== null ||
25
operatorDeclaration.
Body
.OpenBraceToken.IsMissing ||
26
operatorDeclaration.
Body
.CloseBraceToken.IsMissing)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (5)
Generated\Syntax.Test.xml.Generated.cs (2)
13453
Assert.Null(node.
Body
);
13456
var newNode = node.WithAttributeLists(node.AttributeLists).WithModifiers(node.Modifiers).WithReturnType(node.ReturnType).WithExplicitInterfaceSpecifier(node.ExplicitInterfaceSpecifier).WithOperatorKeyword(node.OperatorKeyword).WithCheckedKeyword(node.CheckedKeyword).WithOperatorToken(node.OperatorToken).WithParameterList(node.ParameterList).WithBody(node.
Body
).WithExpressionBody(node.ExpressionBody).WithSemicolonToken(node.SemicolonToken);
Parsing\DeclarationParsingTests.cs (3)
5307
Assert.NotNull(ps.
Body
);
5387
Assert.NotNull(ps.
Body
);
5501
Assert.NotNull(ps.
Body
);
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
2635
SyntaxKind.OperatorDeclaration => ((OperatorDeclarationSyntax)declaration).
Body
?.Statements,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\OperatorGenerator.cs (1)
61
if (declaration.
Body
?.TryConvertToArrowExpressionBody(
Microsoft.DotNet.GenFacades (1)
NotSupportedAssemblyGenerator.cs (1)
182
if (node.
Body
== null)
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\OperatorGenerator.cs (1)
61
if (declaration.
Body
?.TryConvertToArrowExpressionBody(