fix: 删除 edit tool 中的旧逻辑处理, 现在已经不需要这些处理了, 大模型够屌 (#1251)

* refactor: remove tab/quote normalization from FileEditTool

* fix: resolve pre-existing typecheck errors (zod v4 compat + RCS web exclude)
This commit is contained in:
claude-code-best
2026-05-28 21:52:31 +08:00
committed by GitHub
parent c982104476
commit a91653a0dd
14 changed files with 23 additions and 447 deletions

View File

@@ -20,7 +20,7 @@ import { readEditContext } from 'src/utils/readEditContext.js';
import { firstLineOf } from 'src/utils/stringUtils.js';
import type { ThemeName } from 'src/utils/theme.js';
import type { FileEditOutput } from './types.js';
import { findActualString, getPatchForEdit, preserveQuoteStyle } from './utils.js';
import { findActualString, getPatchForEdit } from './utils.js';
export function userFacingName(
input:
@@ -265,12 +265,11 @@ async function loadRejectionDiff(
return { patch, firstLine: null, fileContent: undefined };
}
const actualOld = findActualString(ctx.content, oldString) || oldString;
const actualNew = preserveQuoteStyle(oldString, actualOld, newString);
const { patch } = getPatchForEdit({
filePath,
fileContents: ctx.content,
oldString: actualOld,
newString: actualNew,
newString: newString,
replaceAll,
});
return {