@@ -16,7 +16,8 @@ public override void WriteCodeElement(CodeMethod codeElement, LanguageWriter wri
16
16
ArgumentNullException . ThrowIfNull ( writer ) ;
17
17
if ( codeElement . Parent is CodeFunction ) return ;
18
18
19
- var returnType = GetTypescriptTypeString ( codeElement . ReturnType , codeElement , inlineComposedTypeString : true ) ;
19
+ var codeFile = codeElement . GetImmediateParentOfType < CodeFile > ( ) ;
20
+ var returnType = GetTypescriptTypeString ( codeElement . ReturnType , codeFile , inlineComposedTypeString : true ) ;
20
21
var isVoid = "void" . EqualsIgnoreCase ( returnType ) ;
21
22
WriteMethodDocumentation ( codeElement , writer , isVoid ) ;
22
23
WriteMethodPrototype ( codeElement , writer , returnType , isVoid ) ;
@@ -30,6 +31,7 @@ private void WriteMethodDocumentation(CodeMethod code, LanguageWriter writer, bo
30
31
}
31
32
internal static void WriteMethodDocumentationInternal ( CodeMethod code , LanguageWriter writer , bool isVoid , TypeScriptConventionService typeScriptConventionService )
32
33
{
34
+ var codeFile = code . GetImmediateParentOfType < CodeFile > ( ) ;
33
35
var returnRemark = ( isVoid , code . IsAsync ) switch
34
36
{
35
37
( true , _ ) => string . Empty ,
@@ -41,7 +43,7 @@ internal static void WriteMethodDocumentationInternal(CodeMethod code, LanguageW
41
43
code . Parameters
42
44
. Where ( static x => x . Documentation . DescriptionAvailable )
43
45
. OrderBy ( static x => x . Name )
44
- . Select ( x => $ "@param { x . Name } { x . Documentation . GetDescription ( type => GetTypescriptTypeString ( type , code , inlineComposedTypeString : true ) , ReferenceTypePrefix , ReferenceTypeSuffix , RemoveInvalidDescriptionCharacters ) } ")
46
+ . Select ( x => $ "@param { x . Name } { x . Documentation . GetDescription ( type => GetTypescriptTypeString ( type , codeFile , inlineComposedTypeString : true ) , ReferenceTypePrefix , ReferenceTypeSuffix , RemoveInvalidDescriptionCharacters ) } ")
45
47
. Union ( [ returnRemark ] )
46
48
. Union ( GetThrownExceptionsRemarks ( code ) ) ) ;
47
49
}
0 commit comments