@@ -19,7 +19,6 @@ import { NotebookTextModel } from 'vs/workbench/contrib/notebook/common/model/no
19
19
import { ICellDto2 , INotebookEditorModel , INotebookLoadOptions , IResolvedNotebookEditorModel , NotebookCellsChangeType , NotebookData } from 'vs/workbench/contrib/notebook/common/notebookCommon' ;
20
20
import { INotebookSerializer , INotebookService , SimpleNotebookProviderInfo } from 'vs/workbench/contrib/notebook/common/notebookService' ;
21
21
import { IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService' ;
22
- import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle' ;
23
22
import { IFileWorkingCopyManager } from 'vs/workbench/services/workingCopy/common/fileWorkingCopyManager' ;
24
23
import { IStoredFileWorkingCopy , IStoredFileWorkingCopyModel , IStoredFileWorkingCopyModelContentChangedEvent , IStoredFileWorkingCopyModelFactory , IStoredFileWorkingCopySaveEvent , StoredFileWorkingCopyState } from 'vs/workbench/services/workingCopy/common/storedFileWorkingCopy' ;
25
24
import { IUntitledFileWorkingCopy , IUntitledFileWorkingCopyModel , IUntitledFileWorkingCopyModelContentChangedEvent , IUntitledFileWorkingCopyModelFactory } from 'vs/workbench/services/workingCopy/common/untitledFileWorkingCopy' ;
@@ -33,11 +32,13 @@ export class SimpleNotebookEditorModel extends EditorModel implements INotebookE
33
32
private readonly _onDidSave = this . _register ( new Emitter < IStoredFileWorkingCopySaveEvent > ( ) ) ;
34
33
private readonly _onDidChangeOrphaned = this . _register ( new Emitter < void > ( ) ) ;
35
34
private readonly _onDidChangeReadonly = this . _register ( new Emitter < void > ( ) ) ;
35
+ private readonly _onDidRevertUntitled = this . _register ( new Emitter < void > ( ) ) ;
36
36
37
37
readonly onDidChangeDirty : Event < void > = this . _onDidChangeDirty . event ;
38
38
readonly onDidSave : Event < IStoredFileWorkingCopySaveEvent > = this . _onDidSave . event ;
39
39
readonly onDidChangeOrphaned : Event < void > = this . _onDidChangeOrphaned . event ;
40
40
readonly onDidChangeReadonly : Event < void > = this . _onDidChangeReadonly . event ;
41
+ readonly onDidRevertUntitled : Event < void > = this . _onDidRevertUntitled . event ;
41
42
42
43
private _workingCopy ?: IStoredFileWorkingCopy < NotebookFileWorkingCopyModel > | IUntitledFileWorkingCopy < NotebookFileWorkingCopyModel > ;
43
44
private readonly _workingCopyListeners = this . _register ( new DisposableStore ( ) ) ;
@@ -48,7 +49,6 @@ export class SimpleNotebookEditorModel extends EditorModel implements INotebookE
48
49
private readonly _hasAssociatedFilePath : boolean ,
49
50
readonly viewType : string ,
50
51
private readonly _workingCopyManager : IFileWorkingCopyManager < NotebookFileWorkingCopyModel , NotebookFileWorkingCopyModel > ,
51
- @ILifecycleService lifecycleService : ILifecycleService ,
52
52
@IFilesConfigurationService private readonly _filesConfigurationService : IFilesConfigurationService
53
53
) {
54
54
super ( ) ;
@@ -119,6 +119,7 @@ export class SimpleNotebookEditorModel extends EditorModel implements INotebookE
119
119
} else {
120
120
this . _workingCopy = await this . _workingCopyManager . resolve ( { untitledResource : this . resource , isScratchpad : this . scratchPad } ) ;
121
121
}
122
+ this . _workingCopy . onDidRevert ( ( ) => this . _onDidRevertUntitled . fire ( ) ) ;
122
123
} else {
123
124
this . _workingCopy = await this . _workingCopyManager . resolve ( this . resource , options ?. forceReadFromFile ? { reload : { async : false , force : true } } : undefined ) ;
124
125
this . _workingCopyListeners . add ( this . _workingCopy . onDidSave ( e => this . _onDidSave . fire ( e ) ) ) ;
0 commit comments