Skip to content

Understanding twoslash VFS, doing something wrong? missed something? #59

@Adammatthiesen

Description

@Adammatthiesen

As I have been progressing through stabilizing my new expressive-code-twoslash Expressive code plugin, one of the issues I've been facing is the inability to use the showEmit functions. It seems that the VFS is not being appended correctly, I've tried reading through the source of both shiki-twoslash as well as twoslash and it seems like this should be handled automatically by twoslash, but the only thing I seem to get is the error "unable to find file from virtual file system containing ." for any codeblock I try to enable showEmit on. Would appreciate any input that could help resolve this issue.

With EC:

Input:

```ts twoslash
// @showEmit
const level: string = 'Danger'
```

Error:

## Cannot find the output file in the Twoslash VFS

Looking for index.js in the Twoslash vfs after compiling

Looked for" /home/native/Documents/Repos/EC-Plugins/docs/twoslash/index.js in the vfs - which contains .

Project Github for reference: https://github.com/MatthiesenXYZ/EC-Plugins/tree/main/packages/twoslash

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions