Repository navigation
feat(tree): 紧凑显示时模块根与标记目录自成一行 - #259
Merged
Merged
Conversation
workspace.projectTree.rows 的节点新增 alone:宿主把模块根、带目录标记(源码根等)的文件夹标为 alone,这样的文件夹既不并入上一级的链,也不把唯一的子文件夹并进自己的行,对齐 IntelliJ IDEA。契约与 project-tree-rows-v1 fixture 同步更新。
xiaoyumuxi
added a commit
to 1lck/Lithe-IDEA
that referenced
this pull request
Dec 3, 2026
参照 IntelliJ IDEA 的 Compact Middle Packages 和 VS Code 的 explorer.compactFolders:只含一个文件夹的文件夹与它合并成一行 a/b/c, 名称只用“/”连接(Java 包名的“.”属于语言插件)。 - 项目树:行、链首和缩进由 Core workspace.projectTree.rows(compact)计算; 整条链共用链首的展开状态,点箭头一起展开/折叠,链随读取逐步延长。 - 照 IDEA 的做法,构建模块根和自身带标记(源代码、排除等角色或颜色)的 文件夹以 alone 交给 Core,自成一行;只继承上级底色的文件夹照常合并。 标记或模块根变化时重新排列。 - Commit 窗口:按目录分组时中间文件夹与“a/b/c”标签由 Core git.changedFileGroups(nest)计算,宿主不再自己拼中间文件夹。 - 项目工具窗口标题栏新增“…”(视图选项),与 Commit 窗口视图选项里的 “压缩中间文件夹”同一个设置,默认开启,关闭写入 disableCompactFolders。 - 固定 Core 到 Lithe-IDEA/Lithe-core-rust#259 的 head 68ded47e。 - 新增功能矩阵条目、中英词条、回归测试与无头截图。 Closes #2641
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:1lck/Lithe-IDEA#2641(树层级太深,单一子文件夹自动折叠),接 #257;桌面端 PR:1lck/Lithe-IDEA#2653(临时固定本 PR 的
68ded47e)类型:feat
改动
#257 让
workspace.projectTree.rows的compact把“只含一个文件夹的文件夹”合并成一行。桌面端接入后发现:构建模块根(如common)和被标记的目录(如源代码根src/main/java)也会被并进链里,它们的加粗、模块角标、源代码颜色和标签就落到了别的文件夹名上,或者整行消失。IntelliJ IDEA 的 Compact Middle Packages 不会把模块根和源代码根并进链,本 PR 照这个做法补上。workspace.projectTree.rowsalone:宿主说这个文件夹自己要占一行(例如它是模块根,或带有源代码、排除等标记)。compact判定链时,alone的文件夹不和上面的文件夹合并,也不和唯一的子文件夹合并。它下面的文件夹照常判定,所以源代码根里的包仍然会合并(java一行,com/lithe一行)。compact时,folder、listed、alone都被忽略,行为不变。alone由宿主决定,Core 只按这个字段排行,不认识模块或目录角色。其他
rust/fixtures/workspace/project-tree-rows-v1.json新增用例“a folder that keeps a row of its own is in no chain”:common和common/src/main/java是alone。预期common自成一行,src/main合并,java自成一行,没有标记的lib/x照常合并。rust/contracts/rust-core-api.md补充了alone的说明。验证
cargo test -p lithe-core --lib project_tree(含 fixture 用例)、cargo test -p lithe-project-tree:通过cargo fmt --check、cargo clippy -p lithe-project-tree -p lithe-core --all-targets -- -D warnings:通过scripts/rust-core/verify-rust-core-comments.sh、node scripts/rust-core/verify-platform-tests.mjs:通过桌面端接入在 Lithe-IDEA 的配套 Draft PR 中(临时固定本 PR 的 head
68ded47e;本 PR 合入后再换到 main 上的提交)。