Skip to content

Commit 4cba23d

Browse files
committed
Further Custom editor docs updates
microsoft#93963
1 parent 8a25588 commit 4cba23d

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

src/vs/vscode.d.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6928,11 +6928,13 @@ declare module 'vscode' {
69286928
* are updated to render the document's new state (that is, every webview must be updated to show the document
69296929
* after applying `edits` to it).
69306930
*
6931-
* Note that `applyEdits` not invoked when `onDidEdit` is called because `onDidEdit` implies that your extension
6932-
* has also updated its editor instances to reflect the edit that just occurred.
6931+
* Note that `applyEdits` not invoked when `onDidEdit` is fired by your extension because `onDidEdit` implies
6932+
* that your extension has also updated its editor instances (webviews) to reflect the edit that just occurred.
69336933
*
69346934
* @param document Document to apply edits to.
6935-
* @param edit Array of edits. Sorted from oldest to most recent.
6935+
* @param edit Array of edits. Sorted from oldest to most recent. Use [`document.appliedEdits`](#CustomDocument.appliedEdits)
6936+
* to get the full set of edits applied to the file (when `applyEdits` is called `appliedEdits` will already include
6937+
* the newly applied edit at the end).
69366938
*
69376939
* @return Thenable signaling that the change has completed.
69386940
*/
@@ -6948,7 +6950,9 @@ declare module 'vscode' {
69486950
* after undoing `edits` from it).
69496951
*
69506952
* @param document Document to undo edits from.
6951-
* @param edit Array of edits. Sorted from most recent to oldest.
6953+
* @param edit Array of edits. Sorted from most recent to oldest. Use [`document.appliedEdits`](#CustomDocument.appliedEdits)
6954+
* to get the full set of edits applied to the file (when `undoEdits` is called, `appliedEdits` will already include
6955+
* have the undone edits removed).
69526956
*
69536957
* @return Thenable signaling that the change has completed.
69546958
*/
@@ -6968,11 +6972,13 @@ declare module 'vscode' {
69686972
* when there is a difference between an editor's state in VS Code and its save state on disk.
69696973
*
69706974
* @param document Document to revert.
6971-
* @param edits Added or removed edits to get back to the saved state.
6975+
* @param revert Object with added or removed edits to get back to the saved state. Use [`document.appliedEdits`](#CustomDocument.appliedEdits)
6976+
* to get the full set of edits applied to the file (when `revet` is called, `appliedEdits` will already have
6977+
* removed any edits undone by the revert and added any edits applied by the revert).
69726978
*
69736979
* @return Thenable signaling that the change has completed.
69746980
*/
6975-
revert(document: CustomDocument<EditType>, edits: CustomDocumentRevert<EditType>): Thenable<void>;
6981+
revert(document: CustomDocument<EditType>, revert: CustomDocumentRevert<EditType>): Thenable<void>;
69766982

69776983
/**
69786984
* Back up the resource in its current state.

0 commit comments

Comments
 (0)