Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Use the applyEdit-function to apply a workspace edit.

层级

  • WorkspaceEdit

索引

Constructors(1)

Properties(1)

Methods(10)

Constructors(1)

constructor

Properties(1)

Readonly size

size: number

The number of affected resources of textual or resource changes.

Methods(10)

replace

  • Replace the given range with given text for the given resource.

    Parameters

    Returns void

insert

  • Insert the given text at the given position.

    Parameters

    Returns void

delete

has

  • has(uri: Uri): boolean
  • 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.

set

  • Set (and replace) text edits for a resource.

    Parameters

    • uri: Uri

      A resource identifier.

    • edits: TextEdit[]

      An array of text edits.

    Returns void

get

  • Get the text edits for a resource.

    Parameters

    • uri: Uri

      A resource identifier.

    Returns TextEdit[]

    An array of text edits.

createFile

  • Create a regular file.

    Parameters

    • uri: Uri

      Uri of the new file..

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

      Defines if an existing file should be overwritten or be ignored. When overwrite and ignoreIfExists are both set overwrite wins. When both are unset and when the file already exists then the edit cannot be applied successfully.

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

      Optional metadata for the entry.

    Returns void

deleteFile

  • Delete a file or folder.

    Parameters

    • uri: Uri

      The uri of the file that is to be deleted.

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

      Optional metadata for the entry.

    Returns void

renameFile

  • Rename a file or folder.

    Parameters

    • oldUri: Uri

      The existing file.

    • newUri: Uri

      The new location.

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

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

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

      Optional metadata for the entry.

    Returns void

entries

  • Get all text edits grouped by resource.

    Returns [Uri, TextEdit[]][]

    A shallow copy of [Uri, TextEdit[]]-tuples.

友链:VS Code 中文文档 | VS Code 官网文档 | VS Code 扩展市场

Generated by TypeDoc. Maintained by 洛竹