@@ -48,24 +48,9 @@ export const handle_send_to_browser = async (params: {
4848 return
4949 }
5050
51- let current_instructions = ''
5251 const is_in_code_completions_mode =
5352 params . panel_provider . web_prompt_type == 'code-at-cursor'
54-
55- if ( is_in_code_completions_mode ) {
56- current_instructions = params . panel_provider . code_at_cursor_instructions
57- } else {
58- if ( params . panel_provider . web_prompt_type == 'ask-about-context' ) {
59- current_instructions =
60- params . panel_provider . ask_about_context_instructions
61- } else if ( params . panel_provider . web_prompt_type == 'edit-context' ) {
62- current_instructions = params . panel_provider . edit_context_instructions
63- } else if ( params . panel_provider . web_prompt_type == 'no-context' ) {
64- current_instructions = params . panel_provider . no_context_instructions
65- } else if ( params . panel_provider . web_prompt_type == 'prune-context' ) {
66- current_instructions = params . panel_provider . prune_context_instructions
67- }
68- }
53+ const current_instructions = params . panel_provider . current_instruction
6954
7055 const active_editor = vscode . window . activeTextEditor
7156
@@ -114,11 +99,7 @@ export const handle_send_to_browser = async (params: {
11499 const text_after_cursor = document . getText (
115100 new vscode . Range ( position , document . positionAt ( document . getText ( ) . length ) )
116101 )
117-
118- const completion_instructions =
119- params . panel_provider . code_at_cursor_instructions
120-
121- let processed_completion_instructions = completion_instructions
102+ let processed_completion_instructions = current_instructions
122103 let skill_definitions = ''
123104
124105 if ( processed_completion_instructions . includes ( '#Selection' ) ) {
@@ -574,15 +555,30 @@ async function resolve_presets(params: {
574555
575556 let current_instructions = ''
576557 if ( params . panel_provider . web_prompt_type == 'code-at-cursor' ) {
577- current_instructions = params . panel_provider . code_at_cursor_instructions
558+ current_instructions =
559+ params . panel_provider . code_at_cursor_instructions . instructions [
560+ params . panel_provider . code_at_cursor_instructions . active_index
561+ ] || ''
578562 } else if ( params . panel_provider . web_prompt_type == 'ask-about-context' ) {
579- current_instructions = params . panel_provider . ask_about_context_instructions
563+ current_instructions =
564+ params . panel_provider . ask_about_context_instructions . instructions [
565+ params . panel_provider . ask_about_context_instructions . active_index
566+ ] || ''
580567 } else if ( params . panel_provider . web_prompt_type == 'edit-context' ) {
581- current_instructions = params . panel_provider . edit_context_instructions
568+ current_instructions =
569+ params . panel_provider . edit_context_instructions . instructions [
570+ params . panel_provider . edit_context_instructions . active_index
571+ ] || ''
582572 } else if ( params . panel_provider . web_prompt_type == 'no-context' ) {
583- current_instructions = params . panel_provider . no_context_instructions
573+ current_instructions =
574+ params . panel_provider . no_context_instructions . instructions [
575+ params . panel_provider . no_context_instructions . active_index
576+ ] || ''
584577 } else if ( params . panel_provider . web_prompt_type == 'prune-context' ) {
585- current_instructions = params . panel_provider . prune_context_instructions
578+ current_instructions =
579+ params . panel_provider . prune_context_instructions . instructions [
580+ params . panel_provider . prune_context_instructions . active_index
581+ ] || ''
586582 }
587583
588584 const get_is_preset_disabled = ( preset : ConfigPresetFormat ) =>
0 commit comments