File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,10 @@ public override AstVisitAction VisitFunctionDefinition(FunctionDefinitionAst fun
70
70
DiagnosticRecords . Add (
71
71
new DiagnosticRecord (
72
72
string . Format ( CultureInfo . CurrentCulture , Strings . ProvideCommentHelpError , funcAst . Name ) ,
73
- funcAst . Extent , GetName ( ) , DiagnosticSeverity . Information , fileName ) ) ;
73
+ Helper . Instance . GetScriptExtentForFunctionName ( funcAst ) ,
74
+ GetName ( ) ,
75
+ DiagnosticSeverity . Information ,
76
+ fileName ) ) ;
74
77
}
75
78
}
76
79
Original file line number Diff line number Diff line change @@ -22,6 +22,10 @@ Describe "ProvideCommentHelp" {
22
22
$violations [1 ].Message | Should Match $violationMessage
23
23
}
24
24
25
+ It " has extent that includes only the function name" {
26
+ $violations [1 ].Extent.Text | Should Be " Comment"
27
+ }
28
+
25
29
if ($PSVersionTable.PSVersion -ge [Version ]' 5.0.0' )
26
30
{
27
31
It " Does not count violation in DSC class" {
You can’t perform that action at this time.
0 commit comments