Skip to content

Rewrite as virtual document provider #25

@mre

Description

@mre

VSCode has this fancy feature called "virtual document providers".

With that, vscode-snippet would simply become a provider that gets triggered whenever a certain URL gets requested, e.g. snippet://read+file.
The cool thing about it would be that we could have "read only" documents instead of the current "untitled" documents that have to be closed manually. We can also set a document title, e.g. the search query and the programming language (i.e. [python] read file).
On top of that, I assume that this would also reduce the code size quite a bit as a lot gets handled by VSCode itself.

Here is an example on how to implement it.
If anyone wants to give this a go, help would be really appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions