File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,46 @@ private IEnumerable<CorrectionExtent> GetCorrection(FunctionDefinitionAst funcDe
161161 funcDefnAst . Extent . File ) ;
162162 }
163163
164+ private class ViolationFinder : AstVisitor
165+ {
166+ private HashSet < string > exportedFunctions ;
167+ private List < FunctionDefinitionAst > functionDefinitionAsts ;
168+
169+ public ViolationFinder ( )
170+ {
171+ exportedFunctions = new HashSet < string > ( ) ;
172+ functionDefinitionAsts = new List < FunctionDefinitionAst > ( ) ;
173+ }
174+
175+ public ViolationFinder ( HashSet < string > exportedFunctions ) : this ( )
176+ {
177+ if ( exportedFunctions == null )
178+ {
179+ throw new ArgumentNullException ( nameof ( exportedFunctions ) ) ;
180+ }
181+
182+ this . exportedFunctions = exportedFunctions ;
183+ }
184+
185+ public IEnumerable < FunctionDefinitionAst > FunctionDefinitionAsts { get { return functionDefinitionAsts ; } }
186+
187+ /// <summary>
188+ /// Visit function and checks that it has comment help
189+ /// </summary>
190+ /// <param name="funcAst"></param>
191+ /// <returns></returns>
192+ public override AstVisitAction VisitFunctionDefinition ( FunctionDefinitionAst funcAst )
193+ {
194+ if ( exportedFunctions . Contains ( funcAst . Name )
195+ && funcAst . GetHelpContent ( ) == null )
196+ {
197+ functionDefinitionAsts . Add ( funcAst ) ;
198+ }
199+
200+ return AstVisitAction . Continue ;
201+ }
202+ }
203+
164204 private class CommentHelpBuilder
165205 {
166206 private CommentHelpNode synopsis ;
You can’t perform that action at this time.
0 commit comments