A workspace edit is a collection of textual and files changes for multiple resources and documents.
Use the {@link workspace.applyEdit applyEdit}-function to apply a workspace edit.
A workspace edit is a collection of textual and files changes for multiple resources and documents. Use the {@link workspace.applyEdit applyEdit}-function to apply a workspace edit.
(create-file workspace-edit uri)
(create-file workspace-edit uri options)
(create-file workspace-edit uri options metadata)
Create a regular file.
Parameters:
uri
: Uri
- Uri of the new file.options
: { readonly overwrite?: boolean | undefined; readonly ignoreIfExists?: boolean | undefined; readonly contents?: Uint8Array | DataTransferFile | undefined; } | undefined
- 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. The content
-property allows to set the initial contents
the file is being created with.metadata
: WorkspaceEditEntryMetadata | undefined
- Optional metadata for the entry.Returns: void
Create a regular file. **Parameters:** - `uri`: `Uri` - Uri of the new file. - `options`: `{ readonly overwrite?: boolean | undefined; readonly ignoreIfExists?: boolean | undefined; readonly contents?: Uint8Array | DataTransferFile | undefined; } | undefined` - 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. The `content`-property allows to set the initial contents the file is being created with. - `metadata`: `WorkspaceEditEntryMetadata | undefined` - Optional metadata for the entry. **Returns:** `void`
(delete workspace-edit uri range)
(delete workspace-edit uri range metadata)
Delete the text at the given range.
Parameters:
uri
: Uri
- A resource identifier.range
: Range
- A range.metadata
: WorkspaceEditEntryMetadata | undefined
- Optional metadata for the entry.Returns: void
Delete the text at the given range. **Parameters:** - `uri`: `Uri` - A resource identifier. - `range`: `Range` - A range. - `metadata`: `WorkspaceEditEntryMetadata | undefined` - Optional metadata for the entry. **Returns:** `void`
(delete-file workspace-edit uri)
(delete-file workspace-edit uri options)
(delete-file workspace-edit uri options metadata)
Delete a file or folder.
Parameters:
uri
: Uri
- The uri of the file that is to be deleted.options
: { readonly recursive?: boolean | undefined; readonly ignoreIfNotExists?: boolean | undefined; } | undefined
metadata
: WorkspaceEditEntryMetadata | undefined
- 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. - `options`: `{ readonly recursive?: boolean | undefined; readonly ignoreIfNotExists?: boolean | undefined; } | undefined` - `metadata`: `WorkspaceEditEntryMetadata | undefined` - Optional metadata for the entry. **Returns:** `void`
(entries workspace-edit)
Get all text edits grouped by resource.
Returns: [Uri, TextEdit[]][]
- A shallow copy of [Uri, TextEdit[]]
-tuples.
Get all text edits grouped by resource. **Returns:** `[Uri, TextEdit[]][]` - A shallow copy of `[Uri, TextEdit[]]`-tuples.
(get workspace-edit uri)
Get the text edits for a resource.
Parameters:
uri
: Uri
- A resource identifier.Returns: TextEdit[]
- An array of text edits.
Get the text edits for a resource. **Parameters:** - `uri`: `Uri` - A resource identifier. **Returns:** `TextEdit[]` - An array of text edits.
(has? workspace-edit uri)
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.
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.
(insert workspace-edit uri position new-text)
(insert workspace-edit uri position new-text metadata)
Insert the given text at the given position.
Parameters:
uri
: Uri
- A resource identifier.position
: Position
- A position.new-text
: string
- A string.metadata
: WorkspaceEditEntryMetadata | undefined
- Optional metadata for the entry.Returns: void
Insert the given text at the given position. **Parameters:** - `uri`: `Uri` - A resource identifier. - `position`: `Position` - A position. - `new-text`: `string` - A string. - `metadata`: `WorkspaceEditEntryMetadata | undefined` - Optional metadata for the entry. **Returns:** `void`
(rename-file workspace-edit old-uri new-uri)
(rename-file workspace-edit old-uri new-uri options)
(rename-file workspace-edit old-uri new-uri options metadata)
Rename a file or folder.
Parameters:
old-uri
: Uri
- The existing file.new-uri
: Uri
- The new location.options
: { readonly overwrite?: boolean | undefined; readonly ignoreIfExists?: boolean | undefined; } | undefined
- Defines if existing files should be overwritten or be
ignored. When overwrite and ignoreIfExists are both set overwrite wins.metadata
: WorkspaceEditEntryMetadata | undefined
- Optional metadata for the entry.Returns: void
Rename a file or folder. **Parameters:** - `old-uri`: `Uri` - The existing file. - `new-uri`: `Uri` - The new location. - `options`: `{ readonly overwrite?: boolean | undefined; readonly ignoreIfExists?: boolean | undefined; } | undefined` - Defines if existing files should be overwritten or be ignored. When overwrite and ignoreIfExists are both set overwrite wins. - `metadata`: `WorkspaceEditEntryMetadata | undefined` - Optional metadata for the entry. **Returns:** `void`
(replace workspace-edit uri range new-text)
(replace workspace-edit uri range new-text metadata)
Replace the given range with given text for the given resource.
Parameters:
uri
: Uri
- A resource identifier.range
: Range
- A range.new-text
: string
- A string.metadata
: WorkspaceEditEntryMetadata | undefined
- Optional metadata for the entry.Returns: void
Replace the given range with given text for the given resource. **Parameters:** - `uri`: `Uri` - A resource identifier. - `range`: `Range` - A range. - `new-text`: `string` - A string. - `metadata`: `WorkspaceEditEntryMetadata | undefined` - Optional metadata for the entry. **Returns:** `void`
(set workspace-edit uri edits)
Set (and replace) text edits or snippet edits for a resource. Set (and replace) text edits or snippet edits with metadata for a resource. Set (and replace) notebook edits for a resource. Set (and replace) notebook edits with metadata for a resource.
Parameters:
uri
: Uri
- A resource identifier.edits
: readonly [NotebookEdit, WorkspaceEditEntryMetadata | undefined][]
- An array of edits.Returns: void
Set (and replace) text edits or snippet edits for a resource. Set (and replace) text edits or snippet edits with metadata for a resource. Set (and replace) notebook edits for a resource. Set (and replace) notebook edits with metadata for a resource. **Parameters:** - `uri`: `Uri` - A resource identifier. - `edits`: `readonly [NotebookEdit, WorkspaceEditEntryMetadata | undefined][]` - An array of edits. **Returns:** `void`
(size workspace-edit)
The number of affected resources of textual or resource changes.
Returns: number
The number of affected resources of textual or resource changes. **Returns:** `number`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close