File tree Expand file tree Collapse file tree
packages/vscode/src/commands/apply-chat-response-command Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -392,25 +392,26 @@ export function apply_chat_response_command(context: vscode.ExtensionContext) {
392392 endpoint_url = provider . base_url
393393 }
394394
395- // Convert failed patches to clipboard format for intelligent update
396- const failed_patches_text = failed_patches
397- . map ( ( patch ) => `// ${ patch . file_path } \n${ patch . content } ` )
398- . join ( '\n\n' )
395+ const failed_patches_as_code_blocks = failed_patches
396+ . map (
397+ ( patch ) =>
398+ `\`\`\`\n// ${ patch . file_path } \n${ patch . content } \n\`\`\``
399+ )
400+ . join ( '\n' )
399401
400402 try {
401403 const intelligent_update_states = await handle_intelligent_update (
402404 {
403405 endpoint_url,
404406 api_key : provider . api_key ,
405407 model : file_refactoring_config . model ,
406- clipboard_text : failed_patches_text ,
408+ clipboard_text : failed_patches_as_code_blocks ,
407409 context : context ,
408410 is_single_root_folder_workspace
409411 }
410412 )
411413
412414 if ( intelligent_update_states ) {
413- // Combine original states from successful patches and intelligent update
414415 const combined_states = [
415416 ...all_original_states ,
416417 ...intelligent_update_states
You can’t perform that action at this time.
0 commit comments