Skip to content

fix: get twoslash to work properly with JSDoc#1959

Merged
Rich-Harris merged 8 commits intomainfrom
fix-js-type-hovers
Apr 30, 2026
Merged

fix: get twoslash to work properly with JSDoc#1959
Rich-Harris merged 8 commits intomainfrom
fix-js-type-hovers

Conversation

@Rich-Harris
Copy link
Copy Markdown
Member

Various fixes for type hovers in JSDoc snippets — turns this...

image

...into this, by providing twoslash with the correct context in the form of a filename (so it doesn't mistakenly think it's still dealing with an ambient.d.ts file) and by stripping @type tags:

image

It also turns this...

image

...into this, by using CSS grids properly:

image

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
svelte-dev Ready Ready Preview Apr 30, 2026 9:01pm

Request Review

@teemingc
Copy link
Copy Markdown
Member

Looks like there are some snippet type errors possibly due to the new format

@Rich-Harris
Copy link
Copy Markdown
Member Author

Gradually working through the newly-exposed type errors. They'll need to be backported to the other repos, but it's easier to begin by making the changes here

@Rich-Harris
Copy link
Copy Markdown
Member Author

Extracted the necessary upstream changes: sveltejs/kit#15781

Since we can't merge Kit docs just yet (#1955 is blocked), no harm in merging these temporary changes

@Rich-Harris Rich-Harris merged commit 2059b50 into main Apr 30, 2026
2 checks passed
@Rich-Harris Rich-Harris deleted the fix-js-type-hovers branch April 30, 2026 21:15
Rich-Harris added a commit to sveltejs/kit that referenced this pull request May 1, 2026
extracted from sveltejs/svelte.dev#1959

---------

Co-authored-by: Tee Ming <[email protected]>
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.

2 participants