TwoSlash is great for TS code to display those types of information; it also provides a layer of pre-compiled information for tools like Shiki to consume. While TwoSlash is bound to the TypeScript language server, the generated information is actually not. This means that ppl could actually have different implementations to provide information in a similar data structure and reuse the infra that TwoSlash brings.
For example,
We have twoslash-vue to support Vue language, while outputs information that transformed from Volar's LSP rewrites
While I already made two slasher swappable in the Shiki transformer, I think it would be better if we provide a standardized type and interface to describe that information that can generally serve as an abstract layer for describing hover/error info from editors.
I imagine we could have a twoslash-protocol package or so that defines the types and provides some utilities like mapping the code positions, etc. So implementations like twoslash-rust and twoslash-eslint would deps on it without introducing typescript as deps at all.
TwoSlash is great for TS code to display those types of information; it also provides a layer of pre-compiled information for tools like Shiki to consume. While TwoSlash is bound to the TypeScript language server, the generated information is actually not. This means that ppl could actually have different implementations to provide information in a similar data structure and reuse the infra that TwoSlash brings.
For example,
twoslash-vue
to support Vue language, while outputs information that transformed from Volar's LSP rewritestwoslash-rust
: https://github.com/ayazhafiz/twoslash-rustWhile I already made
two slasher
swappable in the Shiki transformer, I think it would be better if we provide a standardized type and interface to describe that information that can generally serve as an abstract layer for describing hover/error info from editors.I imagine we could have a
twoslash-protocol
package or so that defines the types and provides some utilities like mapping the code positions, etc. So implementations liketwoslash-rust
andtwoslash-eslint
would deps on it without introducing typescript as deps at all.WDYT? @orta