@@ -33,23 +33,22 @@ import { IContextKey, IContextKeyService } from '../../../../platform/contextkey
33
33
import { IDialogService } from '../../../../platform/dialogs/common/dialogs.js' ;
34
34
import { IInstantiationService , ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js' ;
35
35
import { ILogService } from '../../../../platform/log/common/log.js' ;
36
+ import { IEditorService , SIDE_GROUP } from '../../../services/editor/common/editorService.js' ;
37
+ import { IViewsService } from '../../../services/views/common/viewsService.js' ;
36
38
import { showChatView } from '../../chat/browser/chat.js' ;
37
- import { IChatViewState , IChatWidgetLocationOptions } from '../../chat/browser/chatWidget.js' ;
39
+ import { IChatWidgetLocationOptions } from '../../chat/browser/chatWidget.js' ;
38
40
import { ChatAgentLocation } from '../../chat/common/chatAgents.js' ;
41
+ import { ChatContextKeys } from '../../chat/common/chatContextKeys.js' ;
39
42
import { ChatModel , ChatRequestRemovalReason , IChatRequestModel , IChatTextEditGroup , IChatTextEditGroupState , IResponse } from '../../chat/common/chatModel.js' ;
40
43
import { IChatService } from '../../chat/common/chatService.js' ;
41
- import { HunkInformation , Session , StashedSession } from './inlineChatSession.js' ;
42
- import { InlineChatError } from './inlineChatSessionServiceImpl.js' ;
43
- import { EditModeStrategy , HunkAction , IEditObserver , LiveStrategy , PreviewStrategy , ProgressingEditsOptions } from './inlineChatStrategies.js' ;
44
- import { CTX_INLINE_CHAT_EDITING , CTX_INLINE_CHAT_REQUEST_IN_PROGRESS , CTX_INLINE_CHAT_RESPONSE_TYPE , CTX_INLINE_CHAT_USER_DID_EDIT , CTX_INLINE_CHAT_VISIBLE , EditMode , INLINE_CHAT_ID , InlineChatConfigKeys , InlineChatResponseType } from '../common/inlineChat.js' ;
45
44
import { INotebookEditorService } from '../../notebook/browser/services/notebookEditorService.js' ;
46
- import { IEditorService , SIDE_GROUP } from '../../../services/editor/common/editorService.js' ;
47
- import { IViewsService } from '../../../services/views/common/viewsService.js' ;
45
+ import { CTX_INLINE_CHAT_EDITING , CTX_INLINE_CHAT_REQUEST_IN_PROGRESS , CTX_INLINE_CHAT_RESPONSE_TYPE , CTX_INLINE_CHAT_USER_DID_EDIT , CTX_INLINE_CHAT_VISIBLE , EditMode , INLINE_CHAT_ID , InlineChatConfigKeys , InlineChatResponseType } from '../common/inlineChat.js' ;
48
46
import { IInlineChatSavingService } from './inlineChatSavingService.js' ;
47
+ import { HunkInformation , Session , StashedSession } from './inlineChatSession.js' ;
49
48
import { IInlineChatSessionService } from './inlineChatSessionService.js' ;
49
+ import { InlineChatError } from './inlineChatSessionServiceImpl.js' ;
50
+ import { EditModeStrategy , HunkAction , IEditObserver , LiveStrategy , PreviewStrategy , ProgressingEditsOptions } from './inlineChatStrategies.js' ;
50
51
import { InlineChatZoneWidget } from './inlineChatZoneWidget.js' ;
51
- import { ChatContextKeys } from '../../chat/common/chatContextKeys.js' ;
52
- import { IStorageService , StorageScope , StorageTarget } from '../../../../platform/storage/common/storage.js' ;
53
52
54
53
export const enum State {
55
54
CREATE_SESSION = 'CREATE_SESSION' ,
@@ -104,8 +103,6 @@ export class InlineChatController implements IEditorContribution {
104
103
return editor . getContribution < InlineChatController > ( INLINE_CHAT_ID ) ;
105
104
}
106
105
107
- private static readonly _storageKey = 'inlineChatController.state' ;
108
-
109
106
private _isDisposed : boolean = false ;
110
107
private readonly _store = new DisposableStore ( ) ;
111
108
@@ -147,7 +144,6 @@ export class InlineChatController implements IEditorContribution {
147
144
@IContextKeyService contextKeyService : IContextKeyService ,
148
145
@IChatService private readonly _chatService : IChatService ,
149
146
@IEditorService private readonly _editorService : IEditorService ,
150
- @IStorageService private readonly _storageService : IStorageService ,
151
147
@INotebookEditorService notebookEditorService : INotebookEditorService ,
152
148
) {
153
149
this . _ctxVisible = CTX_INLINE_CHAT_VISIBLE . bindTo ( contextKeyService ) ;
@@ -411,7 +407,7 @@ export class InlineChatController implements IEditorContribution {
411
407
this . _sessionStore . add ( this . _session . wholeRange . onDidChange ( handleWholeRangeChange ) ) ;
412
408
handleWholeRangeChange ( ) ;
413
409
414
- this . _ui . value . widget . setChatModel ( this . _session . chatModel , this . _retrieveWidgetState ( ) ) ;
410
+ this . _ui . value . widget . setChatModel ( this . _session . chatModel ) ;
415
411
this . _updatePlaceholder ( ) ;
416
412
417
413
const isModelEmpty = ! this . _session . chatModel . hasRequests ;
@@ -893,11 +889,6 @@ export class InlineChatController implements IEditorContribution {
893
889
this . _ctxUserDidEdit . reset ( ) ;
894
890
895
891
if ( this . _ui . rawValue ) {
896
- // persist selected LM in memento
897
- const { selectedLanguageModelId } = this . _ui . rawValue . widget . chatWidget . getViewState ( ) ;
898
- const state = { selectedLanguageModelId } ;
899
- this . _storageService . store ( InlineChatController . _storageKey , state , StorageScope . PROFILE , StorageTarget . USER ) ;
900
-
901
892
this . _ui . rawValue . hide ( ) ;
902
893
}
903
894
@@ -907,15 +898,6 @@ export class InlineChatController implements IEditorContribution {
907
898
}
908
899
}
909
900
910
- private _retrieveWidgetState ( ) : IChatViewState | undefined {
911
- try {
912
- const state = JSON . parse ( this . _storageService . get ( InlineChatController . _storageKey , StorageScope . PROFILE ) ?? '{}' ) ;
913
- return state ;
914
- } catch {
915
- return undefined ;
916
- }
917
- }
918
-
919
901
private _updateCtxResponseType ( ) : void {
920
902
921
903
if ( ! this . _session ) {
0 commit comments