Skip to content

Commit

Permalink
Merge pull request #2 from octogonz/octogonz/deeplyLinkedTypes-fix
Browse files Browse the repository at this point in the history
[api-extractor] Don't generate kind=Reference excerpt tokens when there is no reference
  • Loading branch information
rbuckton authored Sep 8, 2019
2 parents 86674a2 + 5851849 commit 7b67d84
Show file tree
Hide file tree
Showing 27 changed files with 514 additions and 1,451 deletions.
11 changes: 8 additions & 3 deletions apps/api-extractor/src/generators/ExcerptBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,16 @@ export class ExcerptBuilder {
}

if (span.prefix) {
let canonicalReference: DeclarationReference | undefined = undefined;

if (span.kind === ts.SyntaxKind.Identifier) {
const name: ts.Identifier = span.node as ts.Identifier;
const canonicalReference: DeclarationReference | undefined = isDeclarationName(name)
? undefined
: state.referenceGenerator.getDeclarationReferenceForIdentifier(name);
if (!isDeclarationName(name)) {
canonicalReference = state.referenceGenerator.getDeclarationReferenceForIdentifier(name);
}
}

if (canonicalReference) {
ExcerptBuilder._appendToken(excerptTokens, ExcerptTokenKind.Reference,
span.prefix, state, canonicalReference);
} else {
Expand Down
Loading

0 comments on commit 7b67d84

Please sign in to comment.