kisstkondoros / gutter-preview

Other
158 stars 37 forks source link

No preview when running remote extension host #57

Closed jrieken closed 5 years ago

jrieken commented 5 years ago

When running this extension on a remote extension host, e.g via ssh, wsl, or docker, then the preview doesn't work. That's because images are downloaded and kept in a tmp file. That file is now on a different machine than the UI and therefore cannot be loaded. I wonder, if a data-uri can be used instead of the temp-file?

kisstkondoros commented 5 years ago

Thanks for raising the issue, I have actually wondered about using that but I've changed my mind quickly back then, because I've thought it would be horrible performance wise, since the images would then need to be converted and transferred in this format between the lang-server and client. I'm not sure how fast this could really be or if this matters at all in this scenario (in remote this is definitely problem IMO).

Could you recommend something better perhaps? Would you still prefer data-uri's even with the drawbacks?

jrieken commented 5 years ago

I have never measured the impact of large or huge data uris tbh, I would give it a try...

Anyways, it just occurred to me that things should also start working once you generate file-uris, instead of just paths, e.g. ![foo](file:///tmp/foo) instead of ![foo](/tmp/foo). We have logic in place that detects and rewrites uris before travelling to the UX, e.g. file:///tmp/foo will become vscode-remote:///tmp/foo and the UI knows how to resolve those (e.g. by talking back to the extension host).

kisstkondoros commented 5 years ago

Awesome, thanks! I'll give it a try once I finally get remote-extensions working with a docker image ^^

jrieken commented 5 years ago

I finally get remote-extensions working with a docker image ^^

Should be super simple with one of the try-out samples: https://code.visualstudio.com/docs/remote/containers#_quick-start-try-a-dev-container

kisstkondoros commented 5 years ago

Yes it should be, but I'm running into various issues one after the other... (permission problem -> was caused by the snap based docker installation, if I would like to debug the extension it disconnects etc.) Perhaps during the weekend there'll be some progress on this.

kisstkondoros commented 5 years ago

The new version with the fix should already be available in the market.

Thanks for your support on this!

jrieken commented 5 years ago

fyi - I have pushed one more change on our side and this is now working

kisstkondoros commented 5 years ago

Thanks!

mashirozx commented 4 years ago

The file:///tmp/foo.png format image cannot show on code-server:

screenshot

Dear author, do you have any idea on this issue? https://github.com/cdr/code-server/issues/1118

Kindly, regards.

mashirozx commented 4 years ago

The file:///tmp/foo.png format image cannot show on code-server:

screenshot

Dear author, do you have any idea on this issue? cdr/code-server#1118

Kindly, regards.

The code-server loads image from path like https://example.com/webview//vscode-resource/file///tmp/tmp-9026zmAZRZzyh96I.png, so if this extension could provide a option to set custom file path (uri) could be very convenience.

mashirozx commented 4 years ago

The file:///tmp/foo.png format image cannot show on code-server: screenshot Dear author, do you have any idea on this issue? cdr/code-server#1118 Kindly, regards.

The code-server loads image from path like https://example.com/webview//vscode-resource/file///tmp/tmp-9026zmAZRZzyh96I.png, so if this extension could provide a option to set custom file path (uri) could be very convenience.

This is a closed issue, but I think a new issue would be duplicate, may you have a look at my idea above? @kisstkondoros

kisstkondoros commented 4 years ago

I think this is a problem which should be solved by code-server, and for me it seems https://github.com/cdr/code-server/issues/1111 was a related issue and was solved by https://github.com/cdr/code-server/commit/f73e9225b480aafdd35a2acbee952f72a1cc22f5.

I suggest to update to the latest version and try to reproduce the problem.

If the issue is still present, please open a new issue where we could discuss it in detail.