481 references to PropertyDeclarationSyntax
ILLink.CodeFixProvider (2)
BaseAttributeCodeFixProvider.cs (2)
101 case PropertyDeclarationSyntax when targets.HasFlag (AttributeableParentTargets.Property): 104 case PropertyDeclarationSyntax:
Microsoft.AspNetCore.App.Analyzers (1)
RouteEmbeddedLanguage\Infrastructure\RouteStringSyntaxDetector.cs (1)
234=> node?.Parent is PropertyDeclarationSyntax propertyDeclaration && propertyDeclaration.Initializer == node;
Microsoft.AspNetCore.Components.Analyzers (5)
ComponentParameterAnalyzer.cs (1)
152symbol.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken) is PropertyDeclarationSyntax syntax &&
ComponentParametersShouldBePublicCodeFixProvider.cs (4)
38var declaration = root.FindToken(diagnosticSpan.Start).Parent.AncestorsAndSelf().OfType<PropertyDeclarationSyntax>().First(); 53PropertyDeclarationSyntax declarationNode) 60private static SyntaxNode HandlePropertyDeclaration(PropertyDeclarationSyntax node)
Microsoft.AspNetCore.Components.SdkAnalyzers (4)
ComponentParametersShouldBePublicCodeFixProvider.cs (4)
38var declaration = root.FindToken(diagnosticSpan.Start).Parent.AncestorsAndSelf().OfType<PropertyDeclarationSyntax>().First(); 53PropertyDeclarationSyntax declarationNode) 60private static SyntaxNode HandlePropertyDeclaration(PropertyDeclarationSyntax node)
Microsoft.CodeAnalysis.CSharp (48)
Binder\Binder_Statements.cs (1)
3552PropertyDeclarationSyntax => MessageID.IDS_FeatureExpressionBodiedProperty,
Binder\BinderFactory.BinderFactoryVisitor.cs (3)
388public override Binder VisitPropertyDeclaration(PropertyDeclarationSyntax parent) 493var propertyDecl = (PropertyDeclarationSyntax)basePropertyDeclarationSyntax;
Compilation\CSharpSemanticModel.cs (1)
3024public abstract IPropertySymbol GetDeclaredSymbol(PropertyDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken));
Compilation\InitializerSemanticModel.cs (2)
101rootSyntax = ((PropertyDeclarationSyntax)rootSyntax).Initializer; 126equalsValue = ((PropertyDeclarationSyntax)node).Initializer;
Compilation\MemberSemanticModel.cs (1)
650public override IPropertySymbol GetDeclaredSymbol(PropertyDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken))
Compilation\SpeculativeSemanticModelWithMemberModel.cs (1)
305public override IPropertySymbol GetDeclaredSymbol(PropertyDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken))
Compilation\SyntaxTreeSemanticModel.cs (7)
932var propertyDecl = (PropertyDeclarationSyntax)memberDecl; 1137var propertyDecl = (PropertyDeclarationSyntax)node.Parent; 1530public override IPropertySymbol GetDeclaredSymbol(PropertyDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1634var propertyDecl = (PropertyDeclarationSyntax)declaration;
CSharpExtensions.cs (1)
1427public static IPropertySymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, PropertyDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken))
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (2)
602PropertyDeclarationSyntax propertySyntax = (PropertyDeclarationSyntax)syntax;
Lowering\Instrumentation\DebugInfoInjector.cs (2)
150var declaration = (PropertyDeclarationSyntax)grandparent;
Lowering\Instrumentation\DebugInfoInjector_SequencePoints.cs (1)
28internal static BoundStatement AddSequencePoint(PropertyDeclarationSyntax declarationSyntax, BoundStatement rewrittenStatement)
Parser\LanguageParser.cs (2)
4001private PropertyDeclarationSyntax ParsePropertyDeclaration( 5085return ((CSharp.Syntax.PropertyDeclarationSyntax)decl).Modifiers;
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (3)
211var t = (PropertyDeclarationSyntax)node; 398arrowExpr = ((PropertyDeclarationSyntax)node).ExpressionBody;
Symbols\Source\SourceMemberContainerSymbol.cs (4)
2796var propertyDecl = (PropertyDeclarationSyntax)m; 5015var propertySyntax = (PropertyDeclarationSyntax)m;
Symbols\Source\SourcePropertySymbol.cs (4)
19internal static SourcePropertySymbol Create(SourceMemberContainerTypeSymbol containingType, Binder bodyBinder, PropertyDeclarationSyntax syntax, BindingDiagnosticBag diagnostics) 162if (syntax is PropertyDeclarationSyntax { Initializer: { } initializer }) 183PropertyDeclarationSyntax p => p.ExpressionBody, 189=> syntax is PropertyDeclarationSyntax { Initializer: { } };
Symbols\Source\SourcePropertySymbolBase.cs (1)
241string interfacePropertyName = IsIndexer ? WellKnownMemberNames.Indexer : ((PropertyDeclarationSyntax)syntax).Identifier.ValueText;
Syntax\LookupPosition.cs (1)
49PropertyDeclarationSyntax property)
Syntax\PropertyDeclarationSyntax.cs (1)
25public PropertyDeclarationSyntax WithSemicolon(SyntaxToken semicolon)
Syntax\SyntaxExtensions.cs (1)
47arrowExpr = ((PropertyDeclarationSyntax)node).ExpressionBody;
Syntax\SyntaxFactory.cs (1)
2450public static PropertyDeclarationSyntax PropertyDeclaration(
Syntax\SyntaxFacts.cs (1)
179return ((PropertyDeclarationSyntax)parent).Type == node;
Syntax\SyntaxNormalizer.cs (7)
314=> node is AccessorListSyntax { Parent: PropertyDeclarationSyntax { Initializer: not null } }; 383if (currentTokenParent?.Parent is PropertyDeclarationSyntax property && IsSingleLineProperty(property) && 384nextToken.Parent is PropertyDeclarationSyntax nextProperty && IsSingleLineProperty(nextProperty)) 438else if (currentToken.Parent is PropertyDeclarationSyntax property) 448Debug.Assert(((PropertyDeclarationSyntax)currentToken.Parent).SemicolonToken == currentToken); 451nextToken.Parent is PropertyDeclarationSyntax nextProperty && 1445private static bool IsSingleLineProperty(PropertyDeclarationSyntax property)
Microsoft.CodeAnalysis.CSharp.CodeStyle (39)
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (2)
188reference.GetSyntax(cancellationToken) is PropertyDeclarationSyntax property && 201PropertyDeclarationSyntax propertyDeclaration => propertyDeclaration.Identifier,
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (2)
23PropertyDeclarationSyntax, 54protected override bool ContainsFieldExpression(PropertyDeclarationSyntax propertyDeclaration, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForPropertiesHelper.cs (17)
19UseExpressionBodyHelper<PropertyDeclarationSyntax> 36protected override BlockSyntax GetBody(PropertyDeclarationSyntax declaration) 39protected override ArrowExpressionClauseSyntax GetExpressionBody(PropertyDeclarationSyntax declaration) 42protected override SyntaxToken GetSemicolonToken(PropertyDeclarationSyntax declaration) 45protected override PropertyDeclarationSyntax WithSemicolonToken(PropertyDeclarationSyntax declaration, SyntaxToken token) 48protected override PropertyDeclarationSyntax WithExpressionBody(PropertyDeclarationSyntax declaration, ArrowExpressionClauseSyntax expressionBody) 51protected override PropertyDeclarationSyntax WithAccessorList(PropertyDeclarationSyntax declaration, AccessorListSyntax accessorListSyntax) 54protected override PropertyDeclarationSyntax WithBody(PropertyDeclarationSyntax declaration, BlockSyntax body) 64protected override PropertyDeclarationSyntax WithGenerateBody(SemanticModel semanticModel, PropertyDeclarationSyntax declaration) 67protected override bool CreateReturnStatementForExpression(SemanticModel semanticModel, PropertyDeclarationSyntax declaration) => true; 70PropertyDeclarationSyntax declaration, 79protected override Location GetDiagnosticLocation(PropertyDeclarationSyntax declaration)
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (2)
109if (nodeToRemove is not VariableDeclaratorSyntax and not PropertyDeclarationSyntax) 114if (nodeToRemove is PropertyDeclarationSyntax property)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.cs (3)
48return ((PropertyDeclarationSyntax)member).Identifier; 151return ((PropertyDeclarationSyntax)member).Type; 181PropertyDeclarationSyntax property => property.ExpressionBody,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
480public static IPropertySymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, PropertyDeclarationSyntax syntax, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (2)
352case PropertyDeclarationSyntax property: 354node.IsFoundUnder((PropertyDeclarationSyntax p) => p.Initializer);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (2)
169var propertyDeclNode = node as PropertyDeclarationSyntax;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\WrappingFormattingRule.cs (1)
165if (node is PropertyDeclarationSyntax propertyDeclaration && propertyDeclaration.AccessorList != null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SelectedMembers\CSharpSelectedMembers.cs (1)
20PropertyDeclarationSyntax,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
58return ((PropertyDeclarationSyntax)declaration).ExplicitInterfaceSpecifier == null;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpHeaderFacts.cs (1)
40var node = TryGetAncestorForLocation<PropertyDeclarationSyntax>(root, position);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
1389=> ((PropertyDeclarationSyntax)node).Initializer; 1398=> node?.Parent is PropertyDeclarationSyntax propertyDeclaration && propertyDeclaration.Initializer == node;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (2)
125PropertyDeclarationSyntax or 138if (GetEnclosingMember(endToken) is PropertyDeclarationSyntax propertyDeclaration &&
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (35)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (3)
56.OfType<PropertyDeclarationSyntax>() 122var property = result.Declaration; 588var p = result.Declaration;
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\PositionalParameterInfo.cs (3)
25PropertyDeclarationSyntax? Declaration, 36ImmutableArray<PropertyDeclarationSyntax> properties, 117PropertyDeclarationSyntax property,
src\Analyzers\CSharp\CodeFixes\GenerateVariable\CSharpGenerateVariableCodeFixProvider.cs (1)
41=> node is SimpleNameSyntax or PropertyDeclarationSyntax or MemberBindingExpressionSyntax;
src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.cs (1)
37var originalNode = token.GetAncestor<PropertyDeclarationSyntax>() ??
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (2)
87var oldAccessor = node.Parent?.Parent as PropertyDeclarationSyntax;
src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (1)
50if (node is not (PropertyDeclarationSyntax or VariableDeclaratorSyntax { Parent.Parent: FieldDeclarationSyntax }))
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (4)
152PropertyDeclarationSyntax property => 205if (syntax is PropertyDeclarationSyntax declaration) 240if (node.Parent?.Parent is PropertyDeclarationSyntax propertyDeclaration) 245if (node is PropertyDeclarationSyntax propertyDeclarationSyntax)
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
452else if (declaration is PropertyDeclarationSyntax propertyDeclaration)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
796var propertyDeclaration = (PropertyDeclarationSyntax)syntaxNode;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpDeclarationComparer.cs (4)
130return Compare((PropertyDeclarationSyntax)x, (PropertyDeclarationSyntax)y); 260private int Compare(PropertyDeclarationSyntax x, PropertyDeclarationSyntax y)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (4)
32var lastProperty = members.LastOrDefault(m => m is PropertyDeclarationSyntax); 122var propertyDeclaration = PropertyDeclaration( 179private static PropertyDeclarationSyntax UseExpressionBodyIfDesired( 180CSharpCodeGenerationContextInfo info, PropertyDeclarationSyntax declaration, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\BasePropertyDeclarationSyntaxExtensions.cs (6)
13/// Available if <paramref name="node"/> is <see cref="PropertyDeclarationSyntax"/> or <see cref="IndexerDeclarationSyntax"/>. 21case SyntaxKind.PropertyDeclaration: return ((PropertyDeclarationSyntax)node).SemicolonToken; 30/// Available if <paramref name="node"/> is <see cref="PropertyDeclarationSyntax"/> or <see cref="IndexerDeclarationSyntax"/>. 39case SyntaxKind.PropertyDeclaration: return ((PropertyDeclarationSyntax)node).WithSemicolonToken(semicolonToken); 48/// Available if <paramref name="node"/> is <see cref="PropertyDeclarationSyntax"/> or <see cref="IndexerDeclarationSyntax"/>. 57case SyntaxKind.PropertyDeclaration: return ((PropertyDeclarationSyntax)node).WithExpressionBody(expressionBody);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
522targetToken.IsAccessorDeclarationContext<PropertyDeclarationSyntax>(position, kind) ||
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
1201if (equalsValue?.Parent is PropertyDeclarationSyntax propertyDecl) 1213private IEnumerable<TypeInferenceInfo> InferTypeInPropertyDeclaration(PropertyDeclarationSyntax propertyDeclaration)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (5)
AutomaticCompletion\AutomaticLineEnderCommandHandler_Helpers.cs (5)
568&& parentOfParent is PropertyDeclarationSyntax) 779PropertyDeclarationSyntax propertyDeclarationNode => ShouldRemoveBraceForPropertyDeclaration(propertyDeclarationNode, caretPosition), 805private static bool ShouldRemoveBraceForPropertyDeclaration(PropertyDeclarationSyntax propertyDeclarationNode, int caretPosition) 972PropertyDeclarationSyntax propertyDeclarationNode => ConvertPropertyDeclarationToFieldDeclaration(propertyDeclarationNode), 1005PropertyDeclarationSyntax propertyDeclarationNode)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (5)
RefactoringHelpers\RefactoringHelpersTests.cs (3)
1016await TestMissingAsync<PropertyDeclarationSyntax>(testText); 1142await TestAsync<PropertyDeclarationSyntax>(testText); 1156await TestMissingAsync<PropertyDeclarationSyntax>(testText);
Structure\MetadataAsSource\PropertyDeclarationStructureTests.cs (1)
14public class PropertyDeclarationStructureTests : AbstractCSharpSyntaxNodeStructureTests<PropertyDeclarationSyntax>
Structure\PropertyDeclarationStructureTests.cs (1)
15public class PropertyDeclarationStructureTests : AbstractCSharpSyntaxNodeStructureTests<PropertyDeclarationSyntax>
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (4)
Diagnostics\GetDiagnosticsTests.cs (2)
992if (operationBlock.Syntax is PropertyDeclarationSyntax or IndexerDeclarationSyntax) 1018PropertyDeclarationSyntax propertyDecl => propertyDecl.Identifier.GetLocation(),
FieldKeywordTests.cs (1)
9474return tree.GetRoot().DescendantNodes().OfType<PropertyDeclarationSyntax>().
FlowAnalysis\FlowTests.cs (1)
5841var declarations = tree.GetRoot().DescendantNodes().OfType<PropertyDeclarationSyntax>().ToImmutableArray();
Microsoft.CodeAnalysis.CSharp.Features (136)
CodeLens\CSharpCodeLensMemberFinder.cs (1)
61public override void VisitPropertyDeclaration(PropertyDeclarationSyntax node)
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (1)
193result = IsLastTokenOfType<PropertyDeclarationSyntax>(
Completion\CompletionProviders\OverrideCompletionProvider.cs (1)
38?? token.GetAncestor<PropertyDeclarationSyntax>()
Completion\CompletionProviders\PartialMethodCompletionProvider.cs (1)
58?? token.GetAncestor<PropertyDeclarationSyntax>()
Completion\KeywordRecommenders\FieldKeywordRecommender.cs (2)
48if (node is ArrowExpressionClauseSyntax { Parent: PropertyDeclarationSyntax }) 51if (node is AccessorDeclarationSyntax { Parent: AccessorListSyntax { Parent: PropertyDeclarationSyntax } })
Completion\KeywordRecommenders\GetKeywordRecommender.cs (1)
21context.TargetToken.IsAccessorDeclarationContext<PropertyDeclarationSyntax>(position, SyntaxKind.GetKeyword) ||
Completion\KeywordRecommenders\InitKeywordRecommender.cs (1)
21context.TargetToken.IsAccessorDeclarationContext<PropertyDeclarationSyntax>(position, SyntaxKind.InitKeyword) ||
Completion\KeywordRecommenders\InternalKeywordRecommender.cs (1)
30if (context.TargetToken.IsAccessorDeclarationContext<PropertyDeclarationSyntax>(context.Position) ||
Completion\KeywordRecommenders\MethodKeywordRecommender.cs (1)
26Parent: PropertyDeclarationSyntax
Completion\KeywordRecommenders\ParamKeywordRecommender.cs (1)
31if (token.GetAncestor<PropertyDeclarationSyntax>() != null ||
Completion\KeywordRecommenders\PrivateKeywordRecommender.cs (1)
31if (context.TargetToken.IsAccessorDeclarationContext<PropertyDeclarationSyntax>(context.Position) ||
Completion\KeywordRecommenders\ProtectedKeywordRecommender.cs (1)
29if (context.TargetToken.IsAccessorDeclarationContext<PropertyDeclarationSyntax>(context.Position) ||
Completion\KeywordRecommenders\SetKeywordRecommender.cs (1)
21context.TargetToken.IsAccessorDeclarationContext<PropertyDeclarationSyntax>(position, SyntaxKind.SetKeyword) ||
ConvertAutoPropertyToFullProperty\CSharpConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (6)
29internal class CSharpConvertAutoPropertyToFullPropertyCodeRefactoringProvider : AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider<PropertyDeclarationSyntax, TypeDeclarationSyntax, CSharpCodeGenerationContextInfo> 55var accessorListSyntax = ((PropertyDeclarationSyntax)property).AccessorList; 118var propertyDeclaration = (PropertyDeclarationSyntax)property; 146=> ((PropertyDeclarationSyntax)property).Initializer?.Value; 149=> ((PropertyDeclarationSyntax)property).WithInitializer(null);
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (3)
222if (initializer.Parent is not PropertyDeclarationSyntax and not VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax { Parent: FieldDeclarationSyntax } }) 268if (initializer.Parent is PropertyDeclarationSyntax propertyDeclaration) 327lastFieldOrProperty = currentTypeDeclaration.Members.LastIndexOf(m => m is PropertyDeclarationSyntax);
EditAndContinue\BreakpointSpans.cs (2)
335var property = (PropertyDeclarationSyntax)node;
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (12)
69/// <see cref="PropertyDeclarationSyntax"/> for property initializers and expression bodies. 121Debug.Assert(((PropertyDeclarationSyntax)current).Initializer != null); 261Debug.Assert(position == ((PropertyDeclarationSyntax)node).Initializer!.SpanStart); 640var propertyDeclaration = (PropertyDeclarationSyntax)node; 940=> declaration is VariableDeclaratorSyntax { Initializer: not null } or PropertyDeclarationSyntax { Initializer: not null }; 1206var oldHasExpressionBody = oldNode is PropertyDeclarationSyntax { ExpressionBody: not null } or IndexerDeclarationSyntax { ExpressionBody: not null }; 1207var newHasExpressionBody = newNode is PropertyDeclarationSyntax { ExpressionBody: not null } or IndexerDeclarationSyntax { ExpressionBody: not null }; 1333if (node is PropertyDeclarationSyntax { ExpressionBody: not null } or IndexerDeclarationSyntax { ExpressionBody: not null }) 1702var propertyDeclaration = (PropertyDeclarationSyntax)node; 2074return SyntaxUtilities.HasBackingField((PropertyDeclarationSyntax)node) ? FeaturesResources.auto_property : FeaturesResources.property_;
EditAndContinue\DeclarationBody\PropertyOrIndexerWithExplicitBodyDeclarationBody.cs (1)
19=> (propertyOrIndexer is PropertyDeclarationSyntax property) ? property.ExpressionBody! : ((IndexerDeclarationSyntax)propertyOrIndexer).ExpressionBody!;
EditAndContinue\SyntaxComparer.cs (1)
1462return ((PropertyDeclarationSyntax)node).Identifier;
EditAndContinue\SyntaxUtilities.cs (5)
42PropertyDeclarationSyntax { Initializer: { } propertyInitializer } 119if (syntax is ExpressionSyntax { Parent.Parent: PropertyDeclarationSyntax }) 141if (declaration is PropertyDeclarationSyntax property) 175if (node is PropertyDeclarationSyntax propertyDecl) 191public static bool HasBackingField(PropertyDeclarationSyntax property)
GenerateConstructorFromMembers\CSharpGenerateConstructorFromMembersCodeRefactoringProvider.cs (1)
62if (property.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken) is not PropertyDeclarationSyntax propertyDeclaration)
GenerateMember\GenerateVariable\CSharpGenerateVariableService.cs (3)
34=> node is PropertyDeclarationSyntax; 67var propertyDeclaration = (PropertyDeclarationSyntax)node;
ImplementInterface\AbstractChangeImplementationCodeRefactoringProvider.cs (1)
162PropertyDeclarationSyntax member => (member, member.ExplicitInterfaceSpecifier, member.Identifier),
ImplementInterface\CSharpImplementImplicitlyCodeRefactoringProvider.cs (1)
59PropertyDeclarationSyntax member => member.WithExplicitInterfaceSpecifier(null),
InheritanceMargin\CSharpInheritanceMarginService.cs (1)
69PropertyDeclarationSyntax propertyDeclarationNode => propertyDeclarationNode.Identifier,
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (2)
117syntaxRef2.GetSyntax(cancellationToken) is PropertyDeclarationSyntax { Initializer: null }) 287if (member is PropertyDeclarationSyntax { Initializer.Value: var propertyInitializer } propertyDeclaration)
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider_Update.cs (2)
225if (syntaxRef.GetSyntax(cancellationToken) is PropertyDeclarationSyntax propertyDeclaration) 231var newPropertyDeclaration = isThrowNotImplementedProperty ? RemoveThrowNotImplemented(propertyDeclaration) : propertyDeclaration;
InitializeParameter\InitializeParameterHelpers.cs (4)
161=> node is PropertyDeclarationSyntax propertyDeclaration ? RemoveThrowNotImplemented(propertyDeclaration) : node; 163public static PropertyDeclarationSyntax RemoveThrowNotImplemented(PropertyDeclarationSyntax propertyDeclaration) 167var result = propertyDeclaration
LineSeparators\CSharpLineSeparatorService.cs (1)
143=> IsBadAccessorList(node as PropertyDeclarationSyntax);
Organizing\Organizers\PropertyDeclarationOrganizer.cs (3)
17internal class PropertyDeclarationOrganizer : AbstractSyntaxNodeOrganizer<PropertyDeclarationSyntax> 25protected override PropertyDeclarationSyntax Organize( 26PropertyDeclarationSyntax syntax,
ReplaceMethodWithProperty\CSharpReplaceMethodWithPropertyService.cs (3)
67var propertyDeclaration = ConvertMethodsToPropertyWorker( 115public static PropertyDeclarationSyntax ConvertMethodsToPropertyWorker( 132var property = PropertyDeclaration(
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.cs (6)
31AbstractReplacePropertyWithMethodsService<IdentifierNameSyntax, ExpressionSyntax, NameMemberCrefSyntax, StatementSyntax, PropertyDeclarationSyntax> 48if (propertyDeclarationNode is not PropertyDeclarationSyntax propertyDeclaration) 67PropertyDeclarationSyntax propertyDeclaration, 108PropertyDeclarationSyntax propertyDeclaration, 166PropertyDeclarationSyntax propertyDeclaration, 229PropertyDeclarationSyntax propertyDeclaration,
Snippets\AbstractCSharpAutoPropertySnippetProvider.cs (6)
26internal abstract class AbstractCSharpAutoPropertySnippetProvider : AbstractPropertySnippetProvider<PropertyDeclarationSyntax> 42protected override async Task<PropertyDeclarationSyntax> GenerateSnippetSyntaxAsync(Document document, int position, CancellationToken cancellationToken) 75protected override int GetTargetCaretPosition(PropertyDeclarationSyntax propertyDeclaration, SourceText sourceText) 78protected override ImmutableArray<SnippetPlaceholder> GetPlaceHolderLocationsList(PropertyDeclarationSyntax propertyDeclaration, ISyntaxFacts syntaxFacts, CancellationToken cancellationToken) 90protected override PropertyDeclarationSyntax? FindAddedSnippetSyntaxNode(SyntaxNode root, int position) 93return node.GetAncestorOrThis<PropertyDeclarationSyntax>();
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (2)
188reference.GetSyntax(cancellationToken) is PropertyDeclarationSyntax property && 201PropertyDeclarationSyntax propertyDeclaration => propertyDeclaration.Identifier,
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (2)
23PropertyDeclarationSyntax, 54protected override bool ContainsFieldExpression(PropertyDeclarationSyntax propertyDeclaration, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForPropertiesHelper.cs (17)
19UseExpressionBodyHelper<PropertyDeclarationSyntax> 36protected override BlockSyntax GetBody(PropertyDeclarationSyntax declaration) 39protected override ArrowExpressionClauseSyntax GetExpressionBody(PropertyDeclarationSyntax declaration) 42protected override SyntaxToken GetSemicolonToken(PropertyDeclarationSyntax declaration) 45protected override PropertyDeclarationSyntax WithSemicolonToken(PropertyDeclarationSyntax declaration, SyntaxToken token) 48protected override PropertyDeclarationSyntax WithExpressionBody(PropertyDeclarationSyntax declaration, ArrowExpressionClauseSyntax expressionBody) 51protected override PropertyDeclarationSyntax WithAccessorList(PropertyDeclarationSyntax declaration, AccessorListSyntax accessorListSyntax) 54protected override PropertyDeclarationSyntax WithBody(PropertyDeclarationSyntax declaration, BlockSyntax body) 64protected override PropertyDeclarationSyntax WithGenerateBody(SemanticModel semanticModel, PropertyDeclarationSyntax declaration) 67protected override bool CreateReturnStatementForExpression(SemanticModel semanticModel, PropertyDeclarationSyntax declaration) => true; 70PropertyDeclarationSyntax declaration, 79protected override Location GetDiagnosticLocation(PropertyDeclarationSyntax declaration)
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (2)
109if (nodeToRemove is not VariableDeclaratorSyntax and not PropertyDeclarationSyntax) 114if (nodeToRemove is PropertyDeclarationSyntax property)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (3)
56.OfType<PropertyDeclarationSyntax>() 122var property = result.Declaration; 588var p = result.Declaration;
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\PositionalParameterInfo.cs (3)
25PropertyDeclarationSyntax? Declaration, 36ImmutableArray<PropertyDeclarationSyntax> properties, 117PropertyDeclarationSyntax property,
src\Analyzers\CSharp\CodeFixes\GenerateVariable\CSharpGenerateVariableCodeFixProvider.cs (1)
41=> node is SimpleNameSyntax or PropertyDeclarationSyntax or MemberBindingExpressionSyntax;
src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.cs (1)
37var originalNode = token.GetAncestor<PropertyDeclarationSyntax>() ??
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (2)
87var oldAccessor = node.Parent?.Parent as PropertyDeclarationSyntax;
src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (1)
50if (node is not (PropertyDeclarationSyntax or VariableDeclaratorSyntax { Parent.Parent: FieldDeclarationSyntax }))
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (4)
152PropertyDeclarationSyntax property => 205if (syntax is PropertyDeclarationSyntax declaration) 240if (node.Parent?.Parent is PropertyDeclarationSyntax propertyDeclaration) 245if (node is PropertyDeclarationSyntax propertyDeclarationSyntax)
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
452else if (declaration is PropertyDeclarationSyntax propertyDeclaration)
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (3)
211var t = (PropertyDeclarationSyntax)node; 398arrowExpr = ((PropertyDeclarationSyntax)node).ExpressionBody;
Structure\CSharpBlockStructureProvider.cs (1)
45builder.Add<PropertyDeclarationSyntax, PropertyDeclarationStructureProvider>();
Structure\CSharpStructureHelpers.cs (1)
282PropertyDeclarationSyntax propertyDeclaration => propertyDeclaration.Modifiers.FirstOrNull() ?? propertyDeclaration.Type.GetFirstToken(),
Structure\Providers\PropertyDeclarationStructureProvider.cs (2)
12internal class PropertyDeclarationStructureProvider : AbstractSyntaxNodeStructureProvider<PropertyDeclarationSyntax> 16PropertyDeclarationSyntax propertyDeclaration,
UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (12)
37PropertyDeclarationSyntax, 42protected override PropertyDeclarationSyntax GetPropertyDeclaration(SyntaxNode node) 43=> (PropertyDeclarationSyntax)node; 60protected override PropertyDeclarationSyntax RewriteFieldReferencesInProperty( 61PropertyDeclarationSyntax property, 76return (PropertyDeclarationSyntax)rewriter.Visit(property); 85PropertyDeclarationSyntax propertyDeclaration, 144static PropertyDeclarationSyntax MoveAttributes( 145PropertyDeclarationSyntax property, 187PropertyDeclarationSyntax propertyDeclaration, 224if (propertyDeclaration is PropertyDeclarationSyntax { AccessorList.Accessors: var accessors } && 233private static bool NeedsSetter(Compilation compilation, PropertyDeclarationSyntax propertyDeclaration, bool isWrittenOutsideOfConstructor)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (2)
Diagnostics\Suppression\SuppressionTests.cs (2)
1090var property = (PropertyDeclarationSyntax)context.Node;
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
IOperation\IOperationTests_ISymbolInitializer.cs (1)
33var nodes = tree.GetRoot().DescendantNodes().Where(n => n is VariableDeclarationSyntax || n is PropertyDeclarationSyntax).ToArray();
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (3)
Semantics\NullableContextTests.cs (2)
2048var declarations = syntaxTree.GetRoot().DescendantNodes().OfType<PropertyDeclarationSyntax>().ToArray(); 2057void verify(PropertyDeclarationSyntax syntax, string expectedText, Microsoft.CodeAnalysis.NullableFlowState expectedFlowState)
SourceGeneration\SyntaxAwareGeneratorTests.cs (1)
459TestSyntaxReceiver receiver1 = new TestSyntaxReceiver(tag: 0, callback: (a) => { if (a is PropertyDeclarationSyntax) throw new Exception("Test Exception"); });
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (14)
Compilation\SemanticModelAPITests.cs (4)
1628var propertyDecl = (PropertyDeclarationSyntax)typeDecl.Members[0]; 2486var propertyDecl = (PropertyDeclarationSyntax)typeDecl.Members[0];
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (8)
301var propertyDecl = (PropertyDeclarationSyntax)typeDecl.Members[0]; 521var node = (PropertyDeclarationSyntax)typeDecl.Members[0]; 2858var explicitPropertyNode = (PropertyDeclarationSyntax)classMemberNodes[1]; 3146var accessors = (synType.Members[0] as PropertyDeclarationSyntax).AccessorList; 3153accessors = (synType.Members[1] as PropertyDeclarationSyntax).AccessorList;
Symbols\PartialPropertiesTests.cs (2)
4886var properties = tree.GetRoot().DescendantNodes().OfType<PropertyDeclarationSyntax>().ToArray(); 4922var properties = tree.GetRoot().DescendantNodes().OfType<PropertyDeclarationSyntax>().ToArray();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (49)
Generated\Syntax.Test.xml.Generated.cs (5)
10796private static PropertyDeclarationSyntax GeneratePropertyDeclaration() 13367var node = GeneratePropertyDeclaration(); 13378var 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); 19013var oldNode = GeneratePropertyDeclaration(); 19029var oldNode = GeneratePropertyDeclaration();
IncrementalParsing\TypeChanges.cs (4)
93var propertyType = classType.Members[0] as PropertyDeclarationSyntax; 109var propertyType = classType.Members[0] as PropertyDeclarationSyntax;
LexicalAndXml\XmlDocCommentTests.cs (2)
1902Assert.Equal(typeof(PropertyDeclarationSyntax), (tree.GetCompilationUnitRoot().Members[0] as TypeDeclarationSyntax).Members[0].GetType()); 1904var keyword = ((tree.GetCompilationUnitRoot().Members[0] as TypeDeclarationSyntax).Members[0] as PropertyDeclarationSyntax).Type;
Parsing\DeclarationParsingTests.cs (24)
2906var propertySyntax = (PropertyDeclarationSyntax)structDecl.Members[0]; 2947var propertySyntax = (PropertyDeclarationSyntax)structDecl.Members[0]; 4130var ps = (PropertyDeclarationSyntax)cs.Members[0]; 4184var ps = (PropertyDeclarationSyntax)cs.Members[0]; 4239var ps = (PropertyDeclarationSyntax)cs.Members[0]; 4312var ps = (PropertyDeclarationSyntax)cs.Members[0]; 4366var ps = (PropertyDeclarationSyntax)cs.Members[0]; 4420var ps = (PropertyDeclarationSyntax)cs.Members[0]; 4464var ps = (PropertyDeclarationSyntax)cs.Members[0]; 4504var ps = (PropertyDeclarationSyntax)cs.Members[0]; 4616var ps = (PropertyDeclarationSyntax)cs.Members[0]; 4700var ps = (PropertyDeclarationSyntax)cs.Members[0];
Parsing\ParsingErrorRecoveryTests.cs (14)
6406var pd = (PropertyDeclarationSyntax)agg.Members[0]; 6431var pd = (PropertyDeclarationSyntax)agg.Members[0]; 6456var pd = (PropertyDeclarationSyntax)agg.Members[0]; 6491var pd = (PropertyDeclarationSyntax)agg.Members[0]; 6530var pd = (PropertyDeclarationSyntax)agg.Members[0]; 6566var propertyDecl = (PropertyDeclarationSyntax)classDecl.Members[0]; 6598var propertyDecl = (PropertyDeclarationSyntax)classDecl.Members[0];
Microsoft.CodeAnalysis.CSharp.Workspaces (61)
Classification\ClassificationHelpers.cs (1)
222else if (token.Parent is PropertyDeclarationSyntax propertyDeclaration && propertyDeclaration.Identifier == token)
CodeGeneration\CSharpSyntaxGenerator.cs (19)
445PropertyDeclarationSyntax property => property.WithAccessorList(CreateAccessorList(property.AccessorList, accessorDeclarations)) 629SyntaxKind.PropertyDeclaration => ((PropertyDeclarationSyntax)declaration).WithExplicitInterfaceSpecifier(specifier), 656var prop = (PropertyDeclarationSyntax)declaration; 837var property = (PropertyDeclarationSyntax)member; 1907PropertyDeclarationSyntax propertyDeclaration => propertyDeclaration.Identifier.ValueText, 1937PropertyDeclarationSyntax propertyDeclaration => ReplaceWithTrivia(declaration, propertyDeclaration.Identifier, id), 1973return ((PropertyDeclarationSyntax)declaration).Type; 2010SyntaxKind.PropertyDeclaration => ((PropertyDeclarationSyntax)declaration).WithType((TypeSyntax)type), 2282var pd = (PropertyDeclarationSyntax)declaration; 2338var pd = (PropertyDeclarationSyntax)declaration; 2411var pd = (PropertyDeclarationSyntax)declaration; 2451var pd = (PropertyDeclarationSyntax)declaration; 2569SyntaxKind.PropertyDeclaration => ((PropertyDeclarationSyntax)declaration).ExpressionBody == null,
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (3)
368var property = (PropertyDeclarationSyntax)node; 428case PropertyDeclarationSyntax property:
Recommendations\CSharpRecommendationServiceRunner.cs (2)
418Parent: PropertyDeclarationSyntax or 467else if (member is PropertyDeclarationSyntax { Initializer.Value: IdentifierNameSyntax { Identifier: var propertyInitializerIdentifier } } &&
Rename\CSharpRenameRewriterLanguageService.cs (1)
274=> accessor?.Parent?.Parent is PropertyDeclarationSyntax property // 3 null checks in one: accessor -> accessor list -> property declaration
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.cs (3)
48return ((PropertyDeclarationSyntax)member).Identifier; 151return ((PropertyDeclarationSyntax)member).Type; 181PropertyDeclarationSyntax property => property.ExpressionBody,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
480public static IPropertySymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, PropertyDeclarationSyntax syntax, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (2)
352case PropertyDeclarationSyntax property: 354node.IsFoundUnder((PropertyDeclarationSyntax p) => p.Initializer);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (2)
169var propertyDeclNode = node as PropertyDeclarationSyntax;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\WrappingFormattingRule.cs (1)
165if (node is PropertyDeclarationSyntax propertyDeclaration && propertyDeclaration.AccessorList != null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SelectedMembers\CSharpSelectedMembers.cs (1)
20PropertyDeclarationSyntax,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
58return ((PropertyDeclarationSyntax)declaration).ExplicitInterfaceSpecifier == null;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpHeaderFacts.cs (1)
40var node = TryGetAncestorForLocation<PropertyDeclarationSyntax>(root, position);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
1389=> ((PropertyDeclarationSyntax)node).Initializer; 1398=> node?.Parent is PropertyDeclarationSyntax propertyDeclaration && propertyDeclaration.Initializer == node;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (2)
125PropertyDeclarationSyntax or 138if (GetEnclosingMember(endToken) is PropertyDeclarationSyntax propertyDeclaration &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
796var propertyDeclaration = (PropertyDeclarationSyntax)syntaxNode;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpDeclarationComparer.cs (4)
130return Compare((PropertyDeclarationSyntax)x, (PropertyDeclarationSyntax)y); 260private int Compare(PropertyDeclarationSyntax x, PropertyDeclarationSyntax y)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (4)
32var lastProperty = members.LastOrDefault(m => m is PropertyDeclarationSyntax); 122var propertyDeclaration = PropertyDeclaration( 179private static PropertyDeclarationSyntax UseExpressionBodyIfDesired( 180CSharpCodeGenerationContextInfo info, PropertyDeclarationSyntax declaration, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\BasePropertyDeclarationSyntaxExtensions.cs (6)
13/// Available if <paramref name="node"/> is <see cref="PropertyDeclarationSyntax"/> or <see cref="IndexerDeclarationSyntax"/>. 21case SyntaxKind.PropertyDeclaration: return ((PropertyDeclarationSyntax)node).SemicolonToken; 30/// Available if <paramref name="node"/> is <see cref="PropertyDeclarationSyntax"/> or <see cref="IndexerDeclarationSyntax"/>. 39case SyntaxKind.PropertyDeclaration: return ((PropertyDeclarationSyntax)node).WithSemicolonToken(semicolonToken); 48/// Available if <paramref name="node"/> is <see cref="PropertyDeclarationSyntax"/> or <see cref="IndexerDeclarationSyntax"/>. 57case SyntaxKind.PropertyDeclaration: return ((PropertyDeclarationSyntax)node).WithExpressionBody(expressionBody);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
522targetToken.IsAccessorDeclarationContext<PropertyDeclarationSyntax>(position, kind) ||
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
1201if (equalsValue?.Parent is PropertyDeclarationSyntax propertyDecl) 1213private IEnumerable<TypeInferenceInfo> InferTypeInPropertyDeclaration(PropertyDeclarationSyntax propertyDeclaration)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (39)
CodeGeneration\SyntaxGeneratorTests.cs (37)
1033VerifySyntax<PropertyDeclarationSyntax>( 1037VerifySyntax<PropertyDeclarationSyntax>( 1041VerifySyntax<PropertyDeclarationSyntax>( 1045VerifySyntax<PropertyDeclarationSyntax>( 1049VerifySyntax<PropertyDeclarationSyntax>( 1053VerifySyntax<PropertyDeclarationSyntax>( 1057VerifySyntax<PropertyDeclarationSyntax>( 1061VerifySyntax<PropertyDeclarationSyntax>( 1065VerifySyntax<PropertyDeclarationSyntax>( 1069VerifySyntax<PropertyDeclarationSyntax>( 1073VerifySyntax<PropertyDeclarationSyntax>( 1077VerifySyntax<PropertyDeclarationSyntax>( 1175VerifySyntax<PropertyDeclarationSyntax>( 1336VerifySyntax<PropertyDeclarationSyntax>( 1356VerifySyntax<PropertyDeclarationSyntax>( 1478VerifySyntax<PropertyDeclarationSyntax>( 1868VerifySyntax<PropertyDeclarationSyntax>( 2335VerifySyntax<PropertyDeclarationSyntax>( 2353VerifySyntax<PropertyDeclarationSyntax>( 2507VerifySyntax<PropertyDeclarationSyntax>( 2820var property = (PropertyDeclarationSyntax) 3168var property = (PropertyDeclarationSyntax)ParseMemberDeclaration("public virtual int P { get; }"); 3170VerifySyntax<PropertyDeclarationSyntax>(updatedProperty, "public virtual required int P { get; }"); 3176var property = (PropertyDeclarationSyntax)ParseMemberDeclaration("public required int P { get; }"); 3178VerifySyntax<PropertyDeclarationSyntax>(updatedProperty, "public virtual required int P { get; }"); 3186var property = (PropertyDeclarationSyntax)ParseMemberDeclaration($$"""{{modifier}} int P { get; }"""); 3188VerifySyntax<PropertyDeclarationSyntax>(updatedProperty, $$"""{{modifier}} required int P { get; }"""); 3402VerifySyntax<PropertyDeclarationSyntax>( 3406VerifySyntax<PropertyDeclarationSyntax>( 3412VerifySyntax<PropertyDeclarationSyntax>( 3418VerifySyntax<PropertyDeclarationSyntax>( 4290VerifySyntax<PropertyDeclarationSyntax>( 4711VerifySyntax<PropertyDeclarationSyntax>(
Formatting\FormattingElasticTriviaTests.cs (1)
148var property = PropertyDeclaration(
Formatting\FormattingTests.cs (1)
4639var property = SyntaxFactory.PropertyDeclaration(
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
SymbolKeyTests.cs (1)
1093n => n is CSharp.Syntax.PropertyDeclarationSyntax).Single();
Microsoft.DotNet.GenFacades (2)
NotSupportedAssemblyGenerator.cs (2)
133public override SyntaxNode VisitPropertyDeclaration(PropertyDeclarationSyntax node) 217private string GetPropertyDefinition(PropertyDeclarationSyntax node) => GetFullyQualifiedName((TypeDeclarationSyntax)node.Parent) + "." + node.Identifier.ValueText;
Microsoft.Extensions.Options.SourceGeneration (1)
ParserUtilities.cs (1)
37x.GetSyntax(token) is PropertyDeclarationSyntax syntax &&
Microsoft.Gen.Logging (2)
Parsing\Parser.LogProperties.cs (1)
78PropertyDeclarationSyntax propertySyntax => propertySyntax.Identifier.Text, // a regular property
src\Generators\Shared\ParserUtilities.cs (1)
42x.GetSyntax(token) is PropertyDeclarationSyntax syntax &&
Microsoft.Gen.Logging.Unit.Tests (2)
ParserUtilitiesTests.cs (2)
19var propertyDeclaration = SyntaxFactory.PropertyDeclaration( 30var anotherPropertyDeclaration = SyntaxFactory.PropertyDeclaration(
Microsoft.Gen.Metrics (1)
src\Generators\Shared\ParserUtilities.cs (1)
42x.GetSyntax(token) is PropertyDeclarationSyntax syntax &&
Microsoft.Gen.MetricsReports (1)
src\Generators\Shared\ParserUtilities.cs (1)
42x.GetSyntax(token) is PropertyDeclarationSyntax syntax &&
Microsoft.ML.InternalCodeAnalyzer (1)
NameAnalyzer.cs (1)
122=> CheckPascal(((PropertyDeclarationSyntax)context.Node).Identifier, context);
Microsoft.VisualStudio.LanguageServices.CSharp (11)
CodeModel\CSharpCodeModelService.cs (9)
818return ((PropertyDeclarationSyntax)node).ExplicitInterfaceSpecifier?.ToString() + 819((PropertyDeclarationSyntax)node).Identifier.ToString(); 898return ((PropertyDeclarationSyntax)node).WithIdentifier(newIdentifier); 1469=> (node as PropertyDeclarationSyntax)?.ExpressionBody != null; 1473accessorNode = (parentNode as PropertyDeclarationSyntax)?.ExpressionBody; 3409else if (container is PropertyDeclarationSyntax property) 3533private static bool IsAutoImplementedProperty(PropertyDeclarationSyntax propertyDeclaration) 3651var propertyDeclaration = (PropertyDeclarationSyntax)node;
CodeModel\CSharpCodeModelService.NodeNameGenerator.cs (2)
240var propertyDeclaration = (PropertyDeclarationSyntax)node;
System.Private.CoreLib.Generators (1)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (1)
293if (propertyDefiningSyntax is PropertyDeclarationSyntax propertyDeclaration
System.Text.RegularExpressions.Generator (1)
RegexGenerator.cs (1)
60(node, _) => node is MethodDeclarationSyntax or PropertyDeclarationSyntax or IndexerDeclarationSyntax or AccessorDeclarationSyntax,
System.Windows.Forms.Analyzers.CodeFixes.CSharp (4)
System\Windows\Forms\CSharp\CodeFixes\AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.cs (4)
42PropertyDeclarationSyntax? propertyDeclaration = root.FindToken(diagnosticSpan.Start) 45.OfType<PropertyDeclarationSyntax>() 59PropertyDeclarationSyntax propertyDeclarationSyntax, 86PropertyDeclarationSyntax newProperty = propertyDeclarationSyntax.WithoutLeadingTrivia();