From d91fd49fbe9e48e29ae629ef56ff173b7e3ec81b Mon Sep 17 00:00:00 2001 From: Adam Epling Date: Thu, 27 Feb 2020 00:35:49 -0600 Subject: [PATCH 1/3] add comments array to reflection object --- src/lib/converter/plugins/CommentPlugin.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/converter/plugins/CommentPlugin.ts b/src/lib/converter/plugins/CommentPlugin.ts index 0ebd9aaf5..74c643d4a 100644 --- a/src/lib/converter/plugins/CommentPlugin.ts +++ b/src/lib/converter/plugins/CommentPlugin.ts @@ -199,6 +199,7 @@ export class CommentPlugin extends ConverterComponent { const comment = parseComment(rawComment, reflection.comment); this.applyModifiers(reflection, comment); this.removeExcludedTags(comment); + reflection.comment = comment; } else if (reflection.kindOf(ReflectionKind.Module)) { this.storeModuleComment(rawComment, reflection); } else { From dc1220f96b93298f2e876b994a4969992ddf7b70 Mon Sep 17 00:00:00 2001 From: Adam Epling Date: Thu, 27 Feb 2020 00:50:43 -0600 Subject: [PATCH 2/3] Fixed issue in CommentPlugin where comments were not always being entirely copied over to signature --- src/lib/converter/plugins/CommentPlugin.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/lib/converter/plugins/CommentPlugin.ts b/src/lib/converter/plugins/CommentPlugin.ts index 74c643d4a..e33b01457 100644 --- a/src/lib/converter/plugins/CommentPlugin.ts +++ b/src/lib/converter/plugins/CommentPlugin.ts @@ -199,7 +199,6 @@ export class CommentPlugin extends ConverterComponent { const comment = parseComment(rawComment, reflection.comment); this.applyModifiers(reflection, comment); this.removeExcludedTags(comment); - reflection.comment = comment; } else if (reflection.kindOf(ReflectionKind.Module)) { this.storeModuleComment(rawComment, reflection); } else { @@ -304,10 +303,7 @@ export class CommentPlugin extends ConverterComponent { if (!childComment) { childComment = signature.comment = new Comment(); } - - childComment.shortText = childComment.shortText || comment.shortText; - childComment.text = childComment.text || comment.text; - childComment.returns = childComment.returns || comment.returns; + childComment.copyFrom(comment); } if (signature.parameters) { From 4acd5878a28e9aea8352d243d715b2d634b4245f Mon Sep 17 00:00:00 2001 From: Adam Epling Date: Thu, 27 Feb 2020 01:16:54 -0600 Subject: [PATCH 3/3] Fixed CommentPlugin issue where tags weren't always being copied over to child comments inside signatures. Also updated test specs to match the expected output. Should now output the `@see` tags defined in the comments for the test fat arrow functions --- src/lib/converter/plugins/CommentPlugin.ts | 6 +++++- src/test/renderer/specs/classes/_classes_.baseclass.html | 5 +++++ src/test/renderer/specs/classes/_classes_.subclassa.html | 5 +++++ src/test/renderer/specs/classes/_classes_.subclassb.html | 5 +++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/lib/converter/plugins/CommentPlugin.ts b/src/lib/converter/plugins/CommentPlugin.ts index e33b01457..726f7618a 100644 --- a/src/lib/converter/plugins/CommentPlugin.ts +++ b/src/lib/converter/plugins/CommentPlugin.ts @@ -303,7 +303,11 @@ export class CommentPlugin extends ConverterComponent { if (!childComment) { childComment = signature.comment = new Comment(); } - childComment.copyFrom(comment); + + childComment.shortText = childComment.shortText || comment.shortText; + childComment.text = childComment.text || comment.text; + childComment.returns = childComment.returns || comment.returns; + childComment.tags = childComment.tags || comment.tags; } if (signature.parameters) { diff --git a/src/test/renderer/specs/classes/_classes_.baseclass.html b/src/test/renderer/specs/classes/_classes_.baseclass.html index d1047b287..8d255e76c 100644 --- a/src/test/renderer/specs/classes/_classes_.baseclass.html +++ b/src/test/renderer/specs/classes/_classes_.baseclass.html @@ -287,6 +287,11 @@

arrowFunction

This is a simple fat arrow function.

+
+
see
+

https://github.com/sebastian-lenz/typedoc/issues/37

+
+

Parameters

    diff --git a/src/test/renderer/specs/classes/_classes_.subclassa.html b/src/test/renderer/specs/classes/_classes_.subclassa.html index d24ceee96..951992355 100644 --- a/src/test/renderer/specs/classes/_classes_.subclassa.html +++ b/src/test/renderer/specs/classes/_classes_.subclassa.html @@ -391,6 +391,11 @@

    arrowFunction

    This is a simple fat arrow function.

    +
    +
    see
    +

    https://github.com/sebastian-lenz/typedoc/issues/37

    +
    +

    Parameters

      diff --git a/src/test/renderer/specs/classes/_classes_.subclassb.html b/src/test/renderer/specs/classes/_classes_.subclassb.html index 8d6a6c9dd..d4a915530 100644 --- a/src/test/renderer/specs/classes/_classes_.subclassb.html +++ b/src/test/renderer/specs/classes/_classes_.subclassb.html @@ -255,6 +255,11 @@

      arrowFunction

      This is a simple fat arrow function.

      +
      +
      see
      +

      https://github.com/sebastian-lenz/typedoc/issues/37

      +
      +

      Parameters