@@ -78,7 +78,8 @@ import {
7878 handle_save_tasks ,
7979 handle_delete_task ,
8080 handle_fix_all_failed_files ,
81- handle_prune_context
81+ handle_prune_context ,
82+ handle_cancel_intelligent_update_file_in_preview
8283} from './message-handlers'
8384import {
8485 API_EDIT_FORMAT_STATE_KEY ,
@@ -124,7 +125,11 @@ export class PanelProvider implements vscode.WebviewViewProvider {
124125 public api_edit_format : EditFormat
125126 public api_prompt_type : ApiPromptType
126127 public mode : Mode = MODE . WEB
127- public intelligent_update_cancel_token_sources : CancelTokenSource [ ] = [ ]
128+ public intelligent_update_cancel_token_sources : {
129+ source : CancelTokenSource
130+ file_path : string
131+ workspace_name ?: string
132+ } [ ] = [ ]
128133 public api_call_cancel_token_source : CancelTokenSource | null = null
129134 public api_manager ! : ApiManager
130135 public commit_was_staged_by_script : boolean = false
@@ -406,7 +411,7 @@ export class PanelProvider implements vscode.WebviewViewProvider {
406411 public cancel_all_intelligent_updates ( ) {
407412 const sources = [ ...this . intelligent_update_cancel_token_sources ]
408413 this . intelligent_update_cancel_token_sources = [ ]
409- sources . forEach ( ( source ) => source . cancel ( 'Preview finished.' ) )
414+ sources . forEach ( ( item ) => item . source . cancel ( 'Preview finished.' ) )
410415 }
411416
412417 public send_context_files ( ) {
@@ -637,6 +642,10 @@ export class PanelProvider implements vscode.WebviewViewProvider {
637642 await handle_discard_user_changes_in_preview ( message )
638643 } else if ( message . command == 'INTELLIGENT_UPDATE_FILE_IN_PREVIEW' ) {
639644 await handle_intelligent_update_file_in_preview ( this , message )
645+ } else if (
646+ message . command == 'CANCEL_INTELLIGENT_UPDATE_FILE_IN_PREVIEW'
647+ ) {
648+ handle_cancel_intelligent_update_file_in_preview ( this , message )
640649 } else if ( message . command == 'RESPONSE_PREVIEW' ) {
641650 await handle_response_preview ( message )
642651 } else if ( message . command == 'REMOVE_RESPONSE_HISTORY_ITEM' ) {
0 commit comments