Skip to content

fix(html): link type references through aliased re-exports of internal files - #862

Open
crowlKats wants to merge 2 commits into
mainfrom
fix-import-alias-linking
Open

crowlKats wants to merge 2 commits into
mainfrom
fix-import-alias-linking

Conversation

@crowlKats

Copy link
Copy Markdown
Member

Fixes #426
Fixes #427

A type imported from a file that isn't a documented entrypoint, but which another entrypoint re-exports under a different name, was rendered as plain text:

// a.ts
import { Data } from "./_util.ts";
export function f(): Data {}
// b.ts
export { type Data as Foo } from "./_util.ts";

Data in f's signature now links to b.ts/~/Foo.html.

  • The parser resolves each named/default import to its declaration (following re-exports) and records it as a new optional location on Import.
  • lookup_symbol_href uses that location to find the documented re-export via the reference index when the import source isn't a documented file. Member paths work too (Util.Options → Helpers.Options).
  • js/types.d.ts mirrors the new field.

The other two cases from the issues (Foo.Data through an import, and import { Data as Foo } alongside a local Data) already worked on main; regression tests cover all of them.

Comment thread js/types.d.ts Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

html output handle import of namespace and element usage fix handling of aliases imports and exports

1 participant