The contract for resolving a file is to return IContent with value: string (or the string-stream equivalent). That API prevents us from doing a few things, such as previewing images from remote sources (see #34773) and things like drag and drop of files between different file systems, esp between the file-support and others.
An easy way to corrupt your data is:
- have a workspace folder from disk and one from ftp
- have an image file in the workspace folder from disk
- dnd that onto a folder in the ftp workspace
- 🐛 the image is now garbage...
IMO the better API would be to just talk about bytes or chunks of bytes and turn things into a string later, e.g in the text file service. That would allow to pump data from one provider onto another provider, it would also allow to build data-uris for remote images.
The contract for resolving a file is to return
IContentwithvalue: string(or the string-stream equivalent). That API prevents us from doing a few things, such as previewing images from remote sources (see #34773) and things like drag and drop of files between different file systems, esp between thefile-support and others.An easy way to corrupt your data is:
IMO the better API would be to just talk about bytes or chunks of bytes and turn things into a string later, e.g in the text file service. That would allow to pump data from one provider onto another provider, it would also allow to build data-uris for remote images.