55 references to ExpressionBody
Microsoft.CodeAnalysis.CSharp (16)
_generated\0\Syntax.xml.Main.Generated.cs (1)
2089
=> node.Update(VisitList(node.AttributeLists), VisitList(node.Modifiers), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), (ExplicitInterfaceSpecifierSyntax?)Visit(node.ExplicitInterfaceSpecifier), VisitToken(node.Identifier), (AccessorListSyntax?)Visit(node.AccessorList), (ArrowExpressionClauseSyntax?)Visit(node.
ExpressionBody
), (EqualsValueClauseSyntax?)Visit(node.Initializer), VisitToken(node.SemicolonToken));
_generated\2\Syntax.xml.Syntax.Generated.cs (9)
13171
if (attributeLists != this.AttributeLists || modifiers != this.Modifiers || type != this.Type || explicitInterfaceSpecifier != this.ExplicitInterfaceSpecifier || identifier != this.Identifier || accessorList != this.AccessorList || expressionBody != this.
ExpressionBody
|| initializer != this.Initializer || semicolonToken != this.SemicolonToken)
13182
public new PropertyDeclarationSyntax WithAttributeLists(SyntaxList<AttributeListSyntax> attributeLists) => Update(attributeLists, this.Modifiers, this.Type, this.ExplicitInterfaceSpecifier, this.Identifier, this.AccessorList, this.
ExpressionBody
, this.Initializer, this.SemicolonToken);
13184
public new PropertyDeclarationSyntax WithModifiers(SyntaxTokenList modifiers) => Update(this.AttributeLists, modifiers, this.Type, this.ExplicitInterfaceSpecifier, this.Identifier, this.AccessorList, this.
ExpressionBody
, this.Initializer, this.SemicolonToken);
13186
public new PropertyDeclarationSyntax WithType(TypeSyntax type) => Update(this.AttributeLists, this.Modifiers, type, this.ExplicitInterfaceSpecifier, this.Identifier, this.AccessorList, this.
ExpressionBody
, this.Initializer, this.SemicolonToken);
13188
public new PropertyDeclarationSyntax WithExplicitInterfaceSpecifier(ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier) => Update(this.AttributeLists, this.Modifiers, this.Type, explicitInterfaceSpecifier, this.Identifier, this.AccessorList, this.
ExpressionBody
, this.Initializer, this.SemicolonToken);
13189
public PropertyDeclarationSyntax WithIdentifier(SyntaxToken identifier) => Update(this.AttributeLists, this.Modifiers, this.Type, this.ExplicitInterfaceSpecifier, identifier, this.AccessorList, this.
ExpressionBody
, this.Initializer, this.SemicolonToken);
13191
public new PropertyDeclarationSyntax WithAccessorList(AccessorListSyntax? accessorList) => Update(this.AttributeLists, this.Modifiers, this.Type, this.ExplicitInterfaceSpecifier, this.Identifier, accessorList, this.
ExpressionBody
, this.Initializer, this.SemicolonToken);
13193
public PropertyDeclarationSyntax WithInitializer(EqualsValueClauseSyntax? initializer) => Update(this.AttributeLists, this.Modifiers, this.Type, this.ExplicitInterfaceSpecifier, this.Identifier, this.AccessorList, this.
ExpressionBody
, initializer, this.SemicolonToken);
13194
public PropertyDeclarationSyntax WithSemicolonToken(SyntaxToken semicolonToken) => Update(this.AttributeLists, this.Modifiers, this.Type, this.ExplicitInterfaceSpecifier, this.Identifier, this.AccessorList, this.
ExpressionBody
, this.Initializer, semicolonToken);
Compilation\SyntaxTreeSemanticModel.cs (1)
934
GetOrAddModelIfContains(propertyDecl.
ExpressionBody
, span);
src\roslyn\src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (3)
244
if (t.
ExpressionBody
!= null)
246
ComputeDeclarations(model, associatedSymbol: null, t.
ExpressionBody
, shouldSkip, getSymbol, builder, levelsToCompute, cancellationToken);
451
arrowExpr = ((PropertyDeclarationSyntax)node).
ExpressionBody
;
Symbols\Source\SourcePropertySymbol.cs (1)
183
PropertyDeclarationSyntax p => p.
ExpressionBody
,
Syntax\SyntaxExtensions.cs (1)
47
arrowExpr = ((PropertyDeclarationSyntax)node).
ExpressionBody
;
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForPropertiesHelper.cs (1)
42
=> declaration.
ExpressionBody
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.cs (1)
192
PropertyDeclarationSyntax property => property.
ExpressionBody
,
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\PositionalParameterInfo.cs (1)
124
property.
ExpressionBody
!= null ||
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (1)
195
.WithExpressionBody(propertyDeclaration.
ExpressionBody
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (1)
201
if (declaration.
ExpressionBody
== null &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
270
if (propertyDeclaration.
ExpressionBody
!= null)
Microsoft.CodeAnalysis.CSharp.Features (20)
Completion\CompletionProviders\CompletionUtilities.cs (1)
229
else if (propertyDeclaration is PropertyDeclarationSyntax {
ExpressionBody
.Expression: { } expression })
EditAndContinue\BreakpointSpans.cs (2)
341
if (property.
ExpressionBody
!= null)
343
return property.
ExpressionBody
.Expression.Span;
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (3)
1192
var oldHasExpressionBody = oldNode is PropertyDeclarationSyntax {
ExpressionBody
: not null } or IndexerDeclarationSyntax { ExpressionBody: not null };
1193
var newHasExpressionBody = newNode is PropertyDeclarationSyntax {
ExpressionBody
: not null } or IndexerDeclarationSyntax { ExpressionBody: not null };
1319
if (node is PropertyDeclarationSyntax {
ExpressionBody
: not null } or IndexerDeclarationSyntax { ExpressionBody: not null })
EditAndContinue\DeclarationBody\PropertyOrIndexerWithExplicitBodyDeclarationBody.cs (1)
20
=> (propertyOrIndexer is PropertyDeclarationSyntax property) ? property.
ExpressionBody
! : ((IndexerDeclarationSyntax)propertyOrIndexer).ExpressionBody!;
EditAndContinue\SyntaxUtilities.cs (2)
143
return TryGetEffectiveGetterBody(property.
ExpressionBody
, property.AccessorList);
199
return property.
ExpressionBody
== null
GenerateConstructors\CSharpGenerateConstructorsCodeRefactoringProvider.cs (1)
66
var body = propertyDeclaration.
ExpressionBody
?? getAccessor?.ExpressionBody ?? (SyntaxNode?)getAccessor?.Body;
ReplaceMethodWithProperty\CSharpReplaceMethodWithPropertyService.cs (2)
95
if (propertyDeclaration.
ExpressionBody
!= null &&
96
propertyDeclaration.
ExpressionBody
.TryConvertToBlock(
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.cs (2)
199
if (propertyDeclaration.
ExpressionBody
!= null)
202
.WithExpressionBody(propertyDeclaration.
ExpressionBody
)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForPropertiesHelper.cs (1)
42
=> declaration.
ExpressionBody
;
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\PositionalParameterInfo.cs (1)
124
property.
ExpressionBody
!= null ||
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (1)
195
.WithExpressionBody(propertyDeclaration.
ExpressionBody
)
src\roslyn\src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (3)
244
if (t.
ExpressionBody
!= null)
246
ComputeDeclarations(model, associatedSymbol: null, t.
ExpressionBody
, shouldSkip, getSymbol, builder, levelsToCompute, cancellationToken);
451
arrowExpr = ((PropertyDeclarationSyntax)node).
ExpressionBody
;
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (1)
Microsoft.NetCore.Analyzers\Performance\CSharpUseSearchValues.cs (1)
69
var expression = propertyDeclaration.
ExpressionBody
?.Expression;
Microsoft.CodeAnalysis.CSharp.Workspaces (8)
CodeGeneration\CSharpSyntaxGenerator.cs (5)
2425
if (pd.
ExpressionBody
!= null)
2427
return pd.
ExpressionBody
.Expression;
2481
if (pd.
ExpressionBody
!= null)
2483
return ReplaceWithTrivia(pd, pd.
ExpressionBody
.Expression, expr);
2700
SyntaxKind.PropertyDeclaration => ((PropertyDeclarationSyntax)declaration).
ExpressionBody
== null,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.cs (1)
192
PropertyDeclarationSyntax property => property.
ExpressionBody
,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (1)
201
if (declaration.
ExpressionBody
== null &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
270
if (propertyDeclaration.
ExpressionBody
!= null)
Roslyn.Diagnostics.CSharp.Analyzers (3)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.cs (1)
192
PropertyDeclarationSyntax property => property.
ExpressionBody
,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (1)
201
if (declaration.
ExpressionBody
== null &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
270
if (propertyDeclaration.
ExpressionBody
!= null)
System.Private.CoreLib.Generators (1)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (1)
294
&& propertyDeclaration.
ExpressionBody
is ArrowExpressionClauseSyntax arrowExpression)