Repository navigation
feat(lsp-policy): 问题工具窗口的树行、折叠与选中交给 Core - #82
Merged
Merged
Conversation
lsp.problems.query 接受平台保存的折叠分组键和选中行键,返回可见的树行 (分组节点在上,诊断在下;不分组时诊断在顶层)、选中行及其位置,文件 分组多返回 name 和 folder。诊断行键由文件、位置和同一位置上的序号组成, 服务器重新发布诊断后选中仍停在同一条上;被折叠的诊断选中移到所在节点, 消失的诊断在按文件分组时移到所在文件节点。
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
类型
feat:
lsp.problems.query增加树状态入参,返回可见行和选中行;文件分组带name、folder改动
桌面端的问题(Problems)工具窗口改成 IDEA 那样的树:文件或严重程度节点可以展开收起,下面是问题行。原来宿主把分组结果平铺成行,展开状态和选中要移到哪一行都得自己算。本 PR 把这些规则放进 Core,宿主只保留折叠键、选中键和绘制,和
lsp.references.query(#80)同一种写法。collapsed?:[groupKey](关着的节点键,未知键忽略)、selected?(选中行键)rows:[{key,kind,depth,expanded?,group?,shows}]、selected?、selectedRow?;groups[]的文件分组多name、folder原有的
groups、files、visibleCounts、totalCounts不变。规则(
rust/crates/lsp-policy/src/problems.rs):file:<fileKey>,严重程度节点severity:<n>,问题行diagnostic:<line>:<column>:<ordinal>:<fileKey>。ordinal只数同一文件、同一位置上更早提交的问题,所以服务器重新发布、问题换了下标时,选中还停在同一条问题上。rows只含可见行:按文件或严重程度分组时,节点在深度 0、问题在深度 1,节点带expanded;groupBy为none时没有节点,问题都在深度 0,collapsed不起作用。shows是这一行预览和打开的问题在提交列表里的下标:问题行是它自己,节点是它下面第一条。selectedRow是选中行在rows里的位置。name是显示路径的最后一段,folder是其余部分(在根目录时为空),宿主不再自己拆路径。文档:
rust/contracts/rust-core-api.md的命令表和lsp.problems.query一节写入新字段、行键和选中规则;LspCommand::ProblemsQuery的注释同步更新。Fixture:
rust/fixtures/lsp/problems-query-v1.json原有用例补上rows、selected和文件分组的name/folder,新增 6 个用例:宿主的桥接测试直接读这份 fixture,经真实 Core 比对。
插件契约:没有改
shared/plugins/、能力版本或plugin-rpc,不需要更新协议更新记录,也不需要宿主方法表。验证
cargo test -p lithe-core -- lsp_policycargo clippy -p lithe-lsp-policy -p lithe-core --all-targets -- -D warnings、cargo fmt --all -- --checkscripts/rust-core/verify-rust-core-comments.shnode scripts/rust-core/verify-platform-tests.mjsnode shared/plugins/scripts/verify-docs.mjsdesktop-go.sh test ./...(链接本分支 e270b7b)localshell里一个已知偶发用例首轮失败,单独重跑通过,与本改动无关后续
PINNED_CORE_REVISION升到本 PR 的合入提交 cf2f260。