Base:
property
ExpressionBody
Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax.ExpressionBody
46 references to ExpressionBody
Microsoft.CodeAnalysis.CSharp (15)
_generated\0\Syntax.xml.Main.Generated.cs (1)
2071
=> node.Update(VisitList(node.AttributeLists), VisitList(node.Modifiers), (TypeSyntax?)Visit(node.ReturnType) ?? throw new ArgumentNullException("returnType"), (ExplicitInterfaceSpecifierSyntax?)Visit(node.ExplicitInterfaceSpecifier), 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 (11)
12413
if (attributeLists != this.AttributeLists || modifiers != this.Modifiers || returnType != this.ReturnType || explicitInterfaceSpecifier != this.ExplicitInterfaceSpecifier || identifier != this.Identifier || typeParameterList != this.TypeParameterList || parameterList != this.ParameterList || constraintClauses != this.ConstraintClauses || body != this.Body || expressionBody != this.
ExpressionBody
|| semicolonToken != this.SemicolonToken)
12424
public new MethodDeclarationSyntax WithAttributeLists(SyntaxList<AttributeListSyntax> attributeLists) => Update(attributeLists, this.Modifiers, this.ReturnType, this.ExplicitInterfaceSpecifier, this.Identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, this.Body, this.
ExpressionBody
, this.SemicolonToken);
12426
public new MethodDeclarationSyntax WithModifiers(SyntaxTokenList modifiers) => Update(this.AttributeLists, modifiers, this.ReturnType, this.ExplicitInterfaceSpecifier, this.Identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, this.Body, this.
ExpressionBody
, this.SemicolonToken);
12427
public MethodDeclarationSyntax WithReturnType(TypeSyntax returnType) => Update(this.AttributeLists, this.Modifiers, returnType, this.ExplicitInterfaceSpecifier, this.Identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, this.Body, this.
ExpressionBody
, this.SemicolonToken);
12428
public MethodDeclarationSyntax WithExplicitInterfaceSpecifier(ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, explicitInterfaceSpecifier, this.Identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, this.Body, this.
ExpressionBody
, this.SemicolonToken);
12429
public MethodDeclarationSyntax WithIdentifier(SyntaxToken identifier) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.ExplicitInterfaceSpecifier, identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, this.Body, this.
ExpressionBody
, this.SemicolonToken);
12430
public MethodDeclarationSyntax WithTypeParameterList(TypeParameterListSyntax? typeParameterList) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.ExplicitInterfaceSpecifier, this.Identifier, typeParameterList, this.ParameterList, this.ConstraintClauses, this.Body, this.
ExpressionBody
, this.SemicolonToken);
12432
public new MethodDeclarationSyntax WithParameterList(ParameterListSyntax parameterList) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.ExplicitInterfaceSpecifier, this.Identifier, this.TypeParameterList, parameterList, this.ConstraintClauses, this.Body, this.
ExpressionBody
, this.SemicolonToken);
12433
public MethodDeclarationSyntax WithConstraintClauses(SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.ExplicitInterfaceSpecifier, this.Identifier, this.TypeParameterList, this.ParameterList, constraintClauses, this.Body, this.
ExpressionBody
, this.SemicolonToken);
12435
public new MethodDeclarationSyntax WithBody(BlockSyntax? body) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.ExplicitInterfaceSpecifier, this.Identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, body, this.
ExpressionBody
, this.SemicolonToken);
12439
public new MethodDeclarationSyntax WithSemicolonToken(SyntaxToken semicolonToken) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.ExplicitInterfaceSpecifier, this.Identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, this.Body, this.
ExpressionBody
, semicolonToken);
Binder\LocalBinderFactory.cs (1)
150
Visit(node.
ExpressionBody
);
src\roslyn\src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
442
arrowExpr = ((MethodDeclarationSyntax)node).
ExpressionBody
;
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
86
syntax.Body, syntax.
ExpressionBody
, syntax, diagnostics);
Microsoft.CodeAnalysis.CSharp.Analyzers (4)
MetaAnalyzers\Fixers\CSharpConfigureGeneratedCodeAnalysisFix.cs (2)
24
if (method.
ExpressionBody
!= null)
26
return new[] { method.
ExpressionBody
.Expression };
MetaAnalyzers\Fixers\CSharpEnableConcurrentExecutionFix.cs (2)
24
if (method.
ExpressionBody
!= null)
26
return new[] { method.
ExpressionBody
.Expression };
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\roslyn\src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_TopLevelStatements.cs (1)
142
if (member is MethodDeclarationSyntax { Body: null,
ExpressionBody
: null })
src\roslyn\src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForMethodsHelper.cs (1)
37
=> declaration.
ExpressionBody
;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeTypeAbstract\CSharpMakeTypeAbstractCodeFixProvider.cs (1)
27
if (method.Body != null || method.
ExpressionBody
!= null)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
186
if (methodDeclaration.
ExpressionBody
== null)
Microsoft.CodeAnalysis.CSharp.Features (15)
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (1)
246
expressionBody: otherMethod.
ExpressionBody
).WithLeadingTrivia(otherMethod.GetLeadingTrivia()));
EditAndContinue\SyntaxUtilities.cs (1)
24
MethodDeclarationSyntax methodDeclaration => CreateSimpleBody(BlockOrExpression(methodDeclaration.Body, methodDeclaration.
ExpressionBody
)),
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
1024
=> TweakNewLinesInMethod(method, method.Body, method.
ExpressionBody
);
ExtractMethod\CSharpMethodExtractor.TriviaResult.cs (1)
125
MethodDeclarationSyntax methodDeclaration => (methodDeclaration.Body, methodDeclaration.
ExpressionBody
, methodDeclaration.SemicolonToken),
Organizing\Organizers\MethodDeclarationOrganizer.cs (1)
39
expressionBody: syntax.
ExpressionBody
,
ReplaceMethodWithProperty\CSharpReplaceMethodWithPropertyService.cs (4)
215
if (getMethodDeclaration.
ExpressionBody
!= null)
217
return accessor.WithExpressionBody(getMethodDeclaration.
ExpressionBody
)
259
if (setMethodDeclaration.
ExpressionBody
!= null)
261
var oldExpressionBody = setMethodDeclaration.
ExpressionBody
;
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.cs (2)
278
else if (methodDeclaration.
ExpressionBody
!= null && expressionBodyPreference == ExpressionBodyPreference.Never)
280
if (methodDeclaration.
ExpressionBody
.TryConvertToBlock(
src\roslyn\src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_TopLevelStatements.cs (1)
142
if (member is MethodDeclarationSyntax { Body: null,
ExpressionBody
: null })
src\roslyn\src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForMethodsHelper.cs (1)
37
=> declaration.
ExpressionBody
;
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeTypeAbstract\CSharpMakeTypeAbstractCodeFixProvider.cs (1)
27
if (method.Body != null || method.
ExpressionBody
!= null)
src\roslyn\src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
442
arrowExpr = ((MethodDeclarationSyntax)node).
ExpressionBody
;
Microsoft.CodeAnalysis.CSharp.Workspaces (5)
CodeGeneration\CSharpSyntaxGenerator.cs (4)
2443
if (method.
ExpressionBody
!= null)
2445
return method.
ExpressionBody
.Expression;
2499
if (method.
ExpressionBody
!= null)
2501
return ReplaceWithTrivia(method, method.
ExpressionBody
.Expression, expr);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
186
if (methodDeclaration.
ExpressionBody
== null)
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Parser.cs (1)
314
CSharpSyntaxNode? methodBody = method.Body as CSharpSyntaxNode ?? method.
ExpressionBody
;
Microsoft.Interop.JavaScript.JSImportGenerator (1)
Analyzers\JSImportExportDiagnosticsAnalyzer.cs (1)
156
bool hasImplementation = methodSyntax.Body is not null || methodSyntax.
ExpressionBody
is not null;
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
186
if (methodDeclaration.
ExpressionBody
== null)