Skip to content

Commit c916be8

Browse files
committed
Rename instruction parameter to instructions in replace symbols function and its callers
1 parent 9866337 commit c916be8

6 files changed

Lines changed: 17 additions & 17 deletions

File tree

‎apps/editor/src/views/prompt/backend/message-handlers/handle-autofill.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ export const handle_autofill = async (params: {
6767
})
6868
const context_text = collected.other_files + collected.recent_files
6969

70-
const { instruction: processed_instructions, skill_definitions } =
70+
const { instructions: processed_instructions, skill_definitions } =
7171
await replace_symbols({
72-
instruction: current_instructions,
72+
instructions: current_instructions,
7373
extension_context: params.prompt_view_provider.extension_context,
7474
workspace_provider: params.prompt_view_provider.workspace_provider,
7575
remove_images: true

‎apps/editor/src/views/prompt/backend/message-handlers/handle-copy-prompt.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ export const handle_copy_prompt = async (params: {
2222
})
2323
const context_text = collected.other_files + collected.recent_files
2424

25-
const { instruction: processed_instructions, skill_definitions } =
25+
const { instructions: processed_instructions, skill_definitions } =
2626
await replace_symbols({
27-
instruction: params.instructions,
27+
instructions: params.instructions,
2828
extension_context: params.prompt_view_provider.extension_context,
2929
workspace_provider: params.prompt_view_provider.workspace_provider,
3030
remove_images: true

‎apps/editor/src/views/prompt/backend/message-handlers/handle-make-api-call.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@ export const handle_make_api_call = async (
169169
return
170170
}
171171

172-
const { instruction: processed_instructions, skill_definitions } =
172+
const { instructions: processed_instructions, skill_definitions } =
173173
await replace_symbols({
174-
instruction: instructions,
174+
instructions,
175175
extension_context: prompt_view_provider.extension_context,
176176
workspace_provider: prompt_view_provider.workspace_provider
177177
})

‎apps/editor/src/views/prompt/backend/message-handlers/handle-preview-web-configuration.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ export const handle_preview_web_configuration = async (
2626
})
2727
const context_text = collected.other_files + collected.recent_files
2828

29-
const { instruction: processed_instructions, skill_definitions } =
29+
const { instructions: processed_instructions, skill_definitions } =
3030
await replace_symbols({
31-
instruction: current_instructions,
31+
instructions: current_instructions,
3232
extension_context: prompt_view_provider.extension_context,
3333
workspace_provider: prompt_view_provider.workspace_provider,
3434
remove_images: true

‎apps/editor/src/views/prompt/backend/prompt-view-provider.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -536,13 +536,13 @@ export class PromptViewProvider implements vscode.WebviewViewProvider {
536536

537537
public async send_token_count() {
538538
const edit_instructions_result = await replace_symbols({
539-
instruction: this.current_edit_files_instruction,
539+
instructions: this.current_edit_files_instruction,
540540
extension_context: this.extension_context,
541541
workspace_provider: this.workspace_provider,
542542
remove_images: true
543543
})
544544
const ask_instructions_result = await replace_symbols({
545-
instruction: this.current_ask_about_context_instruction,
545+
instructions: this.current_ask_about_context_instruction,
546546
extension_context: this.extension_context,
547547
workspace_provider: this.workspace_provider,
548548
remove_images: true
@@ -552,12 +552,12 @@ export class PromptViewProvider implements vscode.WebviewViewProvider {
552552
command: 'TOKEN_COUNT_UPDATED',
553553
selected_files_token_count: this.current_selected_files_token_count,
554554
edit_instructions_token_count: Math.ceil(
555-
(edit_instructions_result.instruction.length +
555+
(edit_instructions_result.instructions.length +
556556
edit_instructions_result.skill_definitions.length) /
557557
4
558558
),
559559
ask_instructions_token_count: Math.ceil(
560-
(ask_instructions_result.instruction.length +
560+
(ask_instructions_result.instructions.length +
561561
ask_instructions_result.skill_definitions.length) /
562562
4
563563
)

‎apps/editor/src/views/prompt/backend/utils/symbols/replace-symbols.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ import { replace_website_symbol } from './website/replace-website-symbol'
1313
import { replace_fragment_symbol } from './fragment/replace-fragment-symbol'
1414
import { replace_clipboard_paths_symbol } from './clipboard-paths/replace-clipboard-paths-symbol'
1515

16-
export interface ReplaceSymbolsParams {
17-
instruction: string
16+
type ReplaceSymbolsParams = {
17+
instructions: string
1818
extension_context: vscode.ExtensionContext
1919
workspace_provider: WorkspaceProvider
2020
remove_images?: boolean
2121
}
2222

2323
export const replace_symbols = async (
2424
params: ReplaceSymbolsParams
25-
): Promise<{ instruction: string; skill_definitions: string }> => {
26-
let processed_instructions = params.instruction
25+
): Promise<{ instructions: string; skill_definitions: string }> => {
26+
let processed_instructions = params.instructions
2727
let skill_definitions = ''
2828

2929
if (processed_instructions.includes('#Selection')) {
@@ -99,5 +99,5 @@ export const replace_symbols = async (
9999
processed_instructions = replace_fragment_symbol(processed_instructions)
100100
}
101101

102-
return { instruction: processed_instructions, skill_definitions }
102+
return { instructions: processed_instructions, skill_definitions }
103103
}

0 commit comments

Comments
 (0)