Skip to content

Commit 5af8610

Browse files
committed
Update expected test output to reflect panel provider renaming and new preset parameters
1 parent de1db3a commit 5af8610

2 files changed

Lines changed: 48 additions & 42 deletions

File tree

‎apps/editor/src/commands/apply-response-command/utils/edit-formats/diffs/test-cases/generic-6/expected.txt‎

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as vscode from 'vscode'
2-
import { PanelViewProvider } from '@/views/panel/backend/panel-view-provider'
2+
import { PanelProvider } from '@/views/panel/backend/panel-provider'
33
import { PreviewPresetMessage } from '@/views/panel/types/messages'
44
import { FilesCollector } from '@/utils/files-collector'
55
import { replace_selection_symbol } from '@/views/panel/backend/utils/replace-selection-symbol'
@@ -24,23 +24,23 @@ import {
2424
} from '@/constants/edit-format-instructions'
2525

2626
export const handle_preview_preset = async (
27-
panel_view_provider: PanelViewProvider,
27+
panel_provider: PanelProvider,
2828
message: PreviewPresetMessage
2929
): Promise<void> => {
3030
await vscode.workspace.saveAll()
3131

3232
const files_collector = new FilesCollector({
33-
workspace_provider: panel_view_provider.workspace_provider,
34-
open_editors_provider: panel_view_provider.open_editors_provider
33+
workspace_provider: panel_provider.workspace_provider,
34+
open_editors_provider: panel_provider.open_editors_provider
3535
})
3636

3737
const active_editor = vscode.window.activeTextEditor
3838
const active_path = active_editor?.document.uri.fsPath
3939

4040
let text_to_send: string
41-
const current_instructions = panel_view_provider.current_instruction
41+
const current_instructions = panel_provider.current_instruction
4242

43-
if (panel_view_provider.web_prompt_type == 'code-at-cursor' && active_editor) {
43+
if (panel_provider.web_prompt_type == 'code-at-cursor' && active_editor) {
4444
const document = active_editor.document
4545
const position = active_editor.selection.active
4646

@@ -89,15 +89,15 @@ export const handle_preview_preset = async (
8989
processed_completion_instructions =
9090
await replace_context_at_commit_symbol({
9191
instruction: processed_completion_instructions,
92-
workspace_provider: panel_view_provider.workspace_provider
92+
workspace_provider: panel_provider.workspace_provider
9393
})
9494
}
9595

9696
if (processed_completion_instructions.includes('#SavedContext(')) {
9797
const result = await replace_saved_context_symbol({
9898
instruction: processed_completion_instructions,
99-
context: panel_view_provider.context,
100-
workspace_provider: panel_view_provider.workspace_provider
99+
context: panel_provider.context,
100+
workspace_provider: panel_provider.workspace_provider
101101
})
102102
processed_completion_instructions = result.instruction
103103
skill_definitions += result.context_definitions
@@ -135,11 +135,11 @@ export const handle_preview_preset = async (
135135
: '<missing_text>'
136136

137137
text_to_send = `<files>\n${context_text}<file path="${relative_path}">\n<![CDATA[\n${text_before_cursor}${missing_text_tag}${text_after_cursor}\n]]>\n</file>\n</files>\n${skill_definitions}${system_instructions}`
138-
} else if (panel_view_provider.web_prompt_type != 'code-at-cursor') {
138+
} else if (panel_provider.web_prompt_type != 'code-at-cursor') {
139139
let instructions = apply_preset_affixes_to_instruction({
140140
instruction: current_instructions,
141141
preset_name: message.preset.name!,
142-
presets_config_key: panel_view_provider.get_presets_config_key(),
142+
presets_config_key: panel_provider.get_presets_config_key(),
143143
override_affixes: {
144144
promptPrefix: message.preset.prompt_prefix,
145145
promptSuffix: message.preset.prompt_suffix
@@ -152,7 +152,7 @@ export const handle_preview_preset = async (
152152
instructions.includes('#Selection')
153153

154154
const context_text =
155-
panel_view_provider.web_prompt_type != 'no-context'
155+
panel_provider.web_prompt_type != 'no-context'
156156
? await files_collector.collect_files({})
157157
: ''
158158

@@ -182,15 +182,15 @@ export const handle_preview_preset = async (
182182
if (processed_instructions.includes('#ContextAtCommit(')) {
183183
processed_instructions = await replace_context_at_commit_symbol({
184184
instruction: processed_instructions,
185-
workspace_provider: panel_view_provider.workspace_provider
185+
workspace_provider: panel_provider.workspace_provider
186186
})
187187
}
188188

189189
if (processed_instructions.includes('#SavedContext(')) {
190190
const result = await replace_saved_context_symbol({
191191
instruction: processed_instructions,
192-
context: panel_view_provider.context,
193-
workspace_provider: panel_view_provider.workspace_provider
192+
context: panel_provider.context,
193+
workspace_provider: panel_provider.workspace_provider
194194
})
195195
processed_instructions = result.instruction
196196
skill_definitions += result.context_definitions
@@ -222,20 +222,20 @@ export const handle_preview_preset = async (
222222
}
223223

224224
let system_instructions_xml = ''
225-
if (panel_view_provider.web_prompt_type == 'edit-context') {
225+
if (panel_provider.web_prompt_type == 'edit-context') {
226226
const config = vscode.workspace.getConfiguration('codeWebChat')
227227
const instructions_key = {
228228
whole: 'editFormatInstructionsWhole',
229229
truncated: 'editFormatInstructionsTruncated',
230230
'before-after': 'editFormatInstructionsBeforeAfter',
231231
diff: 'editFormatInstructionsDiff'
232-
}[panel_view_provider.chat_edit_format]
232+
}[panel_provider.chat_edit_format]
233233
const default_instructions = {
234234
whole: EDIT_FORMAT_INSTRUCTIONS_WHOLE,
235235
truncated: EDIT_FORMAT_INSTRUCTIONS_TRUNCATED,
236236
'before-after': EDIT_FORMAT_INSTRUCTIONS_BEFORE_AFTER,
237237
diff: EDIT_FORMAT_INSTRUCTIONS_DIFF
238-
}[panel_view_provider.chat_edit_format]
238+
}[panel_provider.chat_edit_format]
239239
const edit_format_instructions =
240240
config.get<string>(instructions_key) || default_instructions
241241
if (edit_format_instructions) {
@@ -264,22 +264,25 @@ export const handle_preview_preset = async (
264264
prompt_prefix: message.preset.prompt_prefix,
265265
prompt_suffix: message.preset.prompt_suffix,
266266
model: message.preset.model,
267+
temperature: message.preset.temperature,
268+
top_p: message.preset.top_p,
269+
thinking_budget: message.preset.thinking_budget,
267270
reasoning_effort: message.preset.reasoning_effort,
268271
system_instructions: message.preset.system_instructions,
269272
options: message.preset.options,
270273
port: message.preset.port,
271274
new_url: message.preset.new_url
272275
}
273276

274-
const sent = await panel_view_provider.websocket_server_instance.preview_preset({
277+
const sent = await panel_provider.websocket_server_instance.preview_preset({
275278
instruction: text_to_send,
276279
preset: preset_for_preview,
277-
prompt_type: panel_view_provider.web_prompt_type,
280+
prompt_type: panel_provider.web_prompt_type,
278281
raw_instructions: current_instructions
279282
})
280283

281284
if (sent) {
282-
panel_view_provider.send_message({
285+
panel_provider.send_message({
283286
command: 'SHOW_AUTO_CLOSING_MODAL',
284287
title: 'Continue in the connected browser',
285288
type: 'success'

‎apps/editor/src/commands/apply-response-command/utils/edit-formats/diffs/test-cases/generic-6/original.txt‎

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as vscode from 'vscode'
2-
import { PanelViewProvider } from '@/views/panel/backend/panel-view-provider'
2+
import { PanelProvider } from '@/views/panel/backend/panel-provider'
33
import { PreviewPresetMessage } from '@/views/panel/types/messages'
44
import { FilesCollector } from '@/utils/files-collector'
55
import { replace_selection_symbol } from '@/views/panel/backend/utils/replace-selection-symbol'
@@ -23,23 +23,23 @@ import {
2323
} from '@/constants/edit-format-instructions'
2424

2525
export const handle_preview_preset = async (
26-
panel_view_provider: PanelViewProvider,
26+
panel_provider: PanelProvider,
2727
message: PreviewPresetMessage
2828
): Promise<void> => {
2929
await vscode.workspace.saveAll()
3030

3131
const files_collector = new FilesCollector({
32-
workspace_provider: panel_view_provider.workspace_provider,
33-
open_editors_provider: panel_view_provider.open_editors_provider
32+
workspace_provider: panel_provider.workspace_provider,
33+
open_editors_provider: panel_provider.open_editors_provider
3434
})
3535

3636
const active_editor = vscode.window.activeTextEditor
3737
const active_path = active_editor?.document.uri.fsPath
3838

3939
let text_to_send: string
40-
const current_instructions = panel_view_provider.current_instruction
40+
const current_instructions = panel_provider.current_instruction
4141

42-
if (panel_view_provider.web_prompt_type == 'code-at-cursor' && active_editor) {
42+
if (panel_provider.web_prompt_type == 'code-at-cursor' && active_editor) {
4343
const document = active_editor.document
4444
const position = active_editor.selection.active
4545

@@ -88,15 +88,15 @@ export const handle_preview_preset = async (
8888
processed_completion_instructions =
8989
await replace_context_at_commit_symbol({
9090
instruction: processed_completion_instructions,
91-
workspace_provider: panel_view_provider.workspace_provider
91+
workspace_provider: panel_provider.workspace_provider
9292
})
9393
}
9494

9595
if (processed_completion_instructions.includes('#SavedContext(')) {
9696
const result = await replace_saved_context_symbol({
9797
instruction: processed_completion_instructions,
98-
context: panel_view_provider.context,
99-
workspace_provider: panel_view_provider.workspace_provider
98+
context: panel_provider.context,
99+
workspace_provider: panel_provider.workspace_provider
100100
})
101101
processed_completion_instructions = result.instruction
102102
skill_definitions += result.context_definitions
@@ -128,11 +128,11 @@ export const handle_preview_preset = async (
128128
: '<missing_text>'
129129

130130
text_to_send = `<files>\n${context_text}<file path="${relative_path}">\n<![CDATA[\n${text_before_cursor}${missing_text_tag}${text_after_cursor}\n]]>\n</file>\n</files>\n${skill_definitions}${system_instructions}`
131-
} else if (panel_view_provider.web_prompt_type != 'code-at-cursor') {
131+
} else if (panel_provider.web_prompt_type != 'code-at-cursor') {
132132
let instructions = apply_preset_affixes_to_instruction({
133133
instruction: current_instructions,
134134
preset_name: message.preset.name!,
135-
presets_config_key: panel_view_provider.get_presets_config_key(),
135+
presets_config_key: panel_provider.get_presets_config_key(),
136136
override_affixes: {
137137
promptPrefix: message.preset.prompt_prefix,
138138
promptSuffix: message.preset.prompt_suffix
@@ -145,7 +145,7 @@ export const handle_preview_preset = async (
145145
instructions.includes('#Selection')
146146

147147
const context_text =
148-
panel_view_provider.web_prompt_type != 'no-context'
148+
panel_provider.web_prompt_type != 'no-context'
149149
? await files_collector.collect_files({})
150150
: ''
151151

@@ -175,15 +175,15 @@ export const handle_preview_preset = async (
175175
if (processed_instructions.includes('#ContextAtCommit(')) {
176176
processed_instructions = await replace_context_at_commit_symbol({
177177
instruction: processed_instructions,
178-
workspace_provider: panel_view_provider.workspace_provider
178+
workspace_provider: panel_provider.workspace_provider
179179
})
180180
}
181181

182182
if (processed_instructions.includes('#SavedContext(')) {
183183
const result = await replace_saved_context_symbol({
184184
instruction: processed_instructions,
185-
context: panel_view_provider.context,
186-
workspace_provider: panel_view_provider.workspace_provider
185+
context: panel_provider.context,
186+
workspace_provider: panel_provider.workspace_provider
187187
})
188188
processed_instructions = result.instruction
189189
skill_definitions += result.context_definitions
@@ -211,20 +211,20 @@ export const handle_preview_preset = async (
211211
}
212212

213213
let system_instructions_xml = ''
214-
if (panel_view_provider.web_prompt_type == 'edit-context') {
214+
if (panel_provider.web_prompt_type == 'edit-context') {
215215
const config = vscode.workspace.getConfiguration('codeWebChat')
216216
const instructions_key = {
217217
whole: 'editFormatInstructionsWhole',
218218
truncated: 'editFormatInstructionsTruncated',
219219
'before-after': 'editFormatInstructionsBeforeAfter',
220220
diff: 'editFormatInstructionsDiff'
221-
}[panel_view_provider.chat_edit_format]
221+
}[panel_provider.chat_edit_format]
222222
const default_instructions = {
223223
whole: EDIT_FORMAT_INSTRUCTIONS_WHOLE,
224224
truncated: EDIT_FORMAT_INSTRUCTIONS_TRUNCATED,
225225
'before-after': EDIT_FORMAT_INSTRUCTIONS_BEFORE_AFTER,
226226
diff: EDIT_FORMAT_INSTRUCTIONS_DIFF
227-
}[panel_view_provider.chat_edit_format]
227+
}[panel_provider.chat_edit_format]
228228
const edit_format_instructions =
229229
config.get<string>(instructions_key) || default_instructions
230230
if (edit_format_instructions) {
@@ -253,22 +253,25 @@ export const handle_preview_preset = async (
253253
prompt_prefix: message.preset.prompt_prefix,
254254
prompt_suffix: message.preset.prompt_suffix,
255255
model: message.preset.model,
256+
temperature: message.preset.temperature,
257+
top_p: message.preset.top_p,
258+
thinking_budget: message.preset.thinking_budget,
256259
reasoning_effort: message.preset.reasoning_effort,
257260
system_instructions: message.preset.system_instructions,
258261
options: message.preset.options,
259262
port: message.preset.port,
260263
new_url: message.preset.new_url
261264
}
262265

263-
const sent = await panel_view_provider.websocket_server_instance.preview_preset({
266+
const sent = await panel_provider.websocket_server_instance.preview_preset({
264267
instruction: text_to_send,
265268
preset: preset_for_preview,
266-
prompt_type: panel_view_provider.web_prompt_type,
269+
prompt_type: panel_provider.web_prompt_type,
267270
raw_instructions: current_instructions
268271
})
269272

270273
if (sent) {
271-
panel_view_provider.send_message({
274+
panel_provider.send_message({
272275
command: 'SHOW_AUTO_CLOSING_MODAL',
273276
title: 'Continue in the connected browser',
274277
type: 'success'

0 commit comments

Comments
 (0)