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 can open an image (PNG) in the editor manually and there's workspace.openTextDocument, but, as expected from the function name, I can't use it to open the image file: "cannot open file:///.... Detail: File seems to be binary and cannot be opened as text". Perhaps there should be another function, such as openFile that could open any supported file type?
Copied from original issue: Microsoft/vscode-extensionbuilders#117
Wallabyjs offers the ability to display a screenshot of the last screen in the unit test in other GUIs (WebStorm, etc.). We really want this functionality in our preferred code editor VSCode as well.
Johannes Rieken (@jrieken) Thanks! No rush, I think I found a good alternative by essentially wrapping the image into an HTML page and displaying the HTML document with the vscode.previewHtml command (and custom content provider).
Reacted by Johannes Rieken, Thomas Jenkins, thomas-jeepe and Chris Dias
But from the workbench point of view you can pass in a file:/// URI pointing to an image and it will open as image. So I think everything should just work if you end up calling IEditorService.openEditor.
Activity
seanmcbreen commentedon Nov 24, 2015
From Johannes Rieken (@jrieken) on November 18, 2015 13:16
I like. Idea is to make the underlying command we already have so that it can accept an uri
executeCommandthomas-jeepe commentedon May 25, 2016
Progress so far?
newtack commentedon May 25, 2016
Wallabyjs offers the ability to display a screenshot of the last screen in the unit test in other GUIs (WebStorm, etc.). We really want this functionality in our preferred code editor VSCode as well.
jrieken commentedon May 25, 2016
I'll see what June allows
ArtemGovorov commentedon May 25, 2016
Johannes Rieken (@jrieken) Thanks! No rush, I think I found a good alternative by essentially wrapping the image into an HTML page and displaying the HTML document with the
vscode.previewHtmlcommand (and custom content provider).jrieken commentedon May 25, 2016
previewHtmlFTWthomas-jeepe commentedon May 25, 2016
Awesome!
newtack commentedon May 26, 2016
Fantastic!
jrieken commentedon Jun 25, 2016
Benjamin Pasero (@bpasero) Is this low hanging? Can I use the usual trick with a ResourceEditorInput?
bpasero commentedon Jun 25, 2016
No, because it's
resolvemethod will try to make a text editor model out of it (https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/common/editor/resourceEditorInput.ts#L159)bpasero commentedon Jun 25, 2016
But from the workbench point of view you can pass in a
file:///URI pointing to an image and it will open as image. So I think everything should just work if you end up callingIEditorService.openEditor.add 'vscode.open' API command, fixes microsoft#566