Pull Request已成功合入, 合并人@cangjie-ci
(感谢 Cangjie-Chenminglei 的贡献)PR创建成功通知 | 感谢您的贡献 🎉
您好!系统已检测到您成功创建 Pull Request(PR),感谢您对项目的支持与参与!以下几点需要您着重关注:
一、PR必须关联Issue ❗️
触发门禁检查的必要步骤:在PR描述框输入Issue完整链接,完成Issue关联。
请注意,一个 Issue 不能同时关联同一 base 仓库内同一个分支的多个开启状态的 PR
二、门禁触发规则 🔧
- 门禁类型判定:由Issue关联的PR所属代码仓数量决定
- 关联多个代码仓PR:触发「多仓联合门禁」
- 关联单个代码仓PR:触发「单仓门禁」
- 启动指令与检查范围:需主动回复指令:
- 回复 "start build":执行Cangjie的主要基础检查,包含commit格式检查、静态告警分析、OAT开源声明检查、多平台构建、单元/集成测试等
- 关联同一issue的多个PR,仅需在任意一个PR里回复触发一次门禁,该PR门禁通过后,所有PR都会添加Label和测试人
- 每个pr只能同时运行一条CI流水线,如需重新启动,请先关闭运行中的,再评论触发门禁
- Markdown修改仅触发文档类构建测试门禁,不会触发Cangjie的编译测试门禁
- commit 信息格式请遵循:Conventional Commits 规范
- 请保证每一条 commit 都已添加
Signed-Off-By信息 - 回复 "start build cov":执行覆盖率构建工程,生成该提交的增量代码覆盖率报告
三、合入条件 ⚠️
- 满足最低评审人数,且评审问题需全部解决;
- 禁止合入本人创建的PR,需由其他协作者操作;
- 合并前确保关联流水线任务运行成功(build-test-passed);
- 需求类覆盖率门禁:当关联的 Issue 标题以
[feature]:开头(需求类 Issue)时,联合提交中属于cangjie_compiler、cangjie_runtime、cangjie_stdx、cangjie_tools、llvm-project仓库的 PR,必须先回复 "start build cov" 触发增量覆盖率流水线并通过,使 PR 获得cov-test-passed标签后方可合入。
四、合并PR ✅
回复 "start merge",CI流水线会自动检查所有关联PR的状态、版本号标签、检视意见密度、兼容性、需求类覆盖率门禁,若所有PR都满足合并条件,则将会同时合并所有PR。若存在不满足合并条件的PR,则不会合并任何PR。
如果希望不进行兼容性相关的检测,请任一合法审查人复制以下内容,在 start merge 前提交评论:
本 pr 不需要兼容性相关检测,对于引发的任何兼容性问题(即由于本 pr 合入将导致用户需适配代码的话),由本人承担。
If you wish to avoid compatibility-related checks, please have any approver copy the following content and submit it as a comment before sending start merge:
This PR does not require compatibility-related checks. For any compatibility issues caused by this PR (i.e., if the integration of this PR will require users to adapt their code), I will take full responsibility.
五、补充说明 📢
- 详细仓颉贡献流程:贡献流程(Cangjie Community Contribution)
- 门禁结果将自动评论至关联的所有PR,敬请留意。


smart build


CI门禁流水线已启动,正在后台运行中,您可以点击Pipeline Detail查看运行状态。
门禁工作流:
graph LR
A[PR检测] --> B[联合构建]
B[联合构建] --> C[测试运行]
检查内容包括
- commitlint检查
- 构建任务
- linux x64、mac aarch64、windows x64
- 测试任务
- UT、HLT、LLT
门禁产物归档路径: obs://cangjie103/CangjieDaily/pub/ci/gate/main/cangjie_tools/1276


start merge


⏳ 正在进行兼容性检测中,可能需要2~3分钟,请稍候,若10分钟无检测结果,请重新回复 start merge。
⏳ Compatibility check in progress. It may take 2–3 minutes. Please wait. If there is no result after 10 minutes, please reply with start merge again.


✅ 合入前兼容性检测通过。
涉及仓库:Cangjie/cangjie_tools
结论
- 分析过程:已分析 Cangjie/cangjie_tools#1276,确认其 1 个语言服务器实现文件和 6 个回归测试文件的变更范围,并核对了多导入补全、导入修饰符识别及 token 边界处理。Analyzed Cangjie/cangjie_tools#1276, including the language-server implementation change and six regression-test files covering multi-import completion, import modifiers, and token-boundary handling.
- 原因:兼容。该 PR 仅修复语言服务器对带访问修饰符的多导入语句(如 public/internal import)进行成员补全时的识别和前缀提取,并增加回归测试;未删除或修改仓颉公开语言 API、ABI、配置键、构建/打包入口或既有成功调用契约。实现保留原有 import/package 处理,并增加 token 下标边界检查,属于对既有补全能力的兼容性修复。Compatible: the PR only fixes language-server completion for modified multi-import statements such as public/internal imports and adds regression tests. It does not remove or alter public Cangjie APIs, ABI, configuration keys, build or packaging entry points, or existing successful-call contracts; existing import/package handling is preserved and token bounds checking is strengthened.
- 结论:兼容


✅ 以下PR将同时合入:
- Cangjie/cangjie_tools#1276: fix(lsp): support modified multi-import completion
✅ The following PRs will be merged simultaneously:
- Cangjie/cangjie_tools#1276: fix(lsp): support modified multi-import completion


Change Details (Required)
题总结
仓颉语言支持在多导入语句中进行成员补全,例如:
import a.{bb}
但当 import 前存在访问修饰符时,例如:
public import a.{bb}
internal import a.{bb}
花括号内的补全会失效。
原因是补全逻辑原本通过当前行的第一个 token 判断是否为多导入语句,并且只处理以下形式:
import ...
public import ...
对于其他带修饰符的导入,当前行首 token 不再是 import,因此无法进入多导入专用补全路径。同时,包名前缀提取逻辑没有排除修饰符,可能会把 public 或
internal 当作包名的一部分。
修复内容
调整 IsMultiImport 判断逻辑:
调整 GetMultiImportPrefix:
忽略 public、private、protected、internal 等导入修饰符;
保证包名前缀仍然正确,例如:
public import default.{pkgA.A1}
提取出的前缀仍为:
default
调整 IsPreambleComplete:
增加回归测试:
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.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:
Local Test Case Verification Results:
Related Issues (Required)
Please provide links to issues related to this Pull Request.
https://gitcode.com/Cangjie/cangjie_tools/issues/687