63 references to ExpressionBody
Microsoft.CodeAnalysis.CSharp (16)
Compilation\SyntaxTreeSemanticModel.cs (1)
934GetOrAddModelIfContains(propertyDecl.ExpressionBody, span);
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (3)
244if (t.ExpressionBody != null) 246ComputeDeclarations(model, associatedSymbol: null, t.ExpressionBody, shouldSkip, getSymbol, builder, levelsToCompute, cancellationToken); 451arrowExpr = ((PropertyDeclarationSyntax)node).ExpressionBody;
Symbols\Source\SourcePropertySymbol.cs (1)
184PropertyDeclarationSyntax p => p.ExpressionBody,
Syntax.xml.Main.Generated.cs (1)
2077=> 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));
Syntax.xml.Syntax.Generated.cs (9)
13124if (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) 13135public new PropertyDeclarationSyntax WithAttributeLists(SyntaxList<AttributeListSyntax> attributeLists) => Update(attributeLists, this.Modifiers, this.Type, this.ExplicitInterfaceSpecifier, this.Identifier, this.AccessorList, this.ExpressionBody, this.Initializer, this.SemicolonToken); 13137public new PropertyDeclarationSyntax WithModifiers(SyntaxTokenList modifiers) => Update(this.AttributeLists, modifiers, this.Type, this.ExplicitInterfaceSpecifier, this.Identifier, this.AccessorList, this.ExpressionBody, this.Initializer, this.SemicolonToken); 13139public new PropertyDeclarationSyntax WithType(TypeSyntax type) => Update(this.AttributeLists, this.Modifiers, type, this.ExplicitInterfaceSpecifier, this.Identifier, this.AccessorList, this.ExpressionBody, this.Initializer, this.SemicolonToken); 13141public new PropertyDeclarationSyntax WithExplicitInterfaceSpecifier(ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier) => Update(this.AttributeLists, this.Modifiers, this.Type, explicitInterfaceSpecifier, this.Identifier, this.AccessorList, this.ExpressionBody, this.Initializer, this.SemicolonToken); 13142public PropertyDeclarationSyntax WithIdentifier(SyntaxToken identifier) => Update(this.AttributeLists, this.Modifiers, this.Type, this.ExplicitInterfaceSpecifier, identifier, this.AccessorList, this.ExpressionBody, this.Initializer, this.SemicolonToken); 13144public new PropertyDeclarationSyntax WithAccessorList(AccessorListSyntax? accessorList) => Update(this.AttributeLists, this.Modifiers, this.Type, this.ExplicitInterfaceSpecifier, this.Identifier, accessorList, this.ExpressionBody, this.Initializer, this.SemicolonToken); 13146public PropertyDeclarationSyntax WithInitializer(EqualsValueClauseSyntax? initializer) => Update(this.AttributeLists, this.Modifiers, this.Type, this.ExplicitInterfaceSpecifier, this.Identifier, this.AccessorList, this.ExpressionBody, initializer, this.SemicolonToken); 13147public PropertyDeclarationSyntax WithSemicolonToken(SyntaxToken semicolonToken) => Update(this.AttributeLists, this.Modifiers, this.Type, this.ExplicitInterfaceSpecifier, this.Identifier, this.AccessorList, this.ExpressionBody, this.Initializer, semicolonToken);
Syntax\SyntaxExtensions.cs (1)
47arrowExpr = ((PropertyDeclarationSyntax)node).ExpressionBody;
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForPropertiesHelper.cs (1)
42=> declaration.ExpressionBody;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.cs (1)
189PropertyDeclarationSyntax property => property.ExpressionBody,
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\PositionalParameterInfo.cs (1)
124property.ExpressionBody != null ||
src\Analyzers\CSharp\CodeFixes\UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (1)
195.WithExpressionBody(propertyDeclaration.ExpressionBody)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (1)
201if (declaration.ExpressionBody == null &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
270if (propertyDeclaration.ExpressionBody != null)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
AutomaticCompletion\AutomaticLineEnderCommandHandler_Helpers.cs (1)
812&& propertyDeclarationNode.ExpressionBody == null)
Microsoft.CodeAnalysis.CSharp.Features (20)
Completion\CompletionProviders\CompletionUtilities.cs (1)
227else if (propertyDeclaration is PropertyDeclarationSyntax { ExpressionBody.Expression: { } expression })
EditAndContinue\BreakpointSpans.cs (2)
341if (property.ExpressionBody != null) 343return property.ExpressionBody.Expression.Span;
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (3)
1192var oldHasExpressionBody = oldNode is PropertyDeclarationSyntax { ExpressionBody: not null } or IndexerDeclarationSyntax { ExpressionBody: not null }; 1193var newHasExpressionBody = newNode is PropertyDeclarationSyntax { ExpressionBody: not null } or IndexerDeclarationSyntax { ExpressionBody: not null }; 1319if (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)
143return TryGetEffectiveGetterBody(property.ExpressionBody, property.AccessorList); 199return property.ExpressionBody == null
GenerateConstructors\CSharpGenerateConstructorsCodeRefactoringProvider.cs (1)
66var body = propertyDeclaration.ExpressionBody ?? getAccessor?.ExpressionBody ?? (SyntaxNode?)getAccessor?.Body;
ReplaceMethodWithProperty\CSharpReplaceMethodWithPropertyService.cs (2)
95if (propertyDeclaration.ExpressionBody != null && 96propertyDeclaration.ExpressionBody.TryConvertToBlock(
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.cs (2)
190if (propertyDeclaration.ExpressionBody != null) 193.WithExpressionBody(propertyDeclaration.ExpressionBody)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForPropertiesHelper.cs (1)
42=> declaration.ExpressionBody;
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\PositionalParameterInfo.cs (1)
124property.ExpressionBody != null ||
src\Analyzers\CSharp\CodeFixes\UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (1)
195.WithExpressionBody(propertyDeclaration.ExpressionBody)
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (3)
244if (t.ExpressionBody != null) 246ComputeDeclarations(model, associatedSymbol: null, t.ExpressionBody, shouldSkip, getSymbol, builder, levelsToCompute, cancellationToken); 451arrowExpr = ((PropertyDeclarationSyntax)node).ExpressionBody;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Compilation\SemanticModelAPITests.cs (1)
1629var expressionBody = propertyDecl.ExpressionBody;
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (5)
Generated\Syntax.Test.xml.Generated.cs (2)
13537Assert.Null(node.ExpressionBody); 13540var newNode = node.WithAttributeLists(node.AttributeLists).WithModifiers(node.Modifiers).WithType(node.Type).WithExplicitInterfaceSpecifier(node.ExplicitInterfaceSpecifier).WithIdentifier(node.Identifier).WithAccessorList(node.AccessorList).WithExpressionBody(node.ExpressionBody).WithInitializer(node.Initializer).WithSemicolonToken(node.SemicolonToken);
Parsing\DeclarationParsingTests.cs (3)
2914Assert.NotNull(propertySyntax.ExpressionBody); 2915Assert.NotEqual(SyntaxKind.None, propertySyntax.ExpressionBody.ArrowToken.Kind()); 2916Assert.NotNull(propertySyntax.ExpressionBody.Expression);
Microsoft.CodeAnalysis.CSharp.Workspaces (8)
CodeGeneration\CSharpSyntaxGenerator.cs (5)
2435if (pd.ExpressionBody != null) 2437return pd.ExpressionBody.Expression; 2491if (pd.ExpressionBody != null) 2493return ReplaceWithTrivia(pd, pd.ExpressionBody.Expression, expr); 2710SyntaxKind.PropertyDeclaration => ((PropertyDeclarationSyntax)declaration).ExpressionBody == null,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.cs (1)
189PropertyDeclarationSyntax property => property.ExpressionBody,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (1)
201if (declaration.ExpressionBody == null &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
270if (propertyDeclaration.ExpressionBody != null)
Microsoft.VisualStudio.LanguageServices.CSharp (2)
CodeModel\CSharpCodeModelService.cs (2)
1469=> (node as PropertyDeclarationSyntax)?.ExpressionBody != null; 1473accessorNode = (parentNode as PropertyDeclarationSyntax)?.ExpressionBody;
Roslyn.Diagnostics.CSharp.Analyzers (3)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.cs (1)
189PropertyDeclarationSyntax property => property.ExpressionBody,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (1)
201if (declaration.ExpressionBody == null &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
270if (propertyDeclaration.ExpressionBody != null)
System.Private.CoreLib.Generators (1)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (1)
294&& propertyDeclaration.ExpressionBody is ArrowExpressionClauseSyntax arrowExpression)