11import { useEffect , useState } from 'react'
22import {
33 BackendMessage ,
4+ EditFormatInstructions ,
45 ConfigurationForClient ,
56 ProviderForClient ,
67 FrontendMessage
@@ -31,6 +32,9 @@ export const use_settings = (vscode: any) => {
3132 ] = useState < string | undefined > ( undefined )
3233 const [ context_size_warning_threshold , set_context_size_warning_threshold ] =
3334 useState < number | undefined > ( undefined )
35+ const [ edit_format_instructions , set_edit_format_instructions ] = useState <
36+ EditFormatInstructions | undefined
37+ > ( undefined )
3438 const [ gemini_user_id , set_gemini_user_id ] = useState <
3539 number | null | undefined
3640 > ( undefined )
@@ -49,6 +53,7 @@ export const use_settings = (vscode: any) => {
4953 post_message ( vscode , { command : 'GET_INTELLIGENT_UPDATE_CONFIGURATIONS' } )
5054 post_message ( vscode , { command : 'GET_COMMIT_MESSAGE_INSTRUCTIONS' } )
5155 post_message ( vscode , { command : 'GET_CONTEXT_SIZE_WARNING_THRESHOLD' } )
56+ post_message ( vscode , { command : 'GET_EDIT_FORMAT_INSTRUCTIONS' } )
5257 post_message ( vscode , { command : 'GET_GEMINI_USER_ID' } )
5358 post_message ( vscode , { command : 'GET_CLEAR_CHECKS_IN_WORKSPACE_BEHAVIOR' } )
5459 } , [ vscode ] )
@@ -81,6 +86,9 @@ export const use_settings = (vscode: any) => {
8186 case 'CONTEXT_SIZE_WARNING_THRESHOLD' :
8287 set_context_size_warning_threshold ( message . threshold )
8388 break
89+ case 'EDIT_FORMAT_INSTRUCTIONS' :
90+ set_edit_format_instructions ( message . instructions )
91+ break
8492 case 'GEMINI_USER_ID' :
8593 set_gemini_user_id ( message . geminiUserId )
8694 break
@@ -205,6 +213,14 @@ export const use_settings = (vscode: any) => {
205213 threshold
206214 } )
207215
216+ const handle_edit_format_instructions_change = (
217+ instructions : EditFormatInstructions
218+ ) =>
219+ post_message ( vscode , {
220+ command : 'UPDATE_EDIT_FORMAT_INSTRUCTIONS' ,
221+ instructions
222+ } )
223+
208224 const handle_gemini_user_id_change = ( geminiUserId : number | null ) =>
209225 post_message ( vscode , {
210226 command : 'UPDATE_GEMINI_USER_ID' ,
@@ -233,6 +249,7 @@ export const use_settings = (vscode: any) => {
233249 commit_message_instructions,
234250 edit_context_system_instructions,
235251 context_size_warning_threshold,
252+ edit_format_instructions,
236253 gemini_user_id,
237254 clear_checks_in_workspace_behavior,
238255 handle_reorder_providers,
@@ -250,6 +267,7 @@ export const use_settings = (vscode: any) => {
250267 handle_edit_context_system_instructions_change,
251268 handle_open_editor_settings,
252269 handle_context_size_warning_threshold_change,
270+ handle_edit_format_instructions_change,
253271 handle_gemini_user_id_change,
254272 handle_clear_checks_in_workspace_behavior_change
255273 }
0 commit comments