twoslashes / twoslash

Markup for generating rich type information in your documentations ahead of time.
https://twoslash.netlify.app/
MIT License
506 stars 17 forks source link

docs: some work on moving over the reference docs #7

Closed orta closed 8 months ago

orta commented 8 months ago

I've started porting over the reference docs from the shiki-twoslash playground!

One tricky deprecation blocker so far, which is the auto-complete query doesn't work because it can't grab the character after the last one

console.e
//       ^|

=>

Error: [shikiji-twoslash] Cannot find token at L0:9
    at locateTextToken (file:///home/orta/dev/typescript/twoslashes/node_modules/.pnpm/shikiji-twoslash@0.10.0-beta.0/node_modules/shikiji-twoslash/dist/core.mjs:869:19)
    at Object.code (file:///home/orta/dev/typescript/twoslashes/node_modules/.pnpm/shikiji-twoslash@0.10.0-beta.0/node_modules/shikiji-twoslash/dist/core.mjs:897:25)

Which is kinda true, (there is no token!) but the auto-complete is only relevant after the text

netlify[bot] commented 8 months ago

Deploy Preview for twoslash ready!

Name Link
Latest commit 4e88cc6a3f6c9dd71c7612c286bbcca1a8c08201
Latest deploy log https://app.netlify.com/sites/twoslash/deploys/65a506d41aad310008e0eb8c
Deploy Preview https://deploy-preview-7--twoslash.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

antfu commented 8 months ago

Oh I wasn't aware that use cases, added a test to guard it: 70f6d1c1f96e1abca5a0ab8ddae10052436d5b63

It seems the output of two slash is expected; I will handle it on the Shikiji side.

antfu commented 8 months ago

I actually fixed it already on the last Shikiji release :P, you may need to pnpm i to update them :)

orta commented 8 months ago

Nice