File tree Expand file tree Collapse file tree 4 files changed +39
-0
lines changed
Expand file tree Collapse file tree 4 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 11# Unreleased
22
3+ ### Bug Fixes
4+
5+ - Fixed comment discovery for ` @inheritDoc ` if inheriting from a function type alias, #2087 .
6+
37## v0.23.19 (2022-10-28)
48
59### Bug Fixes
Original file line number Diff line number Diff line change 22 Comment ,
33 DeclarationReflection ,
44 ReflectionKind ,
5+ ReflectionType ,
56 SignatureReflection ,
67} from "../../models" ;
78import { Component , ConverterComponent } from "../components" ;
@@ -105,6 +106,23 @@ export class InheritDocPlugin extends ConverterComponent {
105106 private copyComment ( source : Reflection , target : Reflection ) {
106107 if ( ! target . comment ) return ;
107108
109+ if (
110+ ! source . comment &&
111+ source instanceof DeclarationReflection &&
112+ source . signatures
113+ ) {
114+ source = source . signatures [ 0 ] ;
115+ }
116+
117+ if (
118+ ! source . comment &&
119+ source instanceof DeclarationReflection &&
120+ source . type instanceof ReflectionType &&
121+ source . type . declaration . signatures
122+ ) {
123+ source = source . type . declaration . signatures [ 0 ] ;
124+ }
125+
108126 if ( ! source . comment ) {
109127 this . application . logger . warn (
110128 `${ target . getFullName ( ) } tried to copy a comment from ${ source . getFullName ( ) } with @inheritDoc, but the source has no associated comment.`
Original file line number Diff line number Diff line change 1+ /** Foo type comment */
2+ export type Foo = ( ) => number ;
3+
4+ export class Bar {
5+ /**
6+ * {@inheritDoc Foo:type }
7+ */
8+ x = 1 ;
9+ }
Original file line number Diff line number Diff line change @@ -817,4 +817,12 @@ export const issueTests: {
817817 const sig = cap . signatures ! [ 0 ] ;
818818 equal ( sig . type ?. toString ( ) , "Capitalize<T>" ) ;
819819 } ,
820+
821+ gh2087 ( project ) {
822+ const x = query ( project , "Bar.x" ) ;
823+ equal (
824+ Comment . combineDisplayParts ( x . comment ?. summary ) ,
825+ "Foo type comment"
826+ ) ;
827+ } ,
820828} ;
You can’t perform that action at this time.
0 commit comments