!1258 merge main into main feat: handle conflicting module symbols Created-by: 2301_81676461 Commit-by: 2301_81676461 Merged-by: cangjie-ci Description: ## Change Details (Required) Please describe the changes in this Pull Request. **修改 SymbolCollector.cpp** 第一阶段只处理本次增量编译路径覆盖的文件。 先建立刷新后的符号和 symbolRefMap。 第二阶段再从索引继承未覆盖文件的符号。 继承时使用刷新后的 Symbol ID 去重。 处理顺序由: 按 package.files 顺序交替执行: 重新收集 / 继承旧符号 调整为: 重新收集全部当前路径符号 ↓ 建立最新 Symbol ID ↓ 继承全部未覆盖文件符号并去重 解决补全项每次增量编译增加一个的问题。 **保存直接依赖的真实路径关系** 修改 ModuleManager.h 和 ModuleManger.cpp: 新增: directRequirePaths ModuleNameConflict GetModuleNameConflict(...) HasModuleNameConflict(...) ResolveModuleNameConflict(...) directRequirePaths 记录: 当前模块规范化路径 -> 直接非脚本依赖名称 -> 依赖模块规范化路径 冲突判断使用文件路径、直接依赖边和规范化路径联合判断,不再仅依赖全局同名模块列表。 **增加 package 声明诊断** 修改 CompilerCangjieProject.cpp: 新增 ReportModuleNameConflict(): 根据当前文件路径找到所属模块。 调用严格冲突判断。 将诊断范围定位到 package boo。 通过原有诊断回调发布错误。 诊断文案与 CJPM 保持一致。 同时覆盖有、无完整编译实例的依赖更新路径,保证包声明解析完成后能够报告冲突。 与CJPM Build处理类似的提前停止编译 修改 LSPCompilerInstance.cpp: 在完成解析、条件编译和依赖导入后,执行宏展开和 Sema 之前检查模块冲突: if (moduleManger && moduleManger->HasModuleNameConflict(moduleName)) { return false; } 仅对已经严格确认冲突的模块跳过宏展开和语义分析,避免把内外两个 boo 错误合并后产生: function 'main' has overload conflicts multiple 'main's are found in source files **影响范围:** 冲突模块仍保留解析和根因诊断能力。 冲突模块中依赖完整语义模型的补全、悬浮、跳转等能力受限。 正常模块和无冲突工程继续执行原有完整语义编译流程。 新增 7 个 ModuleManagerTest ## Change Type (Required) Please describe the type of changes in this Pull Request (reason). **Simply save and click the checkbox, or when editing, change [ ] to [x] for the relevant item.** - [x] Feature - [ ] Bugfix - [ ] Build Process or Auxiliary Tool Changes - [ ] Documentation Update ## Self-Check of Changes (Required) **Please do not modify or delete the following options. Simply save and click the checkbox, or when editing, change [ ] to [x] for the relevant item.** ### Local Compilation Verification Results: - [x] Cangjie Tools compiled successfully - [ ] Not applicable (select this option for auxiliary tool changes or documentation updates) ### Local Test Case Verification Results: - [x] Pass. Please provide screenshots below.  - [ ] Not applicable. Please explain the reasons below. ## Related Issues (Required) Please provide links to issues related to this Pull Request. https://gitcode.com/Cangjie/cangjie_tools/issues/673 See merge request: Cangjie/cangjie_tools!1258