Skip to content

Support creating binary files in a WorkspaceEdit #148667

Description

@mjbvz

Feature Request

Add support for setting the contents of files created by workspace edits

My proposed would be to add a contents option to createFile:

createFile(uri: Uri, options?: { overwrite?: boolean; ignoreIfExists?: boolean; contents?: UInt8Array }, metadata?: WorkspaceEditEntryMetadata): void;

Use case

For #147481, we want to support copying images from desktop into vscode.dev with drag and drop. Right now we have to use the fs apis to create the image file

Using a workspace edit would let us express the entire operation in a single WorkspaceEdit, which will play more nicely with undo/redo

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions