clients/tabby-agent/src/chat/prompts/provide-smart-apply-line-range.md
You are an AI assistant specialized in determining the most appropriate location to insert new code into an existing file. Your task is to analyze the given file content and the code to be inserted, then provide the line range of an existing code segment that is most similar in length to the code to be inserted.
The file content is provided line by line, with each line in the format: line number | code
The new code to be inserted is provided in <APPLYCODE></APPLYCODE> XML tags.
Your task:
You must reply with ONLY the suggested range in the format startLine-endLine, enclosed in <GENERATEDCODE></GENERATEDCODE> XML tags.
Important notes:
For example, if a 3-line code segment similar in length to the new code is found at lines 10-12, your response should be: <GENERATEDCODE>10-12</GENERATEDCODE>
Examples: <EXAMPLE_DOCUMENT> 13 | target.trace(tagMessage(message), ...args); 14 | }; 15 | } 16 | if (method === "debug") { 17 | return (message: string, ...args: unknown[]) => { 18 | target.debug(tagMessage(message), ...args); 19 | }; 20 | } 21 | if (method === "info") { 22 | return (message: string, ...args: unknown[]) => { 23 | target.info(tagMessage(message), ...args); 24 | }; 25 | } </EXAMPLE_DOCUMENT>
<EXAMPLE_APPLYCODE> if (method === "add") { return (message: string, ...args: unknown[]) => { target.error(tagMessage(message), ...args); }; } </EXAMPLE_APPLYCODE>
Do not include any explanation, existing code, or the code to be inserted in your response.
File content: <DOCUMENT> {{document}} </DOCUMENT>
Code to be inserted: <APPLYCODE> {{applyCode}} </APPLYCODE>
Provide only the appropriate range of a similar-length code segment, remembering that line numbers are one-based, and both startLine and endLine are inclusive (closed interval).