Skip to content

Commit

Permalink
Include parameter name in SA1611 diagnostic
Browse files Browse the repository at this point in the history
  • Loading branch information
sharwell committed Apr 26, 2015
1 parent eea978e commit 8b503ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ public class ClassName
}";
var expected = new[]
{
this.CSharpDiagnostic().WithLocation(10, 38),
this.CSharpDiagnostic().WithLocation(10, 53),
this.CSharpDiagnostic().WithLocation(10, 68),
this.CSharpDiagnostic().WithLocation(10, 38).WithArguments("param1"),
this.CSharpDiagnostic().WithLocation(10, 53).WithArguments("param2"),
this.CSharpDiagnostic().WithLocation(10, 68).WithArguments("param3"),
};

await this.VerifyCSharpDiagnosticAsync(testCode.Replace("##", p), expected, CancellationToken.None);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class SA1611ElementParametersMustBeDocumented : DiagnosticAnalyzer
/// </summary>
public const string DiagnosticId = "SA1611";
private const string Title = "Element parameters must be documented";
private const string MessageFormat = "The documentation for this parameter is missing";
private const string MessageFormat = "The documentation for parameter '{0}' is missing";
private const string Category = "StyleCop.CSharp.DocumentationRules";
private const string Description = "A C# method, constructor, delegate or indexer element is missing documentation for one or more of its parameters.";
private const string HelpLink = "http://www.stylecop.com/docs/SA1611.html";
Expand Down Expand Up @@ -90,7 +90,7 @@ private void HandleSyntaxNode(SyntaxNodeAnalysisContext context)
{
if (!xmlParameterNames.Any(x => x.Identifier.ToString() == parameter.Identifier.ToString()))
{
context.ReportDiagnostic(Diagnostic.Create(Descriptor, parameter.Identifier.GetLocation()));
context.ReportDiagnostic(Diagnostic.Create(Descriptor, parameter.Identifier.GetLocation(), parameter.Identifier.ValueText));
}
}
}
Expand Down

0 comments on commit 8b503ee

Please sign in to comment.