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
161
161
funcDefnAst . Extent . File ) ;
162
162
}
163
163
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
+
164
204
private class CommentHelpBuilder
165
205
{
166
206
private CommentHelpNode synopsis ;
You can’t perform that action at this time.
0 commit comments