You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know opening custom editors for non text files has been raised before but discussion seems to have stalled. Instead, I'll propose the start of a solution.
The example that brought this to the forefront again was the vscode-pdf extension. It's probably the best done that I've seen but is still a huge hack and you still get a pretty weird user experience.
It listens for onDidOpenTextDocument and if the document has the language id it added, i.e. "pdf", it closes the active editor (assuming I guess that the current document is in the active editor), and opens up it's custom editor that renders pdf files instead.
That is essentially the behavior we're looking for. But I can imagine it would be much cleaner if we were allowed to register a command id with the language that would be run when opening the text document that short circuits the hack needed in the extension.
That still leaves hooking up editor menu commands like undo and save, but at least we could get viewers like the PDF one working much more cleanly.
The text was updated successfully, but these errors were encountered:
Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.
Closing as dupe of #12176. Adding a command to the languages is really not the right layer for this. This should be done somewhere in the opening world...
I know opening custom editors for non text files has been raised before but discussion seems to have stalled. Instead, I'll propose the start of a solution.
The example that brought this to the forefront again was the vscode-pdf extension. It's probably the best done that I've seen but is still a huge hack and you still get a pretty weird user experience.
It listens for onDidOpenTextDocument and if the document has the language id it added, i.e. "pdf", it closes the active editor (assuming I guess that the current document is in the active editor), and opens up it's custom editor that renders pdf files instead.
That is essentially the behavior we're looking for. But I can imagine it would be much cleaner if we were allowed to register a command id with the language that would be run when opening the text document that short circuits the hack needed in the extension.
That still leaves hooking up editor menu commands like undo and save, but at least we could get viewers like the PDF one working much more cleanly.
The text was updated successfully, but these errors were encountered: