Skip to content

test(analyzers): cover RCS1263 primary constructor params with spaced lists - #1803

Closed
josefpihrt wants to merge 5 commits into
mainfrom
fix/analyzers/rcs1263-primary-constructor-param
Closed

test(analyzers): cover RCS1263 primary constructor params with spaced lists#1803
josefpihrt wants to merge 5 commits into
mainfrom
fix/analyzers/rcs1263-primary-constructor-param

Conversation

@josefpihrt

@josefpihrt josefpihrt commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add a regression test for RCS1263 on primary constructor parameters with a spaced parameter list (record struct RS ( int par ), class C ( int prop ))
  • These cases already work via CSharpUtility.GetParameterList (TypeDeclarationSyntax.ParameterList); no analyzer lookup change

Fixes #1730

Test plan

  • dotnet test src/Tests/Analyzers.Tests/Analyzers.Tests.csproj --filter "FullyQualifiedName~RCS1263"

@josefpihrt josefpihrt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review notes for RCS1263 primary-constructor param resolution. Ancestor walk is the right fix for #1730; one likely-dead branch to tidy.

Comment thread src/CSharp/CSharp/Extensions/SyntaxExtensions.cs Outdated
josefpihrt and others added 3 commits August 14, 2026 22:15
Fixes #1730

Resolve the declaring syntax for documentation comments by walking
ancestor nodes instead of using parent.Parent, so primary constructor
parameters are matched correctly.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
ExtensionBlockDeclarationSyntax already matches MemberDeclarationSyntax.

Co-authored-by: Cursor <cursoragent@cursor.com>
@josefpihrt
josefpihrt force-pushed the fix/analyzers/rcs1263-primary-constructor-param branch from 5647b49 to 89d09b7 Compare August 14, 2026 20:15
@josefpihrt
josefpihrt changed the base branch from fix/analyzers/extension-block-xml-doc to main August 14, 2026 20:16
Josef Pihrt and others added 2 commits August 14, 2026 23:47
Co-authored-by: Cursor <cursoragent@cursor.com>
Primary constructor param refs already resolve via GetParameterList.
Keep the spaced-parameter-list coverage from #1730.

Co-authored-by: Cursor <cursoragent@cursor.com>
@josefpihrt josefpihrt changed the title fix(analyzers): resolve RCS1263 primary constructor param refs test(analyzers): cover RCS1263 primary constructor params with spaced lists Aug 14, 2026
@josefpihrt josefpihrt closed this Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RCS1263 „Parameter 'XY' could not be found“ with class primary constructor or record struct.

1 participant