Skip to content

[meta] Use the vscode filesystem API for *all* filesystem operations. #8533

Closed

Description

With version , VS Code added a new filesystem API, to provide a consistent and reliable experience on different platforms and execution environments (including remote). The extension should use it as much as possible.

The API

vscode.workspace.fs.*
  copy(source: Uri, target: Uri, options?: {overwrite: boolean}): Thenable<void>
  createDirectory(uri: Uri): Thenable<void>
  delete(uri: Uri, options?: {recursive: boolean, useTrash: boolean}): Thenable<void>
  readDirectory(uri: Uri): Thenable<[string, FileType][]>
  readFile(uri: Uri): Thenable<Uint8Array>
  rename(source: Uri, target: Uri, options?: {overwrite: boolean}): Thenable<void>
  stat(uri: Uri): Thenable<FileStat>
  writeFile(uri: Uri, content: Uint8Array): Thenable<void>

vscode.FileStat
vscode.FileType

For reference:

How to Switch?

PRs:

Tasks:

Activity

  1. ericsnowcurrently commented on May 14, 2020

    @ericsnowcurrently
    Author

    FWIW, I'm not sure this is totally done (would have to check), but it's probably better closed for now. We can revive it or dupe it later if that turns out to matter.

  2. locked as resolved and limited conversation to collaborators on Oct 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-internalLabel for non-user facing issuesdebtCode quality issuesmetaIssue that is tracking an overall project

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions