File tree Expand file tree Collapse file tree
packages/vscode/src/views/panel/backend Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import {
2+ API_EDIT_FORMAT_STATE_KEY ,
3+ CHAT_EDIT_FORMAT_STATE_KEY
4+ } from '@/constants/state-keys'
15import { ViewProvider } from '@/views/panel/backend/panel-provider'
26import { SaveEditFormatMessage } from '@/views/panel/types/messages'
37
@@ -8,13 +12,21 @@ export const handle_save_edit_format = async (
812 if ( message . target == 'chat' ) {
913 provider . chat_edit_format = message . edit_format
1014 await provider . context . workspaceState . update (
11- 'chat-edit-format' ,
15+ CHAT_EDIT_FORMAT_STATE_KEY ,
16+ message . edit_format
17+ )
18+ await provider . context . globalState . update (
19+ CHAT_EDIT_FORMAT_STATE_KEY ,
1220 message . edit_format
1321 )
1422 } else if ( message . target == 'api' ) {
1523 provider . api_edit_format = message . edit_format
1624 await provider . context . workspaceState . update (
17- 'api-edit-format' ,
25+ API_EDIT_FORMAT_STATE_KEY ,
26+ message . edit_format
27+ )
28+ await provider . context . globalState . update (
29+ API_EDIT_FORMAT_STATE_KEY ,
1830 message . edit_format
1931 )
2032 }
Original file line number Diff line number Diff line change @@ -142,14 +142,14 @@ export class ViewProvider implements vscode.WebviewViewProvider {
142142 ''
143143 )
144144
145- this . chat_edit_format = this . context . workspaceState . get < EditFormat > (
146- CHAT_EDIT_FORMAT_STATE_KEY ,
145+ this . chat_edit_format =
146+ this . context . workspaceState . get < EditFormat > ( CHAT_EDIT_FORMAT_STATE_KEY ) ??
147+ this . context . globalState . get < EditFormat > ( CHAT_EDIT_FORMAT_STATE_KEY ) ??
148+ 'whole'
149+ this . api_edit_format =
150+ this . context . workspaceState . get < EditFormat > ( API_EDIT_FORMAT_STATE_KEY ) ??
151+ this . context . globalState . get < EditFormat > ( API_EDIT_FORMAT_STATE_KEY ) ??
147152 'whole'
148- )
149- this . api_edit_format = this . context . workspaceState . get < EditFormat > (
150- API_EDIT_FORMAT_STATE_KEY ,
151- 'diff'
152- )
153153
154154 this . web_mode = this . context . workspaceState . get < WebMode > (
155155 WEB_MODE_STATE_KEY ,
You can’t perform that action at this time.
0 commit comments