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
7070 DiagnosticRecords . Add (
7171 new DiagnosticRecord (
7272 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 ) ) ;
7477 }
7578 }
7679
Original file line number Diff line number Diff line change @@ -22,6 +22,10 @@ Describe "ProvideCommentHelp" {
2222 $violations [1 ].Message | Should Match $violationMessage
2323 }
2424
25+ It " has extent that includes only the function name" {
26+ $violations [1 ].Extent.Text | Should Be " Comment"
27+ }
28+
2529 if ($PSVersionTable.PSVersion -ge [Version ]' 5.0.0' )
2630 {
2731 It " Does not count violation in DSC class" {
You can’t perform that action at this time.
0 commit comments