File tree Expand file tree Collapse file tree
commands/apply-chat-response-command/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import { undo_files } from './file-operations'
55import { preview } from './preview'
66import { PanelProvider } from '@/views/panel/backend/panel-provider'
77import { update_undo_button_state } from './state-manager'
8- import { TasksUtils } from '@/utils/tasks-utils'
98import { PromptsForCommitMessagesUtils } from '@/utils/prompts-for-commit-messages-utils'
109
1110export let ongoing_preview_cleanup_promise : Promise < void > | null = null
@@ -111,17 +110,6 @@ export const preview_handler = async (params: {
111110 }
112111
113112 if ( params . raw_instructions ) {
114- const updated_tasks = TasksUtils . mark_as_completed_if_matches_prompt ( {
115- context : params . context ,
116- prompt_text : params . raw_instructions
117- } )
118- if ( updated_tasks ) {
119- params . panel_provider . send_message ( {
120- command : 'TASKS' ,
121- tasks : updated_tasks
122- } )
123- }
124-
125113 const workspace_map = new Map < string , string > ( )
126114 vscode . workspace . workspaceFolders ?. forEach ( ( folder ) => {
127115 workspace_map . set ( folder . name , folder . uri . fsPath )
Original file line number Diff line number Diff line change @@ -148,46 +148,4 @@ export namespace TasksUtils {
148148 } )
149149 return { tasks : new_tasks , success }
150150 }
151-
152- export const mark_as_completed_if_matches_prompt = ( params : {
153- context : vscode . ExtensionContext
154- prompt_text : string
155- } ) : Record < string , Task [ ] > | null => {
156- if ( ! params . prompt_text . trim ( ) ) return null
157-
158- const all_tasks = load_all ( params . context )
159- if ( Object . keys ( all_tasks ) . length == 0 ) return null
160-
161- let file_changed = false
162- const relevant_tasks : Record < string , Task [ ] > = { }
163-
164- const process_tasks = ( tasks : Task [ ] ) => {
165- for ( const task of tasks ) {
166- if ( ! task . is_checked && task . text . trim ( ) == params . prompt_text . trim ( ) ) {
167- task . is_checked = true
168- file_changed = true
169- }
170- if ( task . children ) {
171- process_tasks ( task . children )
172- }
173- }
174- }
175-
176- if ( vscode . workspace . workspaceFolders ) {
177- vscode . workspace . workspaceFolders . forEach ( ( folder ) => {
178- const tasks = all_tasks [ folder . uri . fsPath ]
179- if ( tasks ) {
180- process_tasks ( tasks )
181- relevant_tasks [ folder . uri . fsPath ] = tasks
182- }
183- } )
184- }
185-
186- if ( file_changed ) {
187- save_all ( { context : params . context , tasks : all_tasks } )
188- return relevant_tasks
189- }
190-
191- return null
192- }
193151}
You can’t perform that action at this time.
0 commit comments