Repository navigation
feat(core): #1662 第二轮 搜索与可见性(WS-03/04) - #1766
Merged
Merged
Conversation
This was referenced Nov 5, 2026
Owner
Author
本地集成验证(#1662 第二轮)本 PR 与 #1765、#1768、#1767、#1766、#1769 一起,在本地集成分支 Rust
校验脚本 macOS
Windows 前端(在 Mac 上用 bun 跑)
未执行 验证通过后用 |
用户设置值不变,只把 hiddenDirectoryPatterns/hiddenFilePatterns 映射成 Core 请求的 hiddenDirectoryNames/hiddenFilePatterns,默认规则和解释权都在 Core。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 新增纯函数命令 workspace.rankNames:候选名、查询和显式上下文(打开/最近访问) 进,分数、分层、UTF-16 高亮区间和排序出,与 searchEverywhere 共用同一个匹配器。 - Windows:Quick Open 改为异步出结果(请求去重、过期结果丢弃、加载期间保留旧列表), remote/wsl 根目录的候选名仍由平台获取;删除 fuzzy-search.ts、fffSearchFiles 的子串匹配, 符号搜索和文件导航侧栏的模糊模式也改走 rankNames。 - macOS:删除 SearchRelevance 的兼容打分,只使用 Core 返回的 matchingDegree,测试改为 Core fixture。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- workspace.searchEverywhere 新增可选 context { openPaths, recentPaths }(相对 root、/ 分隔),
与 workspace.rankNames 共用同一份排序代码(ContextIndex),把已打开/最近访问折进 matchingDegree 做同分排序;
不传 context 时行为完全不变。
- Windows:本地根目录的 Quick Open 和 fffSearchFiles 改走 searchEverywhere(只要文件名,带隐藏规则),
rankNames 只留给 remote/WSL 根目录、符号列表和导航侧栏这类平台自行枚举的小列表,契约中写明边界。
- macOS 没有已打开/最近访问排序,删除 SearchRelevance 后排序不变。
- 新增 fixture search-everywhere-context-v1.json,Rust 与 Windows 测试同步更新。
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1lck
force-pushed
the
feat/issue-1662-r2-search-visibility
branch
from
November 5, 2026 13:59
4d4f482 to
3278b5e
Compare
1lck
marked this pull request as ready for review
November 5, 2026 13:59
This was referenced Nov 5, 2026
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.
第二轮【搜索与可见性】车道,对应 #1662 的 WS-03、WS-04。
WS-03 Quick Open 名称匹配与评分(完成,两端接好、旧实现已删)
workspace.rankNames(rust/lithe-core/src/project/name_ranking.rs):纯函数,输入候选名({name, path?})、查询和显式上下文(openPaths、按最近到最远排序的recentPaths),输出matches: [{index, degree, tier, nameMatchRanges}]。与workspace.searchEverywhere共用同一个匹配器,所以DH能命中DeviceHandler.java;名称没命中时用路径做更弱的匹配;排序依次是分数、open/recent/other 分层、最近访问顺序、IDEA 文件名顺序、请求顺序;每层独立限量;超限输入报invalid_request而不是截断。Fixture:shared/fixtures/search/rank-names-v1.json。rankNames(这是第一轮撤出 WS-03 的原因)。quick-open/utils/fuzzy-search.ts、use-file-search.ts里的fuzzyScore兜底和fffSearchFiles的子串匹配;fffSearchFiles现在是“列清单 + rankNames”。@)和文件导航侧栏的 fuzzy 模式原先也用这份本地评分,一并改走rankNames(新的useRankedNameshook)。SearchRelevance.swift的兼容打分,SearchEverywhereView只用 Core 返回的matchingDegree;原来 5 个测 Swift 本地打分的测试删除,同等行为改由 Rust fixture 测试覆盖。rust-core-api.md、功能矩阵search-quick-open。WS-04 隐藏路径规则(部分完成,其余撤出)
workspace.searchEverywhere)、文件清单(workspace.snapshot)、本地历史(history.entries/history.record/项目时间线)请求现在带上设置里的隐藏规则(hiddenPathRules():目录名 ->hiddenDirectoryNames,带通配符或分隔符的目录项 -> 目录 glob,文件模式原样传),用户设置值不变,解释权在 Core(Core 自带的node_modules、target等内置规则一并生效)。project::visibility批量分类、“仅文件树隐藏 / 搜索历史也排除”的区分,以及删除 SwiftFileVisibilityRules.swift和 Windowsdefault-settings.ts里的默认列表。原因:ignore库判断(file-explorer-tree.tsx的isUserHidden),改成 Core 批量分类要把它变成异步预分类,而这个文件正是 fix(workspace): 完善忽略目录排除提示与树状态 #1658/fix(git): 跳过忽略或排除目录内的普通子仓库 #1659 大面积修改的地方,冲突和闪烁风险高;FileVisibilityRules在 watcher、快照构建、tree loader 等 20 多处同步调用isHidden,其默认列表所在模块LitheCoreContracts不依赖 Rust bridge,没有同步取 Core 默认值的通道;重叠的 open PR
#1658、#1659 与本 PR 没有直接重叠的文件(它们改
file-explorer-tree.tsx、files.rs、indexing.rs、protocol/command.rs、dispatcher.rs、rust-core-api.md;我只在command.rs、dispatcher.rs、rust-core-api.md做了追加式的一行级改动,可能出现邻近行的文本冲突)。WS-04 的文件树部分正是为避开它们而撤出。验证
cargo test -p lithe-core --lib rank_names:通过。bun run typecheck通过;quick-open、file-search、file-explorer-selection、settings/lib下相关测试逐文件通过;rank-names.test.ts用真实 Core 动态库(LITHE_CORE_TEST_LIBRARY)跑 fixture 全部通过。verify-rust-core-comments、verify-shared-contracts、verify-service-boundaries、verify-windows-boundaries、verify-platform-feature-matrix、两个 i18n 检查均通过(本次没有新增界面文案)。verify-core.sh同样在排队;Windows 真机验证由主会话在 lithe-dev 上做。风险
.idea、.hg等默认项会被排除出搜索结果和 Quick Open 清单。Refs #1662
🤖 Generated with Claude Code