shikijs / twoslash

You take some Shiki, add a hint of TypeScript compiler, and 🎉 incredible static code samples
https://shikijs.github.io/twoslash/
MIT License
1.09k stars 53 forks source link

Missing JSDoc annotations #122

Open carlo-quinonez opened 3 years ago

carlo-quinonez commented 3 years ago

First of all, just wanted to say thank you for this awesome library! I was able to get it working in Vuepress after some effort effort, and I'm excited to start building it into our documentation system.

I was wondering if there's someway to display TSDoc annotations with twoslash? I noticed the Typescript sandbox shows the TSDocs, but Twoslash doesn't. Are TSdocs in the roadmap for Twoslash?

Typescript sandbox w TSDocs

Twoslash sandbox w/o TSDocs

carlo-quinonez commented 3 years ago

I just saw this is probably a duplicate of #64. I was confused because I didn't see the JSDoc appear on the playground page, so I assumed it wasn't implemented. Looking at #64, it seems like this isn't the case and this might be a bug?

I've tried the test fixture for JSdocs with the same results (ie. no jsdoc). In my browser, I see a lot of Unknown custom element <data-lsp> errors.

image

My versions are: "markdown-it": "12.2.0" "markdown-it-shiki-twoslash": "^2.0.19"

carlo-quinonez commented 3 years ago

I believe this problem is related to declarations not being available. I've tried the simple example and get errors.

image

image

orta commented 3 years ago

interesting I've never used web components, maybe they're messing with the <data-lsp> attributes!