BusinessCentral.LinterCop
BusinessCentral.LinterCop copied to clipboard
LC0072 False positive on spaces in parameter name
/// <summary>
///
/// </summary>
/// <param name="TemplateSelection"></param>
/// <param name="Label Type Code"></param>
procedure GetTemplateSelection(var TemplateSelection: Record "Template Selection LNBSF"; "Label Type Code": Code[20])
This triggers the warning "The documentation comment does not match the procedure syntax". Even when the param name is correct.
@ans-bar-bm I could use your help on this.
The <param name="Label Type Code"></param> somehow returns the value Label for the parameterName, instead of "Label Type Code".
The only workaround I can find is nameAttribute.ToString().Split('=')[1], where I mostly try to avoid string manipulation.
Do you have an idea on howto resolve this?
Example code snippet below
codeunit 50100 MyCodeunit
{
/// <summary>
///
/// </summary>
/// <param name="TemplateSelection"></param>
/// <param name="Label Type Code"></param>
procedure GetTemplateSelection(var TemplateSelection: Record "Template Selection LNBSF"; "Label Type Code": Code[20])
begin
end;
}
table 50100 "Template Selection LNBSF"
{
fields
{
field(1; MyField; Integer) { }
}
}
@ans-bar-bm I could use your help on this.
Unfortunatly i don't really know why this is happening, since i'm not too familiar with the inner workings of the code analysis (most of my stuff is trial and error). It seems in the xml documentation part the Identifier only has the "Label" part itself, all the other stuff (" Type Code") seems to be under its Trailing Trivia. Probably that has the be evaluated too and added to the parameter name?
As i said i'm not really sure why, since later when evaluating the methodDeclarationSyntax Parameter stuff the ValueText contains the whole thing... Seems a bit weird to me that these behave differently between the xml documentation part and the actual parameter part.
Ah...I didn't know they where hiding under the TrailingTrivia property 🤔 This was of great help to find a solution for this, thanks @ans-bar-bm!
Version v0.34.0 of LinterCop has been released as the latest version.
Could you verify if it is working as expected? If everything looks good, would be great if you could close this issue.