@@ -33,10 +33,10 @@ const get_code_at_cursor_api_configuration = async (
3333 | { model_provider : ModelProvider ; api_configuration : ApiConfiguration }
3434 | undefined
3535> => {
36- const code_completions_api_configurations =
36+ const code_at_cursor_api_configurations =
3737 await model_providers_manager . get_api_configurations ( )
3838
39- if ( code_completions_api_configurations . length == 0 ) {
39+ if ( code_at_cursor_api_configurations . length == 0 ) {
4040 vscode . commands . executeCommand ( 'codeWebChat.settings' )
4141 vscode . window . showInformationMessage (
4242 dictionary . information_message . NO_CODE_AT_CURSOR_CONFIGURATIONS_FOUND
@@ -48,7 +48,7 @@ const get_code_at_cursor_api_configuration = async (
4848
4949 if ( api_configuration_id !== undefined ) {
5050 selected_api_configuration =
51- code_completions_api_configurations . find (
51+ code_at_cursor_api_configurations . find (
5252 ( c ) => get_api_configuration_id ( c ) == api_configuration_id
5353 ) || null
5454 if ( selected_api_configuration && panel_provider ) {
@@ -64,16 +64,16 @@ const get_code_at_cursor_api_configuration = async (
6464 )
6565 if ( last_selected_id ) {
6666 selected_api_configuration =
67- code_completions_api_configurations . find (
67+ code_at_cursor_api_configurations . find (
6868 ( c ) => get_api_configuration_id ( c ) === last_selected_id
6969 ) || null
7070 }
7171
7272 if (
7373 ! selected_api_configuration &&
74- code_completions_api_configurations . length > 0
74+ code_at_cursor_api_configurations . length > 0
7575 ) {
76- selected_api_configuration = code_completions_api_configurations [ 0 ]
76+ selected_api_configuration = code_at_cursor_api_configurations [ 0 ]
7777 }
7878 }
7979
@@ -83,10 +83,10 @@ const get_code_at_cursor_api_configuration = async (
8383 )
8484
8585 const result = await show_configuration_quick_pick ( {
86- items : code_completions_api_configurations ,
86+ items : code_at_cursor_api_configurations ,
8787 map_item : map_api_configuration_to_item ,
8888 last_selected_id,
89- placeholder : 'Select code completions API configuration'
89+ placeholder : 'Select code at cursor API configuration'
9090 } )
9191
9292 if ( panel_provider ) {
@@ -160,25 +160,25 @@ export const handle_code_at_cursor = async (
160160
161161 const {
162162 model_provider,
163- api_configuration : code_completions_api_configuration
163+ api_configuration : code_at_cursor_api_configuration
164164 } = api_configuration_result
165165
166- if ( ! code_completions_api_configuration . model_provider_name ) {
166+ if ( ! code_at_cursor_api_configuration . model_provider_name ) {
167167 vscode . window . showErrorMessage (
168168 dictionary . error_message . API_PROVIDER_NOT_SPECIFIED_FOR_CODE_AT_CURSOR
169169 )
170170 Logger . warn ( {
171171 function_name : 'handle_code_at_cursor' ,
172- message : 'API provider is not specified for Code Completions tool.'
172+ message : 'API provider is not specified for Code at Cursor tool.'
173173 } )
174174 return
175- } else if ( ! code_completions_api_configuration . model ) {
175+ } else if ( ! code_at_cursor_api_configuration . model ) {
176176 vscode . window . showErrorMessage (
177177 dictionary . error_message . MODEL_NOT_SPECIFIED_FOR_CODE_AT_CURSOR
178178 )
179179 Logger . warn ( {
180180 function_name : 'handle_code_at_cursor' ,
181- message : 'Model is not specified for Code Completions tool.'
181+ message : 'Model is not specified for Code at Cursor tool.'
182182 } )
183183 return
184184 }
@@ -231,11 +231,14 @@ export const handle_code_at_cursor = async (
231231 const { part1, part2 } = build_prompt ( {
232232 other_files : collected . other_files ,
233233 recent_files : collected . recent_files ,
234- active_file_context : `### File: \`${ relative_path } \`\n\n\`\`\`\n${ text_before_cursor } ${
235- processed_completion_instructions
236- ? `<missing_text>${ processed_completion_instructions } </missing_text>`
237- : '<missing_text>'
238- } ${ text_after_cursor } \n\`\`\`\n\n`,
234+ active_file : {
235+ filepath : relative_path ,
236+ content : `${ text_before_cursor } ${
237+ processed_completion_instructions
238+ ? `<missing_text>${ processed_completion_instructions } </missing_text>`
239+ : '<missing_text>'
240+ } ${ text_after_cursor } `
241+ } ,
239242 skill_definitions,
240243 system_instructions : main_instructions
241244 } )
@@ -255,14 +258,14 @@ export const handle_code_at_cursor = async (
255258
256259 const body : { [ key : string ] : any } = {
257260 messages,
258- model : code_completions_api_configuration . model ,
259- temperature : code_completions_api_configuration . temperature
261+ model : code_at_cursor_api_configuration . model ,
262+ temperature : code_at_cursor_api_configuration . temperature
260263 }
261264
262265 apply_reasoning_effort ( {
263266 body,
264267 model_provider,
265- reasoning_effort : code_completions_api_configuration . reasoning_effort
268+ reasoning_effort : code_at_cursor_api_configuration . reasoning_effort
266269 } )
267270
268271 let error_occurred = false
@@ -277,11 +280,9 @@ export const handle_code_at_cursor = async (
277280 api_key : model_provider . api_key ,
278281 body,
279282 request_id,
280- provider_name :
281- code_completions_api_configuration . model_provider_name ,
282- model : code_completions_api_configuration . model ,
283- reasoning_effort :
284- code_completions_api_configuration . reasoning_effort
283+ provider_name : code_at_cursor_api_configuration . model_provider_name ,
284+ model : code_at_cursor_api_configuration . model ,
285+ reasoning_effort : code_at_cursor_api_configuration . reasoning_effort
285286 } )
286287
287288 if ( result ) {
@@ -299,10 +300,10 @@ export const handle_code_at_cursor = async (
299300 } ,
300301 recent_api_configuration : {
301302 model_provider :
302- code_completions_api_configuration . model_provider_name ,
303- model : code_completions_api_configuration . model ,
303+ code_at_cursor_api_configuration . model_provider_name ,
304+ model : code_at_cursor_api_configuration . model ,
304305 reasoning_effort :
305- code_completions_api_configuration . reasoning_effort
306+ code_at_cursor_api_configuration . reasoning_effort
306307 }
307308 }
308309 )
0 commit comments