question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rewrite as virtual document provider

See original GitHub issue

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!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mrecommented, Feb 7, 2020

This is done now thanks to @taksuparth. Closing.

1reaction
taksuparthcommented, Oct 12, 2019

I would like to give it a shot.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found