@@ -10,10 +10,9 @@ import { BugIndicatingError } from '../../../../../base/common/errors.js';
10
10
import { Emitter } from '../../../../../base/common/event.js' ;
11
11
import { StringSHA1 } from '../../../../../base/common/hash.js' ;
12
12
import { Iterable } from '../../../../../base/common/iterator.js' ;
13
- import { Disposable , DisposableMap , dispose } from '../../../../../base/common/lifecycle.js' ;
13
+ import { Disposable , dispose } from '../../../../../base/common/lifecycle.js' ;
14
14
import { ResourceMap } from '../../../../../base/common/map.js' ;
15
15
import { asyncTransaction , autorun , derived , derivedOpts , derivedWithStore , IObservable , IReader , ITransaction , ObservablePromise , observableValue , transaction } from '../../../../../base/common/observable.js' ;
16
- import { autorunDelta , autorunIterableDelta } from '../../../../../base/common/observableInternal/autorun.js' ;
17
16
import { isEqual , joinPath } from '../../../../../base/common/resources.js' ;
18
17
import { URI } from '../../../../../base/common/uri.js' ;
19
18
import { IBulkEditService } from '../../../../../editor/browser/services/bulkEditService.js' ;
@@ -33,11 +32,9 @@ import { IInstantiationService } from '../../../../../platform/instantiation/com
33
32
import { ILogService } from '../../../../../platform/log/common/log.js' ;
34
33
import { observableConfigValue } from '../../../../../platform/observable/common/platformObservableUtils.js' ;
35
34
import { IWorkspaceContextService } from '../../../../../platform/workspace/common/workspace.js' ;
36
- import { SaveReason } from '../../../../common/editor.js' ;
37
35
import { DiffEditorInput } from '../../../../common/editor/diffEditorInput.js' ;
38
36
import { IEditorGroupsService } from '../../../../services/editor/common/editorGroupsService.js' ;
39
37
import { IEditorService } from '../../../../services/editor/common/editorService.js' ;
40
- import { ITextFileService } from '../../../../services/textfile/common/textfiles.js' ;
41
38
import { MultiDiffEditor } from '../../../multiDiffEditor/browser/multiDiffEditor.js' ;
42
39
import { MultiDiffEditorInput } from '../../../multiDiffEditor/browser/multiDiffEditorInput.js' ;
43
40
import { INotebookService } from '../../../notebook/common/notebookService.js' ;
@@ -196,7 +193,6 @@ export class ChatEditingSession extends Disposable implements IChatEditingSessio
196
193
@IEditorService private readonly _editorService : IEditorService ,
197
194
@IChatService private readonly _chatService : IChatService ,
198
195
@INotebookService private readonly _notebookService : INotebookService ,
199
- @ITextFileService private readonly _textFileService : ITextFileService ,
200
196
@IEditorWorkerService private readonly _editorWorkerService : IEditorWorkerService ,
201
197
@IConfigurationService private readonly _configurationService : IConfigurationService ,
202
198
@IAccessibilitySignalService private readonly _accessibilitySignalService : IAccessibilitySignalService ,
@@ -219,7 +215,6 @@ export class ChatEditingSession extends Disposable implements IChatEditingSessio
219
215
} ) ;
220
216
}
221
217
222
- this . _triggerSaveParticipantsOnAccept ( ) ;
223
218
this . _register ( autorun ( reader => {
224
219
const entries = this . entries . read ( reader ) ;
225
220
entries . forEach ( entry => {
@@ -255,39 +250,6 @@ export class ChatEditingSession extends Disposable implements IChatEditingSessio
255
250
return storage . storeState ( state ) ;
256
251
}
257
252
258
- private _triggerSaveParticipantsOnAccept ( ) {
259
- const im = this . _register ( new DisposableMap < IModifiedFileEntry > ( ) ) ;
260
- const attachToEntry = ( entry : IModifiedFileEntry ) => {
261
- return autorunDelta ( entry . state , ( { lastValue, newValue } ) => {
262
- if ( newValue === WorkingSetEntryState . Accepted && lastValue === WorkingSetEntryState . Modified ) {
263
- // Don't save a file if there's still pending changes. If there's not (e.g.
264
- // the agentic flow with autosave) then save again to trigger participants.
265
- if ( ! this . _textFileService . isDirty ( entry . modifiedURI ) ) {
266
- this . _textFileService . save ( entry . modifiedURI , {
267
- reason : SaveReason . EXPLICIT ,
268
- force : true ,
269
- ignoreErrorHandler : true ,
270
- } ) . catch ( ( ) => {
271
- // ignored
272
- } ) ;
273
- }
274
- }
275
- } ) ;
276
- } ;
277
-
278
- this . _register ( autorunIterableDelta (
279
- reader => this . _entriesObs . read ( reader ) ,
280
- ( { addedValues, removedValues } ) => {
281
- for ( const entry of addedValues ) {
282
- im . set ( entry , attachToEntry ( entry ) ) ;
283
- }
284
- for ( const entry of removedValues ) {
285
- im . deleteAndDispose ( entry ) ;
286
- }
287
- }
288
- ) ) ;
289
- }
290
-
291
253
private _findSnapshot ( requestId : string ) : IChatEditingSessionSnapshot | undefined {
292
254
return this . _linearHistory . get ( ) . find ( s => s . requestId === requestId ) ;
293
255
}
0 commit comments