twoslash icon indicating copy to clipboard operation
twoslash copied to clipboard

You take some Shiki, add a hint of TypeScript compiler, and 🎉 incredible static code samples

Results 65 twoslash issues
Sort by recently updated
recently updated
newest added

"Based" on @sandersn's lexer in https://github.com/sandersn/mini-typescript - this single file lib will take the quick info text and apply syntax highlighting to the typescript-like psuedo subset in there We cna...

Hey Orta, would have any interest in extending this library to support generation for multiple languages? I recently added support for Rust to this library in a local fork (here...

Hi there, been a huge fan of twoslash! Currently experimenting with `remark-shiki-twoslash` on my Next.js + `@mdx-js/mdx` v2 project and for some reason when highlighting multiple specific lines (e.g. `{7,12}`)...

Enhancement
You can do this

I'm using `remark-shiki-twoslash`: ```js const rendered = await unified() .use(remarkParse) .use(remarkTwoslash, ({theme: 'dark-plus'})) .use(remarkGfm) .use(remarkRehype) .use(rehypeStringify) .process(` \`\`\`ts const msg = "this"; // ^? \`\`\` `); console.log(String(rendered)); ``` For some...

I have recently been trying to integrate `remark-shiki-twoslash` with [Astro](https://astro.build/) and I have been getting some weird errors. Reproduction repo [here](https://github.com/chopfitzroy/astro-shiki-twoslash). I have the following code block in a markdown...

Hey! 👋 I'm using `remark-shiki-twoslash` with `unified` and I get this error `TypeError: attacher.call is not a function.` I already opened a discussion at https://github.com/unifiedjs/unified/discussions/187 but I was told to...

Bug
You can do this

This PR resolves #144 by creating a new function that checks whether each token is within the _range_ of an error (`e.character` to `e.character + e.length`). Checking the range produces...

I'm trying to render an error for this block of code: ```ts type MyPick = { [Key in K]: T[Key] } ``` I'm using this `twoslash` block: ```` ```ts twoslash...

Extracting from #141 We can provide twoslash-style tooltips but for JSON documents, based on JSON schema. The schema-based tooltips can be generated using VSCode's JSON language service, https://github.com/microsoft/vscode-json-languageservice

When `tsconfigJSONRenderer` checks if a token is a known tsconfig property, it assumes the token starts and ends with double-quotes. However, on themes where the surrounding quotes are rendered in...