Skip to content

Commit f41df45

Browse files
committed
Rename conflict markers handler to search replace handler
- rename to 'search-replace-handler'
1 parent 766cbee commit f41df45

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

apps/editor/src/commands/apply-response-command/handlers/conflict-markers-handler.ts renamed to apps/editor/src/commands/apply-response-command/handlers/search-replace-handler.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
import { apply_conflict_markers_to_content } from '../utils/edit-formats/conflict-markers/apply-conflict-markers-to-content'
1515
import { parse_conflict_segments } from '../utils/edit-formats/conflict-markers/parse-conflict-segments'
1616

17-
export const handle_conflict_markers = async (params: {
17+
export const handle_search_replace = async (params: {
1818
files: FileItem[]
1919
on_progress: (progress: number) => void
2020
}): Promise<{
@@ -23,7 +23,7 @@ export const handle_conflict_markers = async (params: {
2323
failed_files?: FileItem[]
2424
}> => {
2525
Logger.info({
26-
function_name: 'handle_conflict_markers',
26+
function_name: 'handle_search_replace',
2727
message: 'start',
2828
data: { file_count: params.files.length }
2929
})
@@ -61,7 +61,7 @@ export const handle_conflict_markers = async (params: {
6161

6262
if (!safe_path) {
6363
Logger.warn({
64-
function_name: 'handle_conflict_markers',
64+
function_name: 'handle_search_replace',
6565
message: 'Unsafe file path detected',
6666
data: file.file_path
6767
})
@@ -75,7 +75,7 @@ export const handle_conflict_markers = async (params: {
7575
workspace_root,
7676
workspace_map,
7777
default_workspace,
78-
function_name: 'handle_conflict_markers'
78+
function_name: 'handle_search_replace'
7979
})
8080
if (delete_result.success && delete_result.original_state) {
8181
original_states.push(delete_result.original_state)
@@ -168,13 +168,13 @@ export const handle_conflict_markers = async (params: {
168168
})
169169

170170
Logger.info({
171-
function_name: 'handle_conflict_markers',
171+
function_name: 'handle_search_replace',
172172
message: 'Applied conflict markers edit to file',
173173
data: safe_path
174174
})
175175
} catch (error: any) {
176176
Logger.error({
177-
function_name: 'handle_conflict_markers',
177+
function_name: 'handle_search_replace',
178178
message: 'Failed to apply conflict markers edit',
179179
data: { file_path: safe_path, error }
180180
})
@@ -244,7 +244,7 @@ export const handle_conflict_markers = async (params: {
244244
})
245245
} catch (error: any) {
246246
Logger.error({
247-
function_name: 'handle_conflict_markers',
247+
function_name: 'handle_search_replace',
248248
message: 'Error replacing file content (fallback)',
249249
data: { error, file_path: safe_path }
250250
})
@@ -256,7 +256,7 @@ export const handle_conflict_markers = async (params: {
256256
return { success: true, original_states, failed_files }
257257
} catch (error: any) {
258258
Logger.error({
259-
function_name: 'handle_conflict_markers',
259+
function_name: 'handle_search_replace',
260260
message: 'Error during conflict markers edit',
261261
data: error
262262
})

‎apps/editor/src/commands/apply-response-command/response-processor.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { PromptViewProvider } from '@/views/prompt/backend/prompt-view-provider'
2626
import { FileInPreview } from '@shared/types/file-in-preview'
2727
import { update_undo_button_state } from './utils/state-manager'
2828
import { check_for_conflict_markers } from './utils/file-checks'
29-
import { handle_conflict_markers } from './handlers/conflict-markers-handler'
29+
import { handle_search_replace } from './handlers/search-replace-handler'
3030
import { handle_truncated_edit } from './handlers/truncated-handler'
3131
import { WorkspaceProvider } from '@/context/providers/workspace/workspace-provider'
3232
import { natural_sort } from '@/utils/natural-sort'
@@ -665,7 +665,7 @@ export const process_response = async (params: {
665665
data: { success: result.success }
666666
})
667667
} else if (selected_mode_label == 'Conflict markers') {
668-
const result = await handle_conflict_markers({ files, on_progress })
668+
const result = await handle_search_replace({ files, on_progress })
669669

670670
const successful_states = result.original_states || []
671671
const failed_files: FileItem[] = result.failed_files || []

0 commit comments

Comments
 (0)