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.08k stars 54 forks source link

TypeScript syntax highlithing and twoslash autocompletion does not work in mdx files #172

Open vecerek opened 2 years ago

vecerek commented 2 years ago

Given the mdx vscode extension and the Twoslash VS code extension are both installed, these two files, and a docusaurus 2.0 setup with mdx:

repro.md ````md ```ts twoslash // ---cut--- const hi = "Hi" as const; ``` ````
repro.mdx ````md import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; ```ts twoslash // ---cut--- const hi = "Hi" as const; ``` ````

I would expect the TypeScript code to be highlighted the same way in both files. Instead, I see this:

Screenshot 2022-11-03 at 23 21 07

Can you also reproduce this behavior, or is it just something with my local setup? 😅 Would you expect the twoslahs plug to work for both MD and MDX files?

orta commented 2 years ago

I've never worked with mdx, so I didn't add support - you're welcome to add support though!