apply to correct range
This commit is contained in:
parent
55270279f6
commit
4d299ba2cd
1 changed files with 17 additions and 1 deletions
|
|
@ -198,7 +198,23 @@ export class VsCodeMessenger {
|
|||
);
|
||||
} else {
|
||||
const prompt = `The following code was suggested as an edit:\n\`\`\`\n${msg.data.text}\n\`\`\`\nPlease apply it to the previous code.`;
|
||||
verticalDiffManager.streamEdit(prompt, llm.title, msg.data.streamId);
|
||||
const fullEditorRange = new vscode.Range(
|
||||
0,
|
||||
0,
|
||||
editor.document.lineCount - 1,
|
||||
editor.document.lineAt(editor.document.lineCount - 1).text.length,
|
||||
);
|
||||
const rangeToApplyTo = editor.selection.isEmpty
|
||||
? fullEditorRange
|
||||
: editor.selection;
|
||||
verticalDiffManager.streamEdit(
|
||||
prompt,
|
||||
llm.title,
|
||||
msg.data.streamId,
|
||||
undefined,
|
||||
undefined,
|
||||
rangeToApplyTo,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue