@@ -450,7 +450,9 @@ TCVB 格式规范:
4504504. [markdown代码块], 一定要用\`\`\` ... \`\`\` 包裹,仔细检查不要漏掉。
4514515. 注意TCVB和CVB的区别。CVB是完整的内容,而TCVB是用来生成差量同步的,通过多个OPERATION去操作已有CVB合成新CVB
4524526. 插入和删除操作都可以转化为替换操作
453- 7. 用来匹配的锚点必须和原始传入的数据完全一致,不能有缺失,不能丢弃注释。
453+ 7. 用来匹配的锚点必须和原文的格式完全一致,不能有缺失,不能丢弃注释。
454+ 8. 注意不要丢失OPERATION而直接输出代码块
455+ 9. 不要私自加入不必要的空行
454456` ;
455457 }
456458}
@@ -539,19 +541,19 @@ function diagnoseMatchFailure(strContent: string, op: ExactReplaceOperation): st
539541
540542 if ( beforeAnchorRange [ 0 ] === - 1 )
541543 {
542- errorMessages . push ( `FILE: ${ op . m_strFilePath } 未找到 BEFORE_ANCHOR:\n\`\`\`\n${ op . m_strBeforeAnchor } \n\`\`\`` ) ;
544+ errorMessages . push ( `FILE: ${ op . m_strFilePath } 无法精确匹配(有和原文不一致的地方) BEFORE_ANCHOR:\n\`\`\`\n${ op . m_strBeforeAnchor } \n\`\`\`` ) ;
543545 console . log ( `FILE: ${ op . m_strFilePath } 未找到 BEFORE_ANCHOR:\n\`\`\`\n${ op . m_strBeforeAnchor } \n\`\`\`\n表达式\n${ beforeAnchorPattern } ` ) ;
544546 }
545547
546548 if ( afterAnchorRange [ 0 ] === - 1 )
547549 {
548- errorMessages . push ( `FILE: ${ op . m_strFilePath } 未找到 AFTER_ANCHOR:\n\`\`\`\n${ op . m_strAfterAnchor } \n\`\`\`` ) ;
550+ errorMessages . push ( `FILE: ${ op . m_strFilePath } 无法精确匹配(有和原文不一致的地方) AFTER_ANCHOR:\n\`\`\`\n${ op . m_strAfterAnchor } \n\`\`\`` ) ;
549551 console . log ( `FILE: ${ op . m_strFilePath } 未找到 AFTER_ANCHOR:\n\`\`\`\n${ op . m_strAfterAnchor } \n\`\`\`\n表达式\n${ afterAnchorPattern } ` ) ;
550552 }
551553
552554 if ( oldContentRange [ 0 ] === - 1 )
553555 {
554- errorMessages . push ( `FILE: ${ op . m_strFilePath } 未找到 OLD_CONTENT:\n\`\`\`\n${ op . m_strOldContent } \n\`\`\`` ) ;
556+ errorMessages . push ( `FILE: ${ op . m_strFilePath } 无法精确匹配(有和原文不一致的地方) OLD_CONTENT:\n\`\`\`\n${ op . m_strOldContent } \n\`\`\`` ) ;
555557 console . log ( `FILE: ${ op . m_strFilePath } 未找到 OLD_CONTENT:\n\`\`\`\n${ op . m_strOldContent } \n\`\`\`\n表达式\n${ oldContentPattern } ` ) ;
556558 }
557559
@@ -565,7 +567,7 @@ function diagnoseMatchFailure(strContent: string, op: ExactReplaceOperation): st
565567 if ( firstOldContentLine < lastBeforeAnchorLine || lastOldContentLine > firstAfterAnchorLine )
566568 {
567569 errorMessages . push (
568- `FILE: ${ op . m_strFilePath } OLD_CONTENT 应该在 BEFORE_ANCHOR 和 AFTER_ANCHOR 之间:\nBEFORE_ANCHOR:\n\`\`\`\n${ op . m_strBeforeAnchor } \n\`\`\`\nOLD_CONTENT:\n\`\`\`\n${ op . m_strOldContent } \n\`\`\`\nAFTER_ANCHOR:\n\`\`\`\n${ op . m_strAfterAnchor } \n\`\`\`` ) ;
570+ `FILE: ${ op . m_strFilePath } OLD_CONTENT 应该在 BEFORE_ANCHOR 和 AFTER_ANCHOR 之间, 且不能有重叠 :\nBEFORE_ANCHOR:\n\`\`\`\n${ op . m_strBeforeAnchor } \n\`\`\`\nOLD_CONTENT:\n\`\`\`\n${ op . m_strOldContent } \n\`\`\`\nAFTER_ANCHOR:\n\`\`\`\n${ op . m_strAfterAnchor } \n\`\`\`` ) ;
569571 }
570572 }
571573
0 commit comments