@@ -14,6 +14,7 @@ This Source Code Form is subject to the terms of the
1414using System . Text . Json ;
1515using System . Xml . Linq ;
1616using OneScript . Contexts ;
17+ using OneScript . Execution ;
1718using OneScript . Localization ;
1819using OneScript . Types ;
1920using OneScript . Values ;
@@ -300,13 +301,13 @@ private MethodModel ConvertMethod(MethodInfo method, XElement documentation)
300301 model . Description = XmlSummary ( documentation ) ;
301302 model . ReturnTypeDocumentation = XmlReturns ( documentation ) ;
302303 model . Example = XmlTextBlock ( documentation , "example" , true ) ;
303- model . Parameters = CreateParameters ( method , documentation ) ;
304+ model . Parameters = CreateParameters ( method , documentation , p => p . ParameterType != typeof ( IBslProcess ) ) ;
304305 model . SeeAlso = XmlSeeAlso ( documentation ) ;
305306
306307 return model ;
307308 }
308309
309- private List < ParameterModel > CreateParameters ( MethodInfo method , XElement documentation )
310+ private List < ParameterModel > CreateParameters ( MethodInfo method , XElement documentation , Func < ParameterInfo , bool > filter )
310311 {
311312 var documentedParams = documentation ? . Elements ( "param" )
312313 . ToDictionary ( elem => elem . Attribute ( "name" ) ? . Value ??
@@ -315,7 +316,7 @@ private List<ParameterModel> CreateParameters(MethodInfo method, XElement docume
315316
316317 var models = new List < ParameterModel > ( ) ;
317318
318- foreach ( var parameter in method . GetParameters ( ) )
319+ foreach ( var parameter in method . GetParameters ( ) . Where ( filter ) )
319320 {
320321 documentedParams . TryGetValue ( parameter . Name ! , out var paramDoc ) ;
321322 var model = new ParameterModel
@@ -352,18 +353,7 @@ private MethodModel ConvertConstructor(MethodInfo method, XElement documentation
352353 model . Description = XmlSummary ( documentation ) ;
353354 model . ReturnTypeDocumentation = XmlReturns ( documentation ) ;
354355 model . Example = XmlTextBlock ( documentation , "example" , true ) ;
355-
356- // Параметры конструкторов могут содержать не-bsl-параметры, например TypeActivationContext
357- // Поэтому берем не из самого метода, а только из документации
358- var documentedParams = documentation ? . Elements ( "param" ) ;
359- var paramModels = documentedParams
360- . Select ( parameter => new ParameterModel
361- {
362- Name = parameter . Attribute ( "name" ) . Value ,
363- Description = _docConverter . ConvertTextBlock ( parameter )
364- } ) . ToList ( ) ;
365-
366- model . Parameters = paramModels ;
356+ model . Parameters = CreateParameters ( method , documentation , p => p . ParameterType != typeof ( TypeActivationContext ) ) ;
367357 }
368358
369359 return model ;
0 commit comments