From 6713e408754fad5a67e8c6d807458ac2cc3c2352 Mon Sep 17 00:00:00 2001 From: jvmncs <7891333+jvmncs@users.noreply.github.com> Date: Wed, 14 Aug 2024 12:20:22 -0400 Subject: [PATCH] =?UTF-8?q?Revert=20"Simplify=20inline=20assist=20to=20avo?= =?UTF-8?q?id=20spurious=20xml=20in=20completions=20(=E2=80=A6=20(#16231)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …#16184)" This reverts commit c3edbd7d9a3d26e7ad0607b1c45cf1e621623421, which caused a regression that leaked chatter into inline assist replacements and tags into insertions. Release Notes: - N/A --- assets/prompts/content_prompt.hbs | 53 +++++++++++++++++++------------ 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/assets/prompts/content_prompt.hbs b/assets/prompts/content_prompt.hbs index 5965c40b13..107b6be042 100644 --- a/assets/prompts/content_prompt.hbs +++ b/assets/prompts/content_prompt.hbs @@ -1,41 +1,52 @@ +Here's a text file that I'm going to ask you to make an edit to. + {{#if language_name}} -File language: {{language_name}} +The file is in {{language_name}}. {{/if}} +You need to rewrite a portion of it. + +The section you'll need to edit is marked with tags. + {{{document_content}}} {{#if is_truncated}} -Note: Context around the relevant section has been truncated for brevity. +The context around the relevant section has been truncated (possibly in the middle of a line) for brevity. {{/if}} -Editing instructions: -1. Rewrite the section marked with tags based on this prompt: +Rewrite the section of {{content_type}} in tags based on the following prompt: + {{{user_prompt}}} -2. Within , make changes only in these subsections: - {{#if has_insertion}} - - Insert text where marked with tags - {{/if}} - {{#if has_replacement}} - - Edit text surrounded by tags - {{/if}} +Here's the section to edit based on that prompt again for reference: + + +{{{rewrite_section}}} + + +You'll rewrite this entire section, but you will only make changes within certain subsections. + +{{#if has_insertion}} +Insert text anywhere you see it marked with with tags. Do not include tags in your output. +{{/if}} +{{#if has_replacement}} +Edit edit text that you see surrounded with tags. Do not include tags in your output. +{{/if}} -3. Section to edit: {{{rewrite_section_with_selections}}} -4. Guidelines: - - Only make changes necessary to fulfill the prompt - - Preserve all surrounding {{content_type}} - - Maintain the original indentation level - - Rewrite the entire section, even if no changes are needed - - Do not include , , or tags in your output +Only make changes that are necessary to fulfill the prompt, leave everything else as-is. All surrounding {{content_type}} will be preserved. Do not output the tags or anything outside of them. -Output format: -Immediately start with the following, ensuring no leading whitespace: -```{{REWRITTEN_CODE}}``` +Start at the indentation level in the original file in the rewritten {{content_type}}. Don't stop until you've rewritten the entire section, even if you have no more changes to make. Always write out the whole section with no unnecessary elisions. + +Immediately start with the following format with no remarks: + +``` +\{{REWRITTEN_CODE}} +```