Options
All
  • Public
  • Public/Protected
  • All
Menu

A complex edit that will be applied in one transaction on a TextEditor. This holds a description of the edits and if the edits are valid (i.e. no overlapping regions, document was not changed in the meantime, etc.) they can be applied on a document associated with a text editor.

层级

  • TextEditorEdit

索引

Methods(4)

replace

  • Replace a certain text region with a new value. You can use \r\n or \n in value and they will be normalized to the current document.

    Parameters

    • location: Range | Position | Selection

      The range this operation should remove.

    • value: string

      The new text this operation should insert after removing location.

    Returns void

insert

  • insert(location: Position, value: string): void
  • Insert text at a location. You can use \r\n or \n in value and they will be normalized to the current document. Although the equivalent text edit can be made with replace, insert will produce a different resulting selection (it will get moved).

    Parameters

    • location: Position

      The position where the new text should be inserted.

    • value: string

      The new text this operation should insert.

    Returns void

delete

  • Delete a certain text region.

    Parameters

    Returns void

setEndOfLine

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

Generated by TypeDoc. Maintained by 洛竹