@@ -20,6 +20,7 @@ import { ActionRunner, IAction } from 'vs/base/common/actions';
20
20
import { IFileService } from 'vs/platform/files/common/files' ;
21
21
import { IPathData } from 'vs/platform/windows/common/windows' ;
22
22
import { coalesce , firstOrDefault } from 'vs/base/common/arrays' ;
23
+ import { ISaveOptions , IRevertOptions } from 'vs/workbench/services/workingCopy/common/workingCopyService' ;
23
24
24
25
export const ActiveEditorContext = new RawContextKey < string | null > ( 'activeEditor' , null ) ;
25
26
export const ActiveEditorIsSaveableContext = new RawContextKey < boolean > ( 'activeEditorIsSaveable' , false ) ;
@@ -261,25 +262,12 @@ export const enum Verbosity {
261
262
LONG
262
263
}
263
264
264
- export interface IRevertOptions {
265
-
266
- /**
267
- * Forces to load the contents of the editor again even if the editor is not dirty.
268
- */
269
- force ?: boolean ;
270
-
271
- /**
272
- * A soft revert will clear dirty state of an editor but will not attempt to load it.
273
- */
274
- soft ?: boolean ;
275
- }
276
-
277
265
export interface IEditorInput extends IDisposable {
278
266
279
267
/**
280
268
* Triggered when this input is disposed.
281
269
*/
282
- onDispose : Event < void > ;
270
+ readonly onDispose : Event < void > ;
283
271
284
272
/**
285
273
* Returns the associated resource of this input.
@@ -316,6 +304,11 @@ export interface IEditorInput extends IDisposable {
316
304
*/
317
305
isDirty ( ) : boolean ;
318
306
307
+ /**
308
+ * Saves the editor if it is dirty.
309
+ */
310
+ save ( options ?: ISaveOptions ) : Promise < boolean > ;
311
+
319
312
/**
320
313
* Reverts this input.
321
314
*/
@@ -418,7 +411,7 @@ export abstract class EditorInput extends Disposable implements IEditorInput {
418
411
/**
419
412
* Saves the editor if it is dirty. Subclasses return a promise with a boolean indicating the success of the operation.
420
413
*/
421
- save ( ) : Promise < boolean > {
414
+ save ( options ?: ISaveOptions ) : Promise < boolean > {
422
415
return Promise . resolve ( true ) ;
423
416
}
424
417
@@ -553,12 +546,12 @@ export class SideBySideEditorInput extends EditorInput {
553
546
return this . master . isDirty ( ) ;
554
547
}
555
548
556
- save ( ) : Promise < boolean > {
557
- return this . master . save ( ) ;
549
+ save ( options ?: ISaveOptions ) : Promise < boolean > {
550
+ return this . master . save ( options ) ;
558
551
}
559
552
560
- revert ( ) : Promise < boolean > {
561
- return this . master . revert ( ) ;
553
+ revert ( options ?: IRevertOptions ) : Promise < boolean > {
554
+ return this . master . revert ( options ) ;
562
555
}
563
556
564
557
getTelemetryDescriptor ( ) : { [ key : string ] : unknown } {
0 commit comments