Rewrite as virtual document provider
See original GitHub issueVSCode 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!
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
File System API | Visual Studio Code Extension API
Virtual Documents. The text document content provider API allows you to create readonly documents in Visual Studio Code from arbitrary sources.
Read more >Editable TextDocumentContentProvider for extensions #10547
Quick summary -- using editable virtual documents to compare changes and (manually) sync the edits back to the main document. An alternative ...
Read more >vscode Editable Virtual Documents in Extensions
I'm trying to do something similar with Joplin - opening, editing and saving notes via a REST API. I'm not as far along...
Read more >Virtual Documents | InterSystems IRIS Data Platform 2022.2
A virtual document allows you to send raw document content as a body of a production message, without creating objects to hold the...
Read more >Using RewriteMap - Apache HTTP Server Version 2.4
The RewriteMap directive defines an external function which can be called in the context of RewriteRule or RewriteCond directives to perform rewriting that...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This is done now thanks to @taksuparth. Closing.
I would like to give it a shot.