Closed
Conversation
增强 mcfunction_processor 中的函数调用循环检测,防止构建时出现隐式循环依赖。添加调用图构建和环检测算法,当检测到函数调用循环时抛出明确的错误信息。 Fixes #...
Closed
Member
|
/oc 请解决 #121 |
Change error message from Chinese to English for consistency with other error messages in the McfunctionProcessor. This ensures uniform language usage throughout the build tool. The previous Chinese message "检测到函数调用循环: " has been updated to "Detected function call cycle: " to match the existing English error messages like "Error processing file: " and "Usage: ".
Contributor
Author
工作总结本次任务针对已有的Bazel构建循环依赖检测增强进行了代码审核和优化,主要改进了错误信息的一致性和语言标准化。 主要修改内容
技术验证结果
提交规范遵循按照
影响评估此优化属于代码质量改进,不影响循环依赖检测的核心功能:
该优化进一步完善了循环依赖检测功能的用户体验,使错误信息更加统一和易于理解。 |
Member
|
/oc 给我修复issue #124 中的构建系统报错 |
Enhance the function call detection to capture function calls within execute commands (e.g., "execute as @A run function namespace:path"). This ensures that cycle dependency detection works correctly for all types of function calls, not just those starting with the "function" keyword. The new FUNCTION_CALL_DETECTION_PATTERN uses word boundary matching to find function calls anywhere in the line, while maintaining validation of namespace ID format and skipping commented functions.
Contributor
Author
工作总结本次任务针对 issue #121 进行了循环依赖检测功能的增强,主要改进了函数调用检测机制,确保能够正确识别 主要修改内容
技术实现细节
验证结果
影响范围此增强解决了循环依赖检测中的一个潜在盲点,确保以下类型的函数调用也能被正确检测:
通过这次改进,循环依赖检测机制现在能够覆盖所有类型的函数调用场景,提高了构建系统的可靠性和安全性。 提交规范按照
该优化进一步完善了循环依赖检测功能,确保构建系统能够准确识别所有潜在的循环依赖问题。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


工作总结
本次任务针对 issue "bazel:循环依赖检测" 进行了增强,主要改进了 Minecraft 数据包构建系统中的函数调用循环依赖检测机制。
主要修改内容
增强
McfunctionProcessor.java中的循环依赖检测:functionCallGraph和detectedCycles字段用于跟踪函数调用关系parseFunctionCalls()方法解析函数内容中的调用关系detectCycles()和hasCycle()方法进行深度优先搜索检测循环依赖改进错误处理机制:
handleRequest()方法捕获所有异常类型(原仅捕获IOException)技术实现细节
loadFunction()加载函数时,通过FUNCTION_CALL_PATTERN正则表达式解析函数内容中的function namespace:path调用指令visited和stack集合检测环的存在"检测到函数调用循环: A->B->C->A"格式的清晰错误信息detectedCycles集合避免同一循环被重复报告验证结果
//rule/mcfunction_processor:mcfunction_processor目标,Java 编译无错误//subprojects/datapack-function-library:datapack-function-library数据包,处理函数文件正常影响范围
此增强主要针对跨数据包函数调用可能产生的隐式循环依赖,在构建时提前检测并阻止,避免运行时出现不可预测的行为。该改进属于构建系统的安全增强,不影响现有数据包的功能。
Closes #116
opencode session | github run