Skip to content

IFileService doesn't support binary data #41543

@jrieken

Description

@jrieken

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.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugfile-ioFile I/OremoteRemote system operations issuesverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions