Skip to content

Commit 25eaee5

Browse files
committed
修改提示词和调试log
1 parent af3de11 commit 25eaee5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/cvbManager.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -436,10 +436,10 @@ TCVB 格式规范:
436436
1. 所有OPERATION操作以行为单位
437437
2. 一个'## FILE'下可以有多个'## OPERATION'
438438
3. 锚点为连续的多行内容:使用至少3行唯一文本作为锚点,用来标定范围,防止混淆(如果需要可以超过3行)
439-
4. [markdown代码块], 一定要用\`\`\` ... \`\`\` 包裹,仔细检查不要漏掉
439+
4. [markdown代码块], 一定要用\`\`\` ... \`\`\` 包裹,仔细检查不要漏掉
440440
5. 注意TCVB和CVB的区别。CVB是完整的内容,而TCVB是用来生成差量同步的,通过多个OPERATION去操作已有CVB合成新CVB
441441
6. 插入和删除操作都可以转化为替换操作
442-
7. 用来匹配的锚点必须和原始传入的数据一致,不能有缺失,比如不能丢弃注释
442+
7. 用来匹配的锚点必须和原始传入的数据完全一致,不能有缺失,不能丢弃注释
443443
`;
444444
}
445445
}
@@ -501,7 +501,7 @@ function applyExactReplace(strContent: string, op: ExactReplaceOperation): strin
501501

502502
regPattern.lastIndex = 0; // 重置正则表达式的状态
503503
if (!regPattern.test(strContent)) {
504-
console.log("以下表达式:\n" + regPattern + "\n 为何无法匹配到原文:\n" + strContent);
504+
console.log("以下表达式:\n" + regPattern + "\n 无法匹配:\n");
505505
throw new Error(`Exact-replace操作失败:文件 "${op.m_strFilePath}" 中未找到匹配项。请检查前后锚点及旧内容是否正确。`);
506506
}
507507
regPattern.lastIndex = 0; // 再次重置以备替换
@@ -520,7 +520,7 @@ function applyGlobalReplace(strContent: string, op: GlobalReplaceOperation) : st
520520

521521
regPattern.lastIndex = 0;
522522
if (!regPattern.test(strContent)) {
523-
console.log("以下表达式:\n" + regPattern + "\n 为何无法匹配到原文:\n" + strContent);
523+
console.log("以下表达式:\n" + regPattern + "\n 无法匹配");
524524
throw new Error(`全局替换失败:文件 "${op.m_strFilePath}" 中未找到旧内容 "${op.m_strOldContent}"。`);
525525
}
526526
regPattern.lastIndex = 0;

0 commit comments

Comments
 (0)