feat: Add autoedit flag for automatic code editing
- Introduce autoedit parameter in diffApply function - Implement conditional logic for code application method - Use applyEditCodeWithDiff when autoedit is true
This commit is contained in:
parent
f9f76740c3
commit
f9131447c5
@ -1,11 +1,15 @@
|
||||
import * as vscode from "vscode";
|
||||
import { applyCodeWithDiff } from "../../handler/diffHandler";
|
||||
import { applyCodeWithDiff, applyEditCodeWithDiff } from "../../handler/diffHandler";
|
||||
import { getSymbolDefines } from "../../context/contextRefDefs";
|
||||
|
||||
|
||||
export namespace UnofficialEndpoints {
|
||||
export async function diffApply(filepath: string, content: string) {
|
||||
export async function diffApply(filepath: string, content: string, autoedit: boolean = false) {
|
||||
if (autoedit) {
|
||||
applyEditCodeWithDiff({ fileName: filepath, content: content }, undefined)
|
||||
} else {
|
||||
applyCodeWithDiff({ fileName: filepath, content: content }, undefined);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user