@@ -53,7 +53,7 @@ import { INotebookEditorModelResolverService } from '../../../notebook/common/no
53
53
import { INotebookLoggingService } from '../../../notebook/common/notebookLoggingService.js' ;
54
54
import { INotebookService } from '../../../notebook/common/notebookService.js' ;
55
55
import { INotebookEditorWorkerService } from '../../../notebook/common/services/notebookWorkerService.js' ;
56
- import { ChatEditKind , IEditSessionEntryDiff , IModifiedFileEntryEditorIntegration , WorkingSetEntryState } from '../../common/chatEditingService.js' ;
56
+ import { ChatEditKind , IModifiedFileEntryEditorIntegration , WorkingSetEntryState } from '../../common/chatEditingService.js' ;
57
57
import { IChatResponseModel } from '../../common/chatModel.js' ;
58
58
import { IChatService } from '../../common/chatService.js' ;
59
59
import { IDocumentDiff2 } from './chatEditingCodeEditorIntegration.js' ;
@@ -67,63 +67,6 @@ const noopKeep = () => Promise.resolve(true);
67
67
const noopUndo = ( ) => Promise . resolve ( true ) ;
68
68
const SnapshotLanguageId = 'VSCodeChatNotebookSnapshotLanguage' ;
69
69
70
- export class ChatEditingModifiedNotebookDiff {
71
- static NewModelCounter : number = 0 ;
72
- constructor (
73
- private readonly original : ISnapshotEntry ,
74
- private readonly modified : ISnapshotEntry ,
75
- @INotebookEditorWorkerService private readonly notebookEditorWorkerService : INotebookEditorWorkerService ,
76
- @INotebookLoggingService private readonly notebookLoggingService : INotebookLoggingService ,
77
- @INotebookEditorModelResolverService private readonly notebookEditorModelService : INotebookEditorModelResolverService ,
78
- ) {
79
-
80
- }
81
-
82
- async computeDiff ( ) : Promise < IEditSessionEntryDiff > {
83
-
84
- let added = 0 ;
85
- let removed = 0 ;
86
-
87
- const disposables = new DisposableStore ( ) ;
88
- try {
89
- const [ modifiedRef , originalRef ] = await Promise . all ( [
90
- this . notebookEditorModelService . resolve ( this . modified . snapshotUri ) ,
91
- this . notebookEditorModelService . resolve ( this . original . snapshotUri )
92
- ] ) ;
93
- disposables . add ( modifiedRef ) ;
94
- disposables . add ( originalRef ) ;
95
- const notebookDiff = await this . notebookEditorWorkerService . computeDiff ( this . original . snapshotUri , this . modified . snapshotUri ) ;
96
- const result = computeDiff ( originalRef . object . notebook , modifiedRef . object . notebook , notebookDiff ) ;
97
- result . cellDiffInfo . forEach ( diff => {
98
- switch ( diff . type ) {
99
- case 'modified' :
100
- case 'insert' :
101
- added ++ ;
102
- break ;
103
- case 'delete' :
104
- removed ++ ;
105
- break ;
106
- default :
107
- break ;
108
- }
109
- } ) ;
110
- } catch ( e ) {
111
- this . notebookLoggingService . error ( 'Notebook Chat' , 'Error computing diff:\n' + e ) ;
112
- } finally {
113
- disposables . dispose ( ) ;
114
- }
115
-
116
- return {
117
- added,
118
- removed,
119
- identical : added === 0 && removed === 0 ,
120
- quitEarly : false ,
121
- modifiedURI : this . modified . snapshotUri ,
122
- originalURI : this . original . snapshotUri ,
123
- } ;
124
- }
125
- }
126
-
127
70
export class ChatEditingModifiedNotebookEntry extends AbstractChatEditingModifiedFileEntry {
128
71
static NewModelCounter : number = 0 ;
129
72
private readonly modifiedModel : NotebookTextModel ;
0 commit comments