WorkspaceEdit

open class WorkspaceEdit(source)

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

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

Online Documentation

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Properties

Link copied to clipboard
external val size: Int

The number of affected resources of textual or resource changes.

Functions

Link copied to clipboard
external fun createFile(uri: Uri, options: WorkspaceEdit.CreateFileOptions = definedExternally, metadata: WorkspaceEditEntryMetadata = definedExternally)

Create a regular file.

Link copied to clipboard
external fun delete(uri: Uri, range: Range, metadata: WorkspaceEditEntryMetadata = definedExternally)

Delete the text at the given range.

Link copied to clipboard
external fun deleteFile(uri: Uri, options: WorkspaceEdit.DeleteFileOptions = definedExternally, metadata: WorkspaceEditEntryMetadata = definedExternally)

Delete a file or folder.

Link copied to clipboard

Get all text edits grouped by resource.

Link copied to clipboard
external fun get(uri: Uri): ReadonlyArray<TextEdit>

Get the text edits for a resource.

Link copied to clipboard
external fun has(uri: Uri): Boolean

Check if a text edit for a resource exists.

Link copied to clipboard
external fun insert(uri: Uri, position: Position, newText: String, metadata: WorkspaceEditEntryMetadata = definedExternally)

Insert the given text at the given position.

Link copied to clipboard
external fun renameFile(oldUri: Uri, newUri: Uri, options: WorkspaceEdit.RenameFileOptions = definedExternally, metadata: WorkspaceEditEntryMetadata = definedExternally)

Rename a file or folder.

Link copied to clipboard
external fun replace(uri: Uri, range: Range, newText: String, metadata: WorkspaceEditEntryMetadata = definedExternally)

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

Link copied to clipboard
external fun set(uri: Uri, edits: ReadonlyArray<JsAny>)

Set (and replace) text edits or snippet edits for a resource.

external fun set(uri: Uri, edits: ReadonlyArray<Tuple2<JsAny, WorkspaceEditEntryMetadata?>>)

Set (and replace) text edits or snippet edits with metadata for a resource.

Set (and replace) notebook edits with metadata for a resource.

external fun set(uri: Uri, edits: ReadonlyArray<NotebookEdit>)

Set (and replace) notebook edits for a resource.