Repository navigation
docs: 契约同步到 #1595 合并后的 preview 提交并补全后端指南 - #7
Merged
Merged
Conversation
#6 合入时契约仍固定在 #1595 的中途 head f20601ee6,未包含之后推送的 公共宿主方法、ui 4 纯后端命令和 hostRequestBytes/hostResultBytes 上限。 现同步到合并提交 9175bd734,并在指南中补上对应说明。
xiaoyumuxi
marked this pull request as ready for review
October 30, 2026 15:58
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.
补上 #6 漏掉的合并后同步。#6 合入时契约还固定在 1lck/Lithe-IDEA#1595 的中途 head
f20601ee6;#1595 在那之后又推送了提交,并于 2026-10-30 以9175bd734合入 preview。本 PR 把契约同步到这个合并提交,并按新增内容更新指南。1. 契约同步(
contract/v1、contract.lock.json)node scripts/contract.mjs sync --revision 9175bd73431aec5086f1fe4c532be54fc49ba4e8,从 56 个文件变为 57 个。f20601ee6的契约变化:documents/*、editor/*(读取、编辑、打开、定位)、workspace/readDirectory|stat|readFile|watch|findFiles|findText、preview/openHTML、browser/openExternal、window/show*,以及各自的参数、上限、取消语义和重试规则。workspace.files.read、workspace.files.watch、workspace.search、documents.read、editor.edit、editor.open、preview.open、browser.open、window.messages。hostServices里使用完整方法名;旧的workspace授权仍然只能访问元数据,不能读文件。ui4 纯后端命令:命令可以不写toolWindowID,toolWindows可以为空;schema 里去掉了ui.toolWindows必填、minItems: 1和命令的toolWindowID必填。新增 fixturecommand-backend.plugin.json。getCapabilities.limits新增hostRequestBytes和hostResultBytes;function-protocol.json新增 3 个授权边界用例。preview运行drift,结果是无漂移)。2. 指南
guides/plugin-backend-workspace.mdgetCapabilities示例里的limits补上两个新字段。requires.ui: 4。ui4)”小节:清单片段、所需权限和激活事件、旧宿主的行为;并说明didRun只是事件,不代表命令已经执行成功。workspace.metadata不授权读文件;坐标约定、128 KiB 和 1,000 项上限;取消或超时不代表已回滚;各失败码怎么重试;消息的频率限制。没有改的
验证(本地)
node --test scripts/*.test.mjs:15 个全部通过。node scripts/contract.mjs verify --upstream:57 个文件与9175bd734一致。node scripts/contract.mjs drift --ref preview:无漂移。