58 references to Body
Microsoft.CodeAnalysis.CSharp (26)
_generated\0\Syntax.xml.Main.Generated.cs (1)
1846
=> node.Update(VisitList(node.AttributeLists), VisitList(node.Modifiers), (TypeSyntax?)Visit(node.ReturnType) ?? throw new ArgumentNullException("returnType"), VisitToken(node.Identifier), (TypeParameterListSyntax?)Visit(node.TypeParameterList), (ParameterListSyntax?)Visit(node.ParameterList) ?? throw new ArgumentNullException("parameterList"), VisitList(node.ConstraintClauses), (BlockSyntax?)Visit(node.
Body
), (ArrowExpressionClauseSyntax?)Visit(node.ExpressionBody), VisitToken(node.SemicolonToken));
_generated\2\Syntax.xml.Syntax.Generated.cs (12)
6441
if (attributeLists != this.AttributeLists || modifiers != this.Modifiers || returnType != this.ReturnType || identifier != this.Identifier || typeParameterList != this.TypeParameterList || parameterList != this.ParameterList || constraintClauses != this.ConstraintClauses || body != this.
Body
|| expressionBody != this.ExpressionBody || semicolonToken != this.SemicolonToken)
6452
public new LocalFunctionStatementSyntax WithAttributeLists(SyntaxList<AttributeListSyntax> attributeLists) => Update(attributeLists, this.Modifiers, this.ReturnType, this.Identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, this.
Body
, this.ExpressionBody, this.SemicolonToken);
6453
public LocalFunctionStatementSyntax WithModifiers(SyntaxTokenList modifiers) => Update(this.AttributeLists, modifiers, this.ReturnType, this.Identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, this.
Body
, this.ExpressionBody, this.SemicolonToken);
6454
public LocalFunctionStatementSyntax WithReturnType(TypeSyntax returnType) => Update(this.AttributeLists, this.Modifiers, returnType, this.Identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, this.
Body
, this.ExpressionBody, this.SemicolonToken);
6455
public LocalFunctionStatementSyntax WithIdentifier(SyntaxToken identifier) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, this.
Body
, this.ExpressionBody, this.SemicolonToken);
6456
public LocalFunctionStatementSyntax WithTypeParameterList(TypeParameterListSyntax? typeParameterList) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.Identifier, typeParameterList, this.ParameterList, this.ConstraintClauses, this.
Body
, this.ExpressionBody, this.SemicolonToken);
6457
public LocalFunctionStatementSyntax WithParameterList(ParameterListSyntax parameterList) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.Identifier, this.TypeParameterList, parameterList, this.ConstraintClauses, this.
Body
, this.ExpressionBody, this.SemicolonToken);
6458
public LocalFunctionStatementSyntax WithConstraintClauses(SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.Identifier, this.TypeParameterList, this.ParameterList, constraintClauses, this.
Body
, this.ExpressionBody, this.SemicolonToken);
6460
public LocalFunctionStatementSyntax WithExpressionBody(ArrowExpressionClauseSyntax? expressionBody) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.Identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, this.
Body
, expressionBody, this.SemicolonToken);
6461
public LocalFunctionStatementSyntax WithSemicolonToken(SyntaxToken semicolonToken) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.Identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, this.
Body
, this.ExpressionBody, semicolonToken);
6475
var body = this.
Body
?? SyntaxFactory.Block();
6480
var body = this.
Body
?? SyntaxFactory.Block();
Binder\Binder_Statements.cs (3)
568
if (node.
Body
!= null)
570
blockBody = runAnalysis(BindEmbeddedBlock(node.
Body
, diagnostics), diagnostics);
598
node.
Body
, node.ExpressionBody, node, diagnostics);
Binder\LocalBinderFactory.cs (1)
424
BlockSyntax blockBody = node.
Body
;
Lowering\ClosureConversion\ClosureConversion.cs (1)
1459
lambdaOrLambdaBodySyntax = (SyntaxNode?)localFunction.
Body
?? localFunction.ExpressionBody?.Expression;
Symbols\Source\LocalFunctionSymbol.cs (2)
43
: base(syntax.GetReference(), isIterator: SyntaxFacts.HasYieldOperations(syntax.
Body
))
404
internal bool IsExpressionBodied => Syntax is {
Body
: null, ExpressionBody: object _ };
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
57
return (CSharpSyntaxNode?)localFunction.
Body
?? localFunction.ExpressionBody;
Syntax\LambdaUtilities.cs (3)
129
LocalFunctionStatementSyntax localFunctionStatementSyntax => (CSharpSyntaxNode?)localFunctionStatementSyntax.
Body
?? localFunctionStatementSyntax.ExpressionBody!.Expression,
159
return localFunction.
Body
== node;
487
=> (SyntaxNode?)localFunctionStatementSyntax.
Body
?? localFunctionStatementSyntax.ExpressionBody?.Expression;
Syntax\LookupPosition.cs (2)
443
if (localFunctionStmt.
Body
!= null)
444
return GetFirstExcludedToken(localFunctionStmt.
Body
);
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForLocalFunctionHelper.cs (1)
36
=> statement.
Body
;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
150
var localFunctionBodyOperation = semanticModel.GetOperation(localFunction.
Body
?? (SyntaxNode)localFunction.ExpressionBody!.Expression, cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
615
var body = localFunctionStatement.
Body
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
206
if (localFunctionDeclaration.
Body
?.TryConvertToArrowExpressionBody(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
140
LocalFunctionStatementSyntax localFunction => (SyntaxNode?)localFunction.
Body
?? localFunction.ExpressionBody!,
Microsoft.CodeAnalysis.CSharp.Features (18)
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (3)
74
Contract.ThrowIfTrue(localFunction is {
Body
: null, ExpressionBody: null });
77
localFunction.
Body
?? (SyntaxNode)localFunction.ExpressionBody!.Expression);
312
.WithBody(localFunction.
Body
);
EditAndContinue\BreakpointSpans.cs (2)
421
return (localFunction.
Body
!= null)
422
? TryCreateSpanForNode(localFunction.
Body
, position)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (2)
478
if (localFunc.
Body
is not null)
480
yield return localFunc.
Body
;
EditAndContinue\SyntaxComparer.cs (1)
1030
body = (SyntaxNode?)localFunction.
Body
?? localFunction.ExpressionBody!;
ExtractMethod\CSharpMethodExtractor.cs (1)
82
if (SelectionWithin(localFunction.ExpressionBody) || SelectionWithin(localFunction.
Body
))
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
1027
=> TweakNewLinesInMethod(method, method.
Body
, method.ExpressionBody);
ExtractMethod\CSharpMethodExtractor.TriviaResult.cs (1)
126
LocalFunctionStatementSyntax localFunctionDeclaration => (localFunctionDeclaration.
Body
, localFunctionDeclaration.ExpressionBody, localFunctionDeclaration.SemicolonToken),
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (2)
303
if (localFunction is {
Body
: not null } && localFunction.Modifiers.Any(SyntaxKind.StaticKeyword))
304
scope = localFunction.
Body
;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForLocalFunctionHelper.cs (1)
36
=> statement.
Body
;
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
150
var localFunctionBodyOperation = semanticModel.GetOperation(localFunction.
Body
?? (SyntaxNode)localFunction.ExpressionBody!.Expression, cancellationToken);
src\roslyn\src\Compilers\CSharp\Portable\Syntax\LambdaUtilities.cs (3)
129
LocalFunctionStatementSyntax localFunctionStatementSyntax => (CSharpSyntaxNode?)localFunctionStatementSyntax.
Body
?? localFunctionStatementSyntax.ExpressionBody!.Expression,
159
return localFunction.
Body
== node;
487
=> (SyntaxNode?)localFunctionStatementSyntax.
Body
?? localFunctionStatementSyntax.ExpressionBody?.Expression;
Microsoft.CodeAnalysis.CSharp.Workspaces (6)
CodeGeneration\CSharpSyntaxGenerator.cs (2)
2629
SyntaxKind.LocalFunctionStatement => ((LocalFunctionStatementSyntax)declaration).
Body
?.Statements,
2648
LocalFunctionStatementSyntax localFunction => localFunction.
Body
,
Rename\LocalConflictVisitor.cs (1)
143
Visit(node.
Body
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
615
var body = localFunctionStatement.
Body
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
206
if (localFunctionDeclaration.
Body
?.TryConvertToArrowExpressionBody(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
140
LocalFunctionStatementSyntax localFunction => (SyntaxNode?)localFunction.
Body
?? localFunction.ExpressionBody!,
Roslyn.Diagnostics.CSharp.Analyzers (3)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
615
var body = localFunctionStatement.
Body
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
206
if (localFunctionDeclaration.
Body
?.TryConvertToArrowExpressionBody(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
140
LocalFunctionStatementSyntax localFunction => (SyntaxNode?)localFunction.
Body
?? localFunction.ExpressionBody!,