Offer property attribute target in record positional param#51760
Offer property attribute target in record positional param#51760CyrusNajmabadi merged 5 commits intodotnet:mainfrom
Conversation
|
Closing and re-opening for a new build due to unrelated failure:
|
|
Same failure again 😕 |
| var isRecordParameter = token.Parent.IsParentKind(SyntaxKind.Parameter) && | ||
| token.Parent.Parent.IsParentKind(SyntaxKind.ParameterList) && | ||
| token.Parent.Parent.Parent.IsParentKind(SyntaxKind.RecordDeclaration); |
There was a problem hiding this comment.
if (token.Parent is { Parent: { Kind: Parameter, Parent: { Parent: { Kind: RecordDeclaration } } } })
?
There was a problem hiding this comment.
@CyrusNajmabadi I'll have to use RawKind for this form as there is no Kind property. The cast to int feels annoying to me. But let me know if this is okay for you.
| token.Parent.Parent.Parent.IsParentKind(SyntaxKind.RecordDeclaration); | ||
|
|
||
| return isRecordParameter || SyntaxTree.IsMemberDeclarationContext( | ||
| token.SpanStart, contextOpt: null, validModifiers: null, validTypeDeclarations: validTypeDeclarations, canBePartial: false, cancellationToken: cancellationToken); |
There was a problem hiding this comment.
my pref is two if-statements.
CyrusNajmabadi
left a comment
There was a problem hiding this comment.
LMK if you want to make changes. otherwise i'll merge in.
|
@CyrusNajmabadi Anything left here? Thanks. |
...SharedUtilitiesAndExtensions/Workspace/CSharp/Extensions/ContextQuery/CSharpSyntaxContext.cs
Outdated
Show resolved
Hide resolved
|
lgtm. thanks! |
Head branch was pushed to by a user without write access
…xtensions/ContextQuery/CSharpSyntaxContext.cs
...SharedUtilitiesAndExtensions/Workspace/CSharp/Extensions/ContextQuery/CSharpSyntaxContext.cs
Outdated
Show resolved
Hide resolved
…xtensions/ContextQuery/CSharpSyntaxContext.cs Co-authored-by: CyrusNajmabadi <cyrus.najmabadi@gmail.com>
Head branch was pushed to by a user without write access
|
@CyrusNajmabadi Auto merge was cancelled due to pushing a commit to fix formatting. It should hopefully be green now. |
|
Thanks! |
Fixes #51756