SIGN IN SIGN UP
denoland / deno UNCLAIMED

A modern runtime for JavaScript and TypeScript.

0 0 30 Rust

chore: test X-TypeScript-Types is picked up via import map (#34541)

## Summary

Adds a regression test confirming that the `X-TypeScript-Types` response
header is honored when a remote module is imported through an import-map
entry — the exact scenario reported in #20958 ("Can't get typings for
specifiers resolved with import map").

The bug itself is no longer reproducible against `main`, but nothing in
the LSP suite exercises the import-map ⊕ `X-TypeScript-Types`
combination
explicitly. This test guards against regression of both halves of the
behavior:

1. Hover on the import specifier shows the resolved `Code` URL (from the
   import map) and the `Types` URL (chased through the resolved module's
   `maybe_types_dependency`).
2. Hover on the imported member returns the literal type declared in the
   `.d.ts` (`'foo'`) — proving tsc actually loaded the declaration file
   rather than falling back to the `.js` source.

Closes denoland/orchid#289

## Test plan

- [x] `cargo test --test integration --
lsp_hover_typescript_types_via_import_map`
- [x] `./tools/format.js`
- [x] `./tools/lint.js --rs`

Co-authored-by: divybot <divybot@users.noreply.github.com>
Co-authored-by: Divy Srivastava <me@littledivy.com>
E
em committed
c0149976bc77b0cf010666deee52b024030078e9
Parent: d00ecdc
Committed by GitHub <noreply@github.com> on 5/30/2026, 2:43:05 AM