Skip to content

Commit

Permalink
[api-extractor] Fix logic when to fall back to Navigation.Exports
Browse files Browse the repository at this point in the history
As suggested by @zelliott, the logic when to fall back
to Navigation.Exports (`.`) must use `consumable`, not
`exported`.
Updated the improved build-tests/api-extractor-scenarios
results.
  • Loading branch information
fwienber committed Sep 8, 2022
1 parent b02f81b commit 844f15b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,12 @@ export class DeclarationReferenceGenerator {
return Navigation.Exports;
}

// Otherwise, this symbol is from the current package. If we've found an exported CollectorEntity, then use
// Exports.
// Otherwise, this symbol is from the current package. If we've found an associated consumable
// `CollectorEntity`, then use Exports. We use `consumable` here instead of `exported` because
// if the symbol is exported from a non-consumable `AstNamespaceImport`, we don't want to use
// Exports. We should use Locals instead.
const entity: CollectorEntity | undefined = this._collector.tryGetEntityForSymbol(symbol);
if (entity && entity.exported) {
if (entity?.consumable) {
return Navigation.Exports;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
{
"kind": "Reference",
"text": "forgottenNs.ForgottenClass",
"canonicalReference": "api-extractor-scenarios!ForgottenClass:class"
"canonicalReference": "api-extractor-scenarios!~ForgottenClass:class"
},
{
"kind": "Content",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@
{
"kind": "Reference",
"text": "internal2.ForgottenExport6",
"canonicalReference": "api-extractor-scenarios!ForgottenExport6:class"
"canonicalReference": "api-extractor-scenarios!~ForgottenExport6:class"
},
{
"kind": "Content",
Expand Down

0 comments on commit 844f15b

Please sign in to comment.