Repository navigation
fix(desktop): Core 固定到 c0dd2a4,Unix 文件名里的反斜杠不再让项目树报错 (#2009) - #2023
Merged
Merged
Conversation
macOS 上按 Windows 写法配置的 Spring Boot 日志路径 D:\logs 会在项目里创建 一个名字就叫 D:\logs 的文件夹。Core 原来不分平台地把 \ 当成分隔符,把它报成 D:/logs,项目树行校验发现它不在根目录下,整棵树报 workspace.projectTree.rows 的 "A project tree node is not in the folder above it"。 - PINNED_CORE_REVISION 升到 Lithe-core-rust #62 的 c0dd2a4(基于 main 6a14126):路径规则统一进 lithe-platform,Unix 上 \ 和 : 是文件名的一部分, Windows 不变。#62 合入后改为 main 上的 commit。 - 新增 TestProjectTreeShowsUnixNamesWithBackslashes:真实 Core 打开含 D:\logs/spring.log 和 D:\logs\app.log 的目录,断言行的层级和顺序且没有通知; 旧固定版本下它报出与 Issue 相同的通知。Windows 上跳过。 - 功能矩阵 file-explorer 的 verification 记录这次修复。 Closes #2009
2 tasks done
xiaoyumuxi
marked this pull request as ready for review
November 16, 2026 08:13
9 tasks done
15 tasks done
xiaoyumuxi
added a commit
that referenced
this pull request
Nov 16, 2026
#2023 把 PINNED_CORE_REVISION 暂时固定到 Lithe-core-rust #62 分支上的 c0dd2a4。#62 和 #63 都已合入 Core main,这里改为 main 上的 ad148ec: - #62(b401949,内容与 c0dd2a4 相同):Unix 文件名里的 \ 和 : 是名字的 一部分,含 D:\logs 的项目树不再报错(#2009)。 - #63(ad148ec):macOS 上进程组只剩未回收的僵尸进程时 kill 返回 EPERM, 不再当成失败。停止或重启语言服务器不再误报 "Language-server process tree did not exit.",关闭 SSH 会话不再误写清理失败的 WARN(#2017)。 功能矩阵 lsp-lifecycle 的 verification 记录 #63;两端状态不变。宿主代码 没有改动。
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 / Linked issue
#2009 里的"无法直接运行启动类"看起来是另一个问题,已在 Issue 里请报告人补充信息。本 PR 只修项目树报错。
PR 类型 / Type
改动说明 / What changes
背景 / Why
#2009:在 macOS 上导入一个 Spring Boot 项目后,项目树为空,并弹出通知:
Spring Boot 的
logging.file.path如果按 Windows 写法配置成D:\logs,在 macOS 上运行后,会在项目目录里创建一个名字就叫D:\logs的文件夹。Unix 上\和:都是普通的文件名字符,但 Core 不分平台地把\当成分隔符,把这个文件夹报成了D:/logs。桌面端按真实的嵌套层级把它放在第 1 层,Core 计算项目树行时发现它不在根目录下面,整棵树就报错了。修复在 Core:Lithe-core-rust #62 把分隔符和相对路径规则统一放进
lithe-platform,做成带Platform参数的函数。Unix 上\和:是文件名的一部分,Windows 上的行为不变。本 PR 把桌面端固定到包含这个修复的 Core,并补桌面端回归测试。宿主代码没有改动。改动 / Changes
scripts/desktop/build-desktop-core.sh:PINNED_CORE_REVISION从6a14126(Core fix(settings): refresh locale when language changes #61)升到c0dd2a4。这是 Core Fix/issue 35 worktree crash #62 分支fix/2009-unix-backslash-file-names上的 commit,基于 Core main6a14126,所以只多了 Fix/issue 35 worktree crash #62 的改动。c0dd2a4不能长期依赖。desktop/internal/workbench/filetree_test.go:新增TestProjectTreeShowsUnixNamesWithBackslashes。D:\logs/spring.log和D:\logs\app.log。前者在名叫D:\logs的文件夹里,后者是根目录下名叫D:\logs\app.log的文件。D:\logs的文件夹。D:\logs、D:\logs/spring.log、D:\logs\app.log,并且没有任何通知。Windows 上
\是分隔符,测试跳过。shared/platform-feature-matrix/features/file-explorer.json:在verification末尾记录这次修复、对应的测试命令,以及"原生窗口验收待做"。实现状态和验证状态不变。不在本 PR 范围内 / Out of scope
:的路径,这类文件不能暂存、忽略或查看 diff。需要把分支名、远程名的校验和路径校验拆开,单独处理:[Bug] macOS 上 Git 操作拒绝文件名含 ":" 的文件:is_safe_pathspec 同时校验 ref 和工作区路径 #2016。类型专属:fix
复现与根因
D:\logs(Spring Boot 读取logging.file.path: D:\logs时就会这样创建),里面放一个文件,然后用 Lithe 打开项目。D:\logs作为根目录下的一个文件夹显示,展开后能看到里面的文件。lithe-project的relative_path和lithe_protocol::invalid_relative_path不分平台地把\当成分隔符。\的条目会让整棵树报错,而不只是显示位置不对。\本来就是分隔符,行为不变。检查项
desktop/internal/workbench/filetree_test.go中的TestProjectTreeShowsUnixNamesWithBackslashes。6a14126)的失败输出,正是 Issue 截图里的通知:c0dd2a4):通过。\是分隔符,不存在这个问题;Windows 的路径规则在 Core 里以Platform::Windows数据形式测过。:的路径)、[Bug] macOS 上 lsp_process 测试不稳定:terminate 后 dispose 报 EPERM(Language-server process tree did not exit) #2017(不稳定的平台测试)。lithe-platform里,由 Core 的文档注释和两个平台各自的测试约束;桌面端没有新的行为约束。范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/file-explorer.json的verification;两端的实现状态和验证状态不变,原生窗口验收仍为待做。./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh和./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEAD。.artifacts/下生成的矩阵视图。插件归属 / Plugin ownership
UI 验证 / UI evidence
N/A:没有布局、控件、样式或文案变化。项目树的显示方式不变,只是原来报错的项目现在能正常显示。
统一日志系统 / Structured logging
N/A:没有新增或改动日志事件和失败路径。
界面文案 / i18n
N/A:没有新增或修改界面文字。仍运行了两个 i18n 检查,结果见"验证"。
逻辑归属 / Logic placement
lithe-platform),平台差异作为数据。桌面端只升级固定版本、补测试。性能与内存 / Performance and memory
N/A:没有新增后台功能、子进程、缓存或轮询。
设置 / Settings
N/A:没有设置改动。
插件契约 / Plugin contract
N/A:Core #62 没有改插件契约、能力版本、插件函数协议或宿主方法。
发行包与资源 / Bundle and resources
N/A:没有新增运行时资源或下载、解压步骤,只改了已有的 Core 固定版本。
无用代码与重构 / Dead code and refactoring
验证 / Verification
本机为 Apple M4,macOS 27.3,Go 与 Rust 1.100.0。
./scripts/desktop/desktop-go.sh test ./internal/workbench -run TestProjectTreeShowsUnixNamesWithBackslashes -count=1,固定到6a14126c0dd2a4./scripts/desktop/desktop-go.sh test ./... -count=1(main 2a566f5 上)./scripts/desktop/desktop-go.sh test ./internal/workbench -count=1(变基到 988653e 后重跑)./scripts/desktop/desktop-go.sh test -race ./internal/workbench -run 'TestProjectTree' -count=3./.agents/skills/write-stable-tests/scripts/test-stability-macos.sh --package ./internal/workbench -- --filter TestProjectTreeShowsUnixNamesWithBackslashes./.agents/skills/write-stable-tests/scripts/verify-test-stability.sh及--base origin/main./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEADnode scripts/i18n/verify-app-language-localization.mjs、node scripts/i18n/generate-i18n.mjs --checkdevelop-lithe第三节)未能执行的检查和原因:
Platform::Windows数据形式测试,Windows 目标的 clippy 已通过。PR 标记 ready 后,Windows CI 会运行完整的桌面测试。verify-runtime-bundle-immutability.sh没有运行:本 PR 没有改运行时资源。提交前确认 / Final checks
main(988653efe),目标分支main。