A workspace edit is a collection of textual and files changes for multiple resources and documents.

Use the workspace.applyEdit applyEdit-function to apply a workspace edit.

Implemented by

Constructors

Properties

size: number

The number of affected resources of textual or resource changes.

Methods

  • Create a regular file.

    Parameters

    • uri: Uri

      Uri of the new file..

    • Optional options: {
          ignoreIfExists?: boolean;
          overwrite?: boolean;
      }

      Defines if an existing file should be overwritten or be ignored. When overwrite and ignoreIfExists are both set overwrite wins.

      • Optional ignoreIfExists?: boolean
      • Optional overwrite?: boolean
    • Optional metadata: WorkspaceEditEntryMetadata

      Optional metadata for the entry.

    Returns void

  • Delete a file or folder.

    Parameters

    • uri: Uri

      The uri of the file that is to be deleted.

    • Optional options: {
          ignoreIfNotExists?: boolean;
          recursive?: boolean;
      }
      • Optional ignoreIfNotExists?: boolean
      • Optional recursive?: boolean
    • Optional metadata: WorkspaceEditEntryMetadata

      Optional metadata for the entry.

    Returns void

  • Check if a text edit for a resource exists.

    Parameters

    • uri: Uri

      A resource identifier.

    Returns boolean

    true if the given resource will be touched by this edit.

  • Rename a file or folder.

    Parameters

    • oldUri: Uri

      The existing file.

    • newUri: Uri

      The new location.

    • Optional options: {
          ignoreIfExists?: boolean;
          overwrite?: boolean;
      }

      Defines if existing files should be overwritten or be ignored. When overwrite and ignoreIfExists are both set overwrite wins.

      • Optional ignoreIfExists?: boolean
      • Optional overwrite?: boolean
    • Optional metadata: WorkspaceEditEntryMetadata

      Optional metadata for the entry.

    Returns void