Skip to content

Commit 496f399

Browse files
committed
Rename placeholder utility files and update all references from placeholder to symbol syntax
1 parent abd36fa commit 496f399

6 files changed

Lines changed: 54 additions & 56 deletions

File tree

‎packages/vscode/src/views/panel/backend/message-handlers/handle-copy-prompt.ts‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { PanelProvider } from '@/views/panel/backend/panel-provider'
22
import * as vscode from 'vscode'
33
import { FilesCollector } from '@/utils/files-collector'
4-
import { replace_selection_placeholder } from '@/views/panel/backend/utils/replace-selection-placeholder'
4+
import { replace_selection_placeholder } from '@/views/panel/backend/utils/replace-selection-symbol'
55
import {
6-
replace_changes_placeholder,
7-
replace_commit_placeholder,
8-
replace_context_at_commit_placeholder
9-
} from '@/views/panel/backend/utils/replace-git-placeholders'
6+
replace_changes_symbol,
7+
replace_commit_symbol,
8+
replace_context_at_commit_symbol
9+
} from '@/views/panel/backend/utils/replace-git-symbols'
1010
import { replace_saved_context_placeholder } from '@/utils/replace-saved-context-placeholder'
1111
import { code_completion_instructions_for_panel } from '@/constants/instructions'
1212
import { apply_preset_affixes_to_instruction } from '@/utils/apply-preset-affixes'
@@ -116,34 +116,34 @@ export const handle_copy_prompt = async (params: {
116116
params.panel_provider.mode == MODE.WEB &&
117117
params.panel_provider.web_prompt_type == 'no-context'
118118

119-
pre_context_instructions = await replace_changes_placeholder({
119+
pre_context_instructions = await replace_changes_symbol({
120120
instruction: pre_context_instructions,
121121
workspace_provider: params.panel_provider.workspace_provider,
122122
is_no_context_web_mode
123123
})
124-
post_context_instructions = await replace_changes_placeholder({
124+
post_context_instructions = await replace_changes_symbol({
125125
instruction: post_context_instructions,
126126
after_context: true,
127127
workspace_provider: params.panel_provider.workspace_provider
128128
})
129129
}
130130

131131
if (instructions.includes('#Commit:')) {
132-
pre_context_instructions = await replace_commit_placeholder({
132+
pre_context_instructions = await replace_commit_symbol({
133133
instruction: pre_context_instructions
134134
})
135-
post_context_instructions = await replace_commit_placeholder({
135+
post_context_instructions = await replace_commit_symbol({
136136
instruction: post_context_instructions,
137137
after_context: true
138138
})
139139
}
140140

141141
if (instructions.includes('#ContextAtCommit:')) {
142-
pre_context_instructions = await replace_context_at_commit_placeholder({
142+
pre_context_instructions = await replace_context_at_commit_symbol({
143143
instruction: pre_context_instructions,
144144
workspace_provider: params.panel_provider.workspace_provider
145145
})
146-
post_context_instructions = await replace_context_at_commit_placeholder({
146+
post_context_instructions = await replace_context_at_commit_symbol({
147147
instruction: post_context_instructions,
148148
after_context: true,
149149
workspace_provider: params.panel_provider.workspace_provider

‎packages/vscode/src/views/panel/backend/message-handlers/handle-edit-context.ts‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ import {
1515
import { EditFormat } from '@shared/types/edit-format'
1616
import { ToolConfig } from '@/services/model-providers-manager'
1717
import {
18-
replace_changes_placeholder,
19-
replace_commit_placeholder,
20-
replace_context_at_commit_placeholder
21-
} from '@/views/panel/backend/utils/replace-git-placeholders'
18+
replace_changes_symbol,
19+
replace_commit_symbol,
20+
replace_context_at_commit_symbol
21+
} from '@/views/panel/backend/utils/replace-git-symbols'
2222
import { replace_saved_context_placeholder } from '@/utils/replace-saved-context-placeholder'
23-
import { replace_selection_placeholder } from '@/views/panel/backend/utils/replace-selection-placeholder'
23+
import { replace_selection_placeholder } from '@/views/panel/backend/utils/replace-selection-symbol'
2424
import { PanelProvider } from '@/views/panel/backend/panel-provider'
2525
import { apply_reasoning_effort } from '@/utils/apply-reasoning-effort'
2626
import { EditContextMessage } from '@/views/panel/types/messages'
@@ -262,33 +262,33 @@ const perform_context_editing = async (params: {
262262
let post_context_instructions = instructions
263263

264264
if (pre_context_instructions.includes('#Changes:')) {
265-
pre_context_instructions = await replace_changes_placeholder({
265+
pre_context_instructions = await replace_changes_symbol({
266266
instruction: pre_context_instructions,
267267
workspace_provider: params.file_tree_provider
268268
})
269-
post_context_instructions = await replace_changes_placeholder({
269+
post_context_instructions = await replace_changes_symbol({
270270
instruction: post_context_instructions,
271271
after_context: true,
272272
workspace_provider: params.file_tree_provider
273273
})
274274
}
275275

276276
if (pre_context_instructions.includes('#Commit:')) {
277-
pre_context_instructions = await replace_commit_placeholder({
277+
pre_context_instructions = await replace_commit_symbol({
278278
instruction: pre_context_instructions
279279
})
280-
post_context_instructions = await replace_commit_placeholder({
280+
post_context_instructions = await replace_commit_symbol({
281281
instruction: post_context_instructions,
282282
after_context: true
283283
})
284284
}
285285

286286
if (pre_context_instructions.includes('#ContextAtCommit:')) {
287-
pre_context_instructions = await replace_context_at_commit_placeholder({
287+
pre_context_instructions = await replace_context_at_commit_symbol({
288288
instruction: pre_context_instructions,
289289
workspace_provider: params.file_tree_provider
290290
})
291-
post_context_instructions = await replace_context_at_commit_placeholder({
291+
post_context_instructions = await replace_context_at_commit_symbol({
292292
instruction: post_context_instructions,
293293
after_context: true,
294294
workspace_provider: params.file_tree_provider

‎packages/vscode/src/views/panel/backend/message-handlers/handle-preview-preset.ts‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import * as vscode from 'vscode'
22
import { PanelProvider } from '@/views/panel/backend/panel-provider'
33
import { PreviewPresetMessage } from '@/views/panel/types/messages'
44
import { FilesCollector } from '@/utils/files-collector'
5-
import { replace_selection_placeholder } from '@/views/panel/backend/utils/replace-selection-placeholder'
5+
import { replace_selection_placeholder } from '@/views/panel/backend/utils/replace-selection-symbol'
66
import { replace_saved_context_placeholder } from '@/utils/replace-saved-context-placeholder'
77
import {
8-
replace_changes_placeholder,
9-
replace_context_at_commit_placeholder,
10-
replace_commit_placeholder
11-
} from '@/views/panel/backend/utils/replace-git-placeholders'
8+
replace_changes_symbol,
9+
replace_context_at_commit_symbol,
10+
replace_commit_symbol
11+
} from '@/views/panel/backend/utils/replace-git-symbols'
1212
import { Preset } from '@shared/types/preset'
1313
import { apply_preset_affixes_to_instruction } from '@/utils/apply-preset-affixes'
1414
import { MODE } from '@/views/panel/types/main-view-mode'
@@ -107,34 +107,34 @@ export const handle_preview_preset = async (
107107
panel_provider.mode == MODE.WEB &&
108108
panel_provider.web_prompt_type == 'no-context'
109109

110-
pre_context_instructions = await replace_changes_placeholder({
110+
pre_context_instructions = await replace_changes_symbol({
111111
instruction: pre_context_instructions,
112112
workspace_provider: panel_provider.workspace_provider,
113113
is_no_context_web_mode
114114
})
115-
post_context_instructions = await replace_changes_placeholder({
115+
post_context_instructions = await replace_changes_symbol({
116116
instruction: post_context_instructions,
117117
after_context: true,
118118
workspace_provider: panel_provider.workspace_provider
119119
})
120120
}
121121

122122
if (pre_context_instructions.includes('#Commit:')) {
123-
pre_context_instructions = await replace_commit_placeholder({
123+
pre_context_instructions = await replace_commit_symbol({
124124
instruction: pre_context_instructions
125125
})
126-
post_context_instructions = await replace_commit_placeholder({
126+
post_context_instructions = await replace_commit_symbol({
127127
instruction: post_context_instructions,
128128
after_context: true
129129
})
130130
}
131131

132132
if (pre_context_instructions.includes('#ContextAtCommit:')) {
133-
pre_context_instructions = await replace_context_at_commit_placeholder({
133+
pre_context_instructions = await replace_context_at_commit_symbol({
134134
instruction: pre_context_instructions,
135135
workspace_provider: panel_provider.workspace_provider
136136
})
137-
post_context_instructions = await replace_context_at_commit_placeholder({
137+
post_context_instructions = await replace_context_at_commit_symbol({
138138
instruction: post_context_instructions,
139139
after_context: true,
140140
workspace_provider: panel_provider.workspace_provider

‎packages/vscode/src/views/panel/backend/message-handlers/handle-send-prompt.ts‎

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { PanelProvider } from '@/views/panel/backend/panel-provider'
22
import * as vscode from 'vscode'
33
import { FilesCollector } from '@/utils/files-collector'
4-
import { replace_selection_placeholder } from '@/views/panel/backend/utils/replace-selection-placeholder'
4+
import { replace_selection_placeholder } from '@/views/panel/backend/utils/replace-selection-symbol'
55
import { apply_preset_affixes_to_instruction } from '@/utils/apply-preset-affixes'
66
import { replace_saved_context_placeholder } from '@/utils/replace-saved-context-placeholder'
77
import {
8-
replace_changes_placeholder,
9-
replace_context_at_commit_placeholder,
10-
replace_commit_placeholder
11-
} from '@/views/panel/backend/utils/replace-git-placeholders'
8+
replace_changes_symbol,
9+
replace_context_at_commit_symbol,
10+
replace_commit_symbol
11+
} from '@/views/panel/backend/utils/replace-git-symbols'
1212
import { code_completion_instructions_for_panel } from '@/constants/instructions'
1313
import {
1414
get_last_selected_preset_or_group_key,
@@ -190,40 +190,38 @@ export const handle_send_prompt = async (params: {
190190
params.panel_provider.mode == MODE.WEB &&
191191
params.panel_provider.web_prompt_type == 'no-context'
192192

193-
pre_context_instructions = await replace_changes_placeholder({
193+
pre_context_instructions = await replace_changes_symbol({
194194
instruction: pre_context_instructions,
195195
workspace_provider: params.panel_provider.workspace_provider,
196196
is_no_context_web_mode
197197
})
198-
post_context_instructions = await replace_changes_placeholder({
198+
post_context_instructions = await replace_changes_symbol({
199199
instruction: post_context_instructions,
200200
after_context: true,
201201
workspace_provider: params.panel_provider.workspace_provider
202202
})
203203
}
204204

205205
if (pre_context_instructions.includes('#Commit:')) {
206-
pre_context_instructions = await replace_commit_placeholder({
206+
pre_context_instructions = await replace_commit_symbol({
207207
instruction: pre_context_instructions
208208
})
209-
post_context_instructions = await replace_commit_placeholder({
209+
post_context_instructions = await replace_commit_symbol({
210210
instruction: post_context_instructions,
211211
after_context: true
212212
})
213213
}
214214

215215
if (pre_context_instructions.includes('#ContextAtCommit:')) {
216-
pre_context_instructions =
217-
await replace_context_at_commit_placeholder({
218-
instruction: pre_context_instructions,
219-
workspace_provider: params.panel_provider.workspace_provider
220-
})
221-
post_context_instructions =
222-
await replace_context_at_commit_placeholder({
223-
instruction: post_context_instructions,
224-
after_context: true,
225-
workspace_provider: params.panel_provider.workspace_provider
226-
})
216+
pre_context_instructions = await replace_context_at_commit_symbol({
217+
instruction: pre_context_instructions,
218+
workspace_provider: params.panel_provider.workspace_provider
219+
})
220+
post_context_instructions = await replace_context_at_commit_symbol({
221+
instruction: post_context_instructions,
222+
after_context: true,
223+
workspace_provider: params.panel_provider.workspace_provider
224+
})
227225
}
228226
if (pre_context_instructions.includes('#SavedContext:')) {
229227
pre_context_instructions = await replace_saved_context_placeholder({

packages/vscode/src/views/panel/backend/utils/replace-git-placeholders.ts renamed to packages/vscode/src/views/panel/backend/utils/replace-git-symbols.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const build_changes_xml = (
9999
return ''
100100
}
101101

102-
export const replace_changes_placeholder = async (params: {
102+
export const replace_changes_symbol = async (params: {
103103
instruction: string
104104
after_context?: boolean
105105
workspace_provider: WorkspaceProvider
@@ -348,7 +348,7 @@ const build_commit_changes_xml = (
348348
return ''
349349
}
350350

351-
export const replace_commit_placeholder = async (params: {
351+
export const replace_commit_symbol = async (params: {
352352
instruction: string
353353
after_context?: boolean
354354
}): Promise<string> => {
@@ -446,7 +446,7 @@ const build_context_at_commit_xml = (
446446
return `\n<archive>\n${files_xml}</archive>\n`
447447
}
448448

449-
export const replace_context_at_commit_placeholder = async (params: {
449+
export const replace_context_at_commit_symbol = async (params: {
450450
instruction: string
451451
after_context?: boolean
452452
workspace_provider: WorkspaceProvider

packages/vscode/src/views/panel/backend/utils/replace-selection-placeholder.ts renamed to packages/vscode/src/views/panel/backend/utils/replace-selection-symbol.ts

File renamed without changes.

0 commit comments

Comments
 (0)