Skip to content

fix(workspace): accept package directory marks - #250

Merged
1lck merged 2 commits into
mainfrom
devin/2546-package-directory-icon
Dec 2, 2026
Merged

1lck merged 2 commits into
mainfrom
devin/2546-package-directory-icon

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

关联 Issue:1lck/Lithe-IDEA#2546
PR 类型:fix

Maven、Java 等以包目录组织源码的构建工具已经可以通过 workspace/setDirectoryMarks 上报源代码根、资源根和测试根,但 package 这个 Core 目录呈现解析器已有的内建角色没有同时加入宿主方法校验:插件一旦提交包含 package 的标记,整组 setDirectoryMarks 会被拒绝,源码/资源根也无法显示。项目树把 package role 解析成普通 folder 图标,即使绕过校验也没有包目录的专用呈现。

已调查 API-05 的现有 workspace/setDirectoryTypes、workspace/setDirectoryMarks 与 workspace.resolveDirectoryPresentation:能力本身已经存在,缺的是同一版本内校验、契约文字和呈现的一致性;不需要新方法、新权限或版本升级。该能力不是 Maven 特有,任何按包目录展示源码的第二个构建工具都可以复用;Maven 特有目录判断留在 Maven 插件。

改动

  • workspace/setDirectoryMarks 的 workflow 校验接受内建 package role,并增加回归用例。
  • workspace.resolveDirectoryPresentation 将 package role 的图标从 folder 改为已有的 package 图标,并扩展共享 fixture。
  • 契约 README 的 role 列表补齐 package;协议更新记录登记本次同一版本内的行为修正。
  • 未新增方法、通知、权限、错误码、能力版本、协议版本或 SDK 版本。
原计划编号 方法 用途
API-05 workspace/setDirectoryMarks 允许插件把源码根下的包目录标成内建 package 角色

兼容与 SDK

省略该角色时行为完全不变。旧 Core 会按参数无效拒绝包含 package 的整组标记;需要该角色的插件应把整组失败作为旧宿主降级信号。四种官方 SDK 已经以通用 JSON 参数/结果暴露 workspace/setDirectoryMarks,本 PR 不改变类型、调用形状、错误或日志,因此无 SDK 代码变更;example 不新增。无新增稳定错误码,仍使用既有参数校验失败路径,全契约查重无新增编号。

验证

已在 Linux x64 本机执行:

  • cargo test -p lithe-plugin-rpc workflow:5 passed
  • cargo test -p lithe-project directory_rules:10 passed(在实现修复时执行)
  • cargo fmt --check -p lithe-plugin-rpc
  • cargo fmt --check -p lithe-project
  • node shared/plugins/scripts/verify-docs.mjs:通过
  • 真实 Linux 桌面端到端复测(配合 Maven 插件分支):标准 Maven 项目手动 Reload 后 src/main/java、src/main/resources、src/test/java 和 com/example/qa 分别显示 sources/resources/tests/package 标记;未再出现 maven.directoryMarks.markFailed

未执行:Windows 原生验证(本机为 Linux);动态新增 package 后的刷新补测。

关联插件 PR:lithe-plugin-maven#49。

Link to Devin session: https://app.devin.ai/sessions/0053faef0de247aca7147e15ddd7d6de
Open in Devin Desktop: https://app.devin.ai/desktop/session/0053faef0de247aca7147e15ddd7d6de?variant=devin
Requested by: @1lck


🟢 Devin Review found nothing to fix · View findings

Devin Review

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@1lck
1lck merged commit b2c6bf3 into main Dec 2, 2026
12 checks passed
@1lck
1lck deleted the devin/2546-package-directory-icon branch December 2, 2026 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant