Test TS Hover Prettify without the npm package and without a committed prettify.d.ts.
| In this folder | Purpose |
|---|---|
demo.ts |
Intersection wrapped in Prettify — hover to compare flattened vs unwrapped display |
tsconfig.json |
Minimal strict config; include lists demo.ts only until the extension runs |
Types must come from the extension. There is no prettify.d.ts here on purpose.
Open demo.ts and hover Intersected. With the extension active you should see a single object shape, for example:
type Intersected = { a: string; b: number; c: boolean; }Without Prettify (or without the extension), the same intersection hovers as chained & types.
From the repository root:
pnpm install
pnpm build- Open
packages/vscode-extensionin VS Code or Cursor. - Press F5 (Run Extension).
- In the new window, File → Open Folder → this directory (
examples/intersected-types). - Open
demo.ts.
On first open the extension should:
- Create
.vscode/ts-hover-prettify.d.tswith thePrettifydefinition. - Append
.vscode/ts-hover-prettify.d.tstotsconfig.jsoninclude(this example already declares anincludearray).
If Prettify is not recognized, run TypeScript: Restart TS Server.
pnpm package:extensionInstall packages/vscode-extension/build/ts-hover-prettify-vscode-*.vsix via Extensions: Install from VSIX, then:
- Open this folder, or the monorepo root (extension 0.1.4+ discovers nested
tsconfig.jsonfiles). - Open
demo.tsand confirmPrettifyresolves without addingprettify.d.tsyourself. - Reload the window if hovers do not update after install.
Use extension 0.1.4+ for monorepo-root workspaces; older VSIX builds may not patch nested configs.
Simulates the extension’s file writes for tsc only:
pnpm verify:example-extensionThis runs scripts/ensure-example-types.mjs (writes .vscode/ts-hover-prettify.d.ts and updates include) then tsc --noEmit. It does not prove hover UI; use F5 or a VSIX for that.
For the same demo with the ts-hover-prettify package instead of the extension, see ../intersected-types-npm.