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