Skip to content

fix(DC0005): handle <param> tag without name attribute (#417) - #427

Open
MODUSCarstenScholling wants to merge 1 commit into
ALCops:mainfrom
MODUSCarstenScholling:dev-cs-bugfixes
Open

fix(DC0005): handle <param> tag without name attribute (#417)#427
MODUSCarstenScholling wants to merge 1 commit into
ALCops:mainfrom
MODUSCarstenScholling:dev-cs-bugfixes

Conversation

@MODUSCarstenScholling

Copy link
Copy Markdown
Contributor

Attributes.First(att => att.IsKind(XmlNameAttribute)) threw InvalidOperationException when a <param> element had no name attribute. Switch to FirstOrDefault and report DC0005 on the malformed element instead of crashing.

Adds ParamWithoutNameAttribute HasDiagnostic fixture covering <param></param> on procedures with and without parameters.

Fixes #417

`Attributes.First(att => att.IsKind(XmlNameAttribute))` threw
`InvalidOperationException` when a `<param>` element had no `name`
attribute. Switch to `FirstOrDefault` and report DC0005 on the
malformed element instead of crashing.

Adds `ParamWithoutNameAttribute` HasDiagnostic fixture covering
`<param></param>` on procedures with and without parameters.
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.

[Bug]: DC0005 XmlDocumentationProcedureConsistency throws unhandled InvalidOperationException instead of reporting a diagnostic

1 participant