Base:
property
AccessorList
Microsoft.CodeAnalysis.CSharp.Syntax.BasePropertyDeclarationSyntax.AccessorList
102 references to AccessorList
Microsoft.AspNetCore.Components.Analyzers (3)
ComponentParameterAnalyzer.cs (3)
153
syntax.
AccessorList
?.Accessors.Count == 2)
155
var getterAccessor = syntax.
AccessorList
.Accessors[0];
156
var setterAccessor = syntax.
AccessorList
.Accessors[1];
Microsoft.CodeAnalysis.CSharp (17)
_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 (10)
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);
13192
public PropertyDeclarationSyntax WithExpressionBody(ArrowExpressionClauseSyntax? expressionBody) => Update(this.AttributeLists, this.Modifiers, this.Type, this.ExplicitInterfaceSpecifier, this.Identifier, this.
AccessorList
, 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);
13203
var accessorList = this.
AccessorList
?? SyntaxFactory.AccessorList();
src\roslyn\src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (2)
236
if (t.
AccessorList
!= null)
238
foreach (var decl in t.
AccessorList
.Accessors)
Symbols\Source\SourceMemberContainerSymbol.cs (2)
3134
propertyDecl.
AccessorList
!= null &&
3135
All(propertyDecl.
AccessorList
.Accessors, a => a.Body == null && a.ExpressionBody == null);
Syntax\SyntaxNormalizer.cs (2)
1473
return property.
AccessorList
is null || IsAccessorListWithoutAccessorsWithBlockBody(property.
AccessorList
);
Microsoft.CodeAnalysis.CSharp.CodeStyle (14)
src\roslyn\src\Analyzers\CSharp\Analyzers\SimplifyPropertyAccessor\CSharpSimplifyPropertyAccessorDiagnosticAnalyzer.cs (1)
40
if (propertyDeclaration.
AccessorList
is not { } accessorList ||
src\roslyn\src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForPropertiesHelper.cs (2)
39
=> GetBodyFromSingleGetAccessor(declaration.
AccessorList
);
91
var getAccessor = GetSingleGetAccessor(declaration.
AccessorList
);
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (2)
116
if (property.
AccessorList
is null ||
117
property.
AccessorList
.Accessors.Any(static a => a.ExpressionBody != null || a.Body != null))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (2)
170
if (propertyDeclNode is { Initializer: not null,
AccessorList
: not null })
172
AddSuppressWrappingIfOnSingleLineOperation(list, firstToken, propertyDeclNode.
AccessorList
.GetLastToken());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\WrappingFormattingRule.cs (3)
161
if (node is PropertyDeclarationSyntax {
AccessorList
: not null } propertyDeclaration)
163
return (propertyDeclaration.
AccessorList
.OpenBraceToken, propertyDeclaration.
AccessorList
.CloseBraceToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (4)
123
AreTwoTokensOnSameLine(propertyDeclaration.
AccessorList
!.OpenBraceToken, propertyDeclaration.
AccessorList
.CloseBraceToken))
125
return (propertyDeclaration.
AccessorList
.OpenBraceToken, propertyDeclaration.
AccessorList
.CloseBraceToken);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (10)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\PositionalParameterInfo.cs (3)
140
if (property.
AccessorList
== null || property.
AccessorList
.Accessors.IsEmpty())
161
var accessors = property.
AccessorList
.Accessors;
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (4)
193
var accessorList = propertyDeclaration.
AccessorList
?? AccessorList(SingletonList(
225
if (propertyDeclaration is PropertyDeclarationSyntax {
AccessorList
.Accessors: var accessors } &&
237
if (propertyDeclaration.
AccessorList
!= null &&
238
propertyDeclaration.
AccessorList
.Accessors.Any(IsSetOrInitAccessor))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (3)
283
if (propertyDeclaration.
AccessorList
!= null)
285
var accessors = propertyDeclaration.
AccessorList
.Accessors.Select(RemoveThrowNotImplemented);
287
propertyDeclaration.
AccessorList
.WithAccessors([.. accessors]));
Microsoft.CodeAnalysis.CSharp.Features (26)
ConvertAutoPropertyToFullProperty\CSharpConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (2)
66
var accessorListSyntax = property.
AccessorList
;
138
AccessorList
.Accessors: [AccessorDeclarationSyntax(SyntaxKind.GetAccessorDeclaration)
EditAndContinue\BreakpointSpans.cs (2)
353
Contract.ThrowIfNull(property.
AccessorList
);
357
return CreateSpanForAccessors(property.
AccessorList
.Accessors, position);
EditAndContinue\SyntaxUtilities.cs (2)
143
return TryGetEffectiveGetterBody(property.ExpressionBody, property.
AccessorList
);
200
&& property.
AccessorList
!.Accessors.Any(e => e is { Body: null, ExpressionBody: null });
GenerateConstructors\CSharpGenerateConstructorsCodeRefactoringProvider.cs (1)
65
var getAccessor = propertyDeclaration.
AccessorList
?.Accessors.FirstOrDefault(a => a.Kind() == SyntaxKind.GetAccessorDeclaration);
ReplaceMethodWithProperty\CSharpReplaceMethodWithPropertyService.cs (1)
74
if (propertyDeclaration.
AccessorList
is { Accessors: [(kind: SyntaxKind.GetAccessorDeclaration) getAccessor] })
Snippets\AbstractCSharpAutoPropertySnippetProvider.cs (1)
76
=> propertyDeclaration.
AccessorList
!.CloseBraceToken.Span.End;
src\roslyn\src\Analyzers\CSharp\Analyzers\SimplifyPropertyAccessor\CSharpSimplifyPropertyAccessorDiagnosticAnalyzer.cs (1)
40
if (propertyDeclaration.
AccessorList
is not { } accessorList ||
src\roslyn\src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForPropertiesHelper.cs (2)
39
=> GetBodyFromSingleGetAccessor(declaration.
AccessorList
);
91
var getAccessor = GetSingleGetAccessor(declaration.
AccessorList
);
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (2)
116
if (property.
AccessorList
is null ||
117
property.
AccessorList
.Accessors.Any(static a => a.ExpressionBody != null || a.Body != null))
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\PositionalParameterInfo.cs (3)
140
if (property.
AccessorList
== null || property.
AccessorList
.Accessors.IsEmpty())
161
var accessors = property.
AccessorList
.Accessors;
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (4)
193
var accessorList = propertyDeclaration.
AccessorList
?? AccessorList(SingletonList(
225
if (propertyDeclaration is PropertyDeclarationSyntax {
AccessorList
.Accessors: var accessors } &&
237
if (propertyDeclaration.
AccessorList
!= null &&
238
propertyDeclaration.
AccessorList
.Accessors.Any(IsSetOrInitAccessor))
src\roslyn\src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (2)
236
if (t.
AccessorList
!= null)
238
foreach (var decl in t.
AccessorList
.Accessors)
Structure\Providers\PropertyDeclarationStructureProvider.cs (3)
24
if (propertyDeclaration.
AccessorList
== null ||
25
propertyDeclaration.
AccessorList
.OpenBraceToken.IsMissing ||
26
propertyDeclaration.
AccessorList
.CloseBraceToken.IsMissing)
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (4)
Microsoft.NetCore.Analyzers\InteropServices\CSharpDynamicInterfaceCastableImplementation.Fixer.cs (3)
126
foreach (var accessor in propertyDeclaration.
AccessorList
!.Accessors)
137
propertyDeclaration = propertyDeclaration.WithAccessorList(propertyDeclaration.
AccessorList
.RemoveNode(oldInitAccessor, SyntaxRemoveOptions.KeepNoTrivia));
140
return propertyDeclaration.WithAccessorList(propertyDeclaration.
AccessorList
!.AddAccessors(
Microsoft.NetCore.Analyzers\Performance\CSharpUseSearchValues.cs (1)
72
propertyDeclaration.
AccessorList
?.Accessors is [var accessor] &&
Microsoft.CodeAnalysis.CSharp.Workspaces (16)
CodeGeneration\CSharpSyntaxGenerator.cs (4)
449
property.WithAccessorList(CreateAccessorList(property.
AccessorList
, accessorDeclarations))
662
return (prop.
AccessorList
!= null) ? prop.WithAccessorList(WithBodies(prop.
AccessorList
)) : prop;
835
.WithAccessorList(WithoutBodies(property.
AccessorList
));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (2)
170
if (propertyDeclNode is { Initializer: not null,
AccessorList
: not null })
172
AddSuppressWrappingIfOnSingleLineOperation(list, firstToken, propertyDeclNode.
AccessorList
.GetLastToken());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\WrappingFormattingRule.cs (3)
161
if (node is PropertyDeclarationSyntax {
AccessorList
: not null } propertyDeclaration)
163
return (propertyDeclaration.
AccessorList
.OpenBraceToken, propertyDeclaration.
AccessorList
.CloseBraceToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (4)
123
AreTwoTokensOnSameLine(propertyDeclaration.
AccessorList
!.OpenBraceToken, propertyDeclaration.
AccessorList
.CloseBraceToken))
125
return (propertyDeclaration.
AccessorList
.OpenBraceToken, propertyDeclaration.
AccessorList
.CloseBraceToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (3)
283
if (propertyDeclaration.
AccessorList
!= null)
285
var accessors = propertyDeclaration.
AccessorList
.Accessors.Select(RemoveThrowNotImplemented);
287
propertyDeclaration.
AccessorList
.WithAccessors([.. accessors]));
Roslyn.Diagnostics.CSharp.Analyzers (12)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (2)
170
if (propertyDeclNode is { Initializer: not null,
AccessorList
: not null })
172
AddSuppressWrappingIfOnSingleLineOperation(list, firstToken, propertyDeclNode.
AccessorList
.GetLastToken());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\WrappingFormattingRule.cs (3)
161
if (node is PropertyDeclarationSyntax {
AccessorList
: not null } propertyDeclaration)
163
return (propertyDeclaration.
AccessorList
.OpenBraceToken, propertyDeclaration.
AccessorList
.CloseBraceToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (4)
123
AreTwoTokensOnSameLine(propertyDeclaration.
AccessorList
!.OpenBraceToken, propertyDeclaration.
AccessorList
.CloseBraceToken))
125
return (propertyDeclaration.
AccessorList
.OpenBraceToken, propertyDeclaration.
AccessorList
.CloseBraceToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (3)
283
if (propertyDeclaration.
AccessorList
!= null)
285
var accessors = propertyDeclaration.
AccessorList
.Accessors.Select(RemoveThrowNotImplemented);
287
propertyDeclaration.
AccessorList
.WithAccessors([.. accessors]));