Skip to content

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

Closed
@ericsnowcurrently

Description

@ericsnowcurrently

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-internalLabel for non-user facing issuesdebtCovers everything internal: CI, testing, refactoring of the codebase, etc.metaIssue 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