Skip to content

Commit d4ca08f

Browse files
committed
💄
1 parent b005f53 commit d4ca08f

1 file changed

Lines changed: 25 additions & 24 deletions

File tree

src/vs/vscode.proposed.d.ts

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,6 +1303,29 @@ declare module 'vscode' {
13031303
* document is also how custom editors notify VS Code that an edit has taken place.
13041304
*/
13051305
interface EditableCustomDocument extends CustomDocument {
1306+
1307+
/**
1308+
* Signal that an edit has occurred inside a custom editor.
1309+
*
1310+
* This event must be fired by your extension whenever an edit happens in a custom editor. An edit can be
1311+
* anything from changing some text, to cropping an image, to reordering a list. Your extension is free to
1312+
* define what an edit is and what data is stored on each edit.
1313+
*
1314+
* Firing `onDidChange` causes VS Code to mark the editors as being dirty. This is cleared when the user either
1315+
* saves or reverts the file.
1316+
*
1317+
* Editors that support undo/redo must fire a `CustomDocumentEditEvent` whenever an edit happens. This allows
1318+
* users to undo and redo the edit using VS Code's standard VS Code keyboard shortcuts. VS Code will also mark
1319+
* the editor as no longer being dirty if the user undoes all edits to the last saved state.
1320+
*
1321+
* Editors that support editing but cannot use VS Code's standard undo/redo mechanism must fire a `CustomDocumentContentChangeEvent`.
1322+
* The only way for a user to clear the dirty state of an editor that does not support undo/redo is to either
1323+
* `save` or `revert` the file.
1324+
*
1325+
* An editor should only ever fire `CustomDocumentEditEvent` events, or only ever fire `CustomDocumentContentChangeEvent` events.
1326+
*/
1327+
readonly onDidChange: Event<CustomDocumentEditEvent> | Event<CustomDocumentContentChangeEvent>;
1328+
13061329
/**
13071330
* Save the resource for a custom editor.
13081331
*
@@ -1327,34 +1350,12 @@ declare module 'vscode' {
13271350
* To implement `saveAs`, the implementer must persist the custom editor to `targetResource`. The
13281351
* existing editor will remain open after `saveAs` completes.
13291352
*
1330-
* @param targetResource Location to save to.
1353+
* @param uri Location to save to.
13311354
* @param cancellation Token that signals the save is no longer required.
13321355
*
13331356
* @return Thenable signaling that saving has completed.
13341357
*/
1335-
saveAs(targetResource: Uri, cancellation: CancellationToken): Thenable<void>;
1336-
1337-
/**
1338-
* Signal that an edit has occurred inside a custom editor.
1339-
*
1340-
* This event must be fired by your extension whenever an edit happens in a custom editor. An edit can be
1341-
* anything from changing some text, to cropping an image, to reordering a list. Your extension is free to
1342-
* define what an edit is and what data is stored on each edit.
1343-
*
1344-
* Firing `onDidChange` causes VS Code to mark the editors as being dirty. This is cleared when the user either
1345-
* saves or reverts the file.
1346-
*
1347-
* Editors that support undo/redo must fire a `CustomDocumentEditEvent` whenever an edit happens. This allows
1348-
* users to undo and redo the edit using VS Code's standard VS Code keyboard shortcuts. VS Code will also mark
1349-
* the editor as no longer being dirty if the user undoes all edits to the last saved state.
1350-
*
1351-
* Editors that support editing but cannot use VS Code's standard undo/redo mechanism must fire a `CustomDocumentContentChangeEvent`.
1352-
* The only way for a user to clear the dirty state of an editor that does not support undo/redo is to either
1353-
* `save` or `revert` the file.
1354-
*
1355-
* An editor should only ever fire `CustomDocumentEditEvent` events, or only ever fire `CustomDocumentContentChangeEvent` events.
1356-
*/
1357-
readonly onDidChange: Event<CustomDocumentEditEvent> | Event<CustomDocumentContentChangeEvent>;
1358+
saveAs(uri: Uri, cancellation: CancellationToken): Thenable<void>;
13581359

13591360
/**
13601361
* Revert a custom editor to its last saved state.

0 commit comments

Comments
 (0)