File tree Expand file tree Collapse file tree 2 files changed +27
-3
lines changed
tests/cases/fourslash/server Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -581,11 +581,17 @@ namespace ts {
581581
582582 let doc = JsDoc . getJsDocCommentsFromDeclarations ( declarations ) ;
583583 if ( checker && ( doc . length === 0 || declarations . some ( hasJSDocInheritDocTag ) ) ) {
584- forEachUnique ( declarations , declaration => {
585- const inheritedDocs = findBaseOfDeclaration ( checker , declaration , symbol => symbol . getDocumentationComment ( checker ) ) ;
584+ const seenSymbols = new Set < Symbol > ( ) ;
585+ for ( const declaration of declarations ) {
586+ const inheritedDocs = findBaseOfDeclaration ( checker , declaration , symbol => {
587+ if ( ! seenSymbols . has ( symbol ) ) {
588+ seenSymbols . add ( symbol ) ;
589+ return symbol . getDocumentationComment ( checker ) ;
590+ }
591+ } ) ;
586592 // TODO: GH#16312 Return a ReadonlyArray, avoid copying inheritedDocs
587593 if ( inheritedDocs ) doc = doc . length === 0 ? inheritedDocs . slice ( ) : inheritedDocs . concat ( lineBreakPart ( ) , doc ) ;
588- } ) ;
594+ }
589595 }
590596 return doc ;
591597 }
Original file line number Diff line number Diff line change 1+ /// <reference path="../fourslash.ts"/>
2+
3+ //// interface I {
4+ //// /** The colour */
5+ //// readonly colour: string
6+ //// }
7+ //// interface A extends I {
8+ //// readonly colour: "red" | "green";
9+ //// }
10+ //// interface B extends I {
11+ //// readonly colour: "yellow" | "green";
12+ //// }
13+ //// type F = A | B
14+ //// const f: F = { colour: "green" }
15+ //// f.colour/*1*/
16+
17+ goTo . marker ( "1" )
18+ verify . quickInfoIs ( "(property) colour: \"red\" | \"green\" | \"yellow\"" , "The colour" )
You can’t perform that action at this time.
0 commit comments